zend_oo icon indicating copy to clipboard operation
zend_oo copied to clipboard

sc_create, sc_send, sc_sendmany are missing an optional "fee" argument

Open cronicc opened this issue 3 years ago • 0 comments

In broad terms we currently have two types of RPC commands that are able to send transparent transactions:

  1. Commands inherited from bitcoin that use the deprecated account model (sendtoaddress, sendfrom, sendmany). These commands don't provide arguments to choose the "from address" or set a custom fee. They usually do provide the subtractfeefromamount option which can be useful.
  2. Commands added by Zcash that also handle transparent transactions (z_sendmany). These provide the ability to provide both a "from address" and statically set a fee.

I think that both selecting the "from address" and setting a custom fee are useful features that should be incorporated into all wallet related sidechain RPC commands we add.

In case of z_sendmany the optional fee argument either sets a static fee if the argument is provided with a value, or 0.0001 if omitted. For the sc_ RPC commands a non static default fee (fee per byte) was chosen. As any optional commands are mandatory if they're followed by additional arguments, a default value (setting fee per byte) needs to be provided.

I propose the following behavior:

X. fee                   (numeric, optional) The fee amount to attach to this transaction. If the empty string "" is passed or the argument is omitted the default fee rate of 1sat per byte will be used.

cronicc avatar Jul 26 '21 12:07 cronicc