walletcreatefundedpsbt
has some interesting features that sendtoaddress
and sendmany
don’t have:
- manual coin selection
- outputting a PSBT (it was controversial to add this, see #18201)
- create a transaction without adding to wallet (which leads to broadcasting, unless
-walletbroadcast=0
)
At the same time walletcreatefundedpsbt
can’t broadcast a transaction, which is inconvenient for simple use cases.
This PR introduces a new send
RPC method which creates a PSBT, signs it if possible and adds it to the wallet by default. If it can’t sign all inputs, it outputs a PSBT. If add_to_wallet
is set to false
it will return the transaction in both PSBT and hex format.
Because it uses a PSBT internally, it will much easier to add hardware wallet support to this method (see #16546).
For bitcoin-cli
users, it tries to keep the simplest use case easy to use:
0bitcoin-cli -regtest send '{"ADDRESS": 0.1}' 1 sat/b
This paves the way for deprecating sendtoaddress
and sendmany
though there’s no rush. The only missing feature compared to these older methods is adding labels to a destination address.
Depends on: