diff --git a/doc/external-signer.md b/doc/external-signer.md index d777871d7da..de5e5b5aba8 100644 --- a/doc/external-signer.md +++ b/doc/external-signer.md @@ -67,7 +67,7 @@ Replace `
` with the result of `getnewaddress`. Under the hood this uses a [PSBT (Partially Signed Bitcoin Transaction)](psbt.md). ```sh -bitcoin-cli -rpcwallet= sendtoaddress
+bitcoin rpc -rpcwallet= send outputs='{"
": }' ``` This constructs a PSBT and prompts your external signer to sign (will fail if it's not connected). If successful, Bitcoin Core finalizes and broadcasts the transaction. @@ -218,6 +218,4 @@ It then imports descriptors for all supported address types, in a BIP44/49/84/86 The `walletdisplayaddress` RPC reuses some code from `getaddressinfo` on the provided address and obtains the inferred descriptor. It then calls ` --fingerprint=00000000 displayaddress --desc=`. -For external-signer wallets, spending uses `send` or `sendall`. Bitcoin Core builds a PSBT, calls the signer via stdin with `signtx`, and if signatures are sufficient, finalizes and broadcasts the transaction. If the signer is not connected or cancels, the call fails with an error. For fee-bumping on such wallets, use `psbtbumpfee` to involve an external signer. - -`sendtoaddress` and `sendmany` check `inputs->bip32_derivs` to see if any inputs have the same `master_fingerprint` as the signer. If so, it calls ` --fingerprint=00000000 signtransaction `. It waits for the device to return a (partially) signed psbt, tries to finalize it and broadcasts the transaction. +For external-signer wallets, spending uses `send` or `sendall`, and fee-bumping uses `bumpfee`. Bitcoin Core builds a PSBT, adds key origin information, checks whether any input key origin fingerprint matches the signer, calls ` --stdin --fingerprint 00000000 --chain `, and sends `signtx ` over stdin. If signatures are sufficient, it finalizes the transaction and, for broadcasting RPCs, broadcasts it. If signing cannot complete, the call fails with an error. For manual fee-bumping, use `psbtbumpfee` to obtain a PSBT for signing. diff --git a/src/external_signer.h b/src/external_signer.h index 87fbbf0b8c2..a6f16e8e8ac 100644 --- a/src/external_signer.h +++ b/src/external_signer.h @@ -58,7 +58,8 @@ public: UniValue GetDescriptors(int account); //! Sign PartiallySignedTransaction on the device. - //! Calls ` signtransaction` and passes the PSBT via stdin. + //! Calls ` --stdin --fingerprint --chain ` and passes the + //! `signtx` command and PSBT via stdin. //! @param[in,out] psbt PartiallySignedTransaction to be signed bool SignTransaction(PartiallySignedTransaction& psbt, std::string& error); };