Skip to content

Conversation

Sjors
Copy link
Member

@Sjors Sjors commented Apr 2, 2021

The bumpfee RPC call and GUI fee bump interface now work with an external signer.

@Sjors
Copy link
Member Author

Sjors commented Apr 2, 2021

I'm not tremendously excited by this approach of overloading bumpfee. But it also seems wrong to use psbtbumpfee here for the simple case of a single signer that has all the required keys. I could add yet another RPC method signerbumpfee?

cc @achow101 @instagibbs

@DrahtBot
Copy link
Contributor

DrahtBot commented Apr 3, 2021

The following sections might be updated with supplementary metadata relevant to reviewers and maintainers.

Reviews

See the guideline for information on the review process.

Type Reviewers
ACK furszy, achow101, jarolrod
Concept ACK luke-jr
Stale ACK meshcollider

If your review is incorrectly listed, please react with 👎 to this comment and the bot will ignore it on the next update.

Conflicts

Reviewers, this pull request conflicts with the following ones:

  • #26485 (RPC: Accept options as named-only parameters by ryanofsky)

If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.

Copy link
Contributor

@meshcollider meshcollider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

utACK 0c0d293

@@ -3521,16 +3521,39 @@ static RPCHelpMan bumpfee_helper(std::string method_name)
// If wallet private keys are enabled, return the new transaction id,
// otherwise return the base64-encoded unsigned PSBT of the new transaction.
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do the merged changes in #22021 need to be updated with this pull?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll do a rebase and also address the nits above.

Copy link
Member Author

@Sjors Sjors May 31, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For now these comments are correct. In a multisig setup bumpfee will throw "Transaction incomplete. Try psbtbumpfee instead." (which in turn won't call the external signer). We can improve that later.

@Sjors
Copy link
Member Author

Sjors commented May 31, 2021

Rebased, addressed comments and added a test.

@Sjors Sjors force-pushed the 2021/04/signer_bumpfee branch from 0c0d293 to dda02ce Compare May 31, 2021 15:31
Copy link
Contributor

@meshcollider meshcollider left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

re-utACK dda02ce

@Sjors
Copy link
Member Author

Sjors commented Dec 21, 2021

Oops, fixed.

@achow101
Copy link
Member

ACK d5f720f

@Sjors
Copy link
Member Author

Sjors commented Jan 12, 2022

Rebased after bitcoin-core/gui#441, though not tested yet.

pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, false, true);
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, true, false);
pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ false, /* bip32derivs */ true);
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ true, /* bip32derivs */ false);
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /* sign */ true, /* bip32derivs */ false);
const TransactionError err = pwallet->FillPSBT(psbtx, complete, SIGHASH_DEFAULT, /*sign=*/true, /*bip32derivs=*/false);

& other such changes

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed (after the rebase moved everything around)

@Sjors Sjors force-pushed the 2021/04/signer_bumpfee branch from ea8f5db to 3e25b8e Compare April 25, 2022 15:46
@Sjors
Copy link
Member Author

Sjors commented Apr 25, 2022

Rebased, but for the GUI to work I first need to apply the same change as bitcoin-core/gui#555

@Sjors Sjors force-pushed the 2021/04/signer_bumpfee branch from 3e25b8e to ed5538e Compare April 25, 2022 16:09
@Sjors
Copy link
Member Author

Sjors commented Apr 25, 2022

Ok, it works again now.

Sjors added 2 commits April 25, 2022 18:13
Specifically this enables the Send button in the fee bump dialog for wallets with external signer support. Similar to 2efdfb8.
@Sjors Sjors force-pushed the 2021/04/signer_bumpfee branch from ed5538e to 2c07cfa Compare April 25, 2022 16:14
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request May 21, 2022
luke-jr pushed a commit to luke-jr/bitcoin that referenced this pull request May 21, 2022
Specifically this enables the Send button in the fee bump dialog for wallets with external signer support. Similar to 2efdfb8.

Github-Pull: bitcoin#21576
Rebased-From: 2c07cfa
Copy link
Member

@furszy furszy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

code review ACK 2c07cfa

Comment on lines +244 to +254
// Make a blank psbt
PartiallySignedTransaction psbtx(mtx);

// First fill transaction with our data without signing,
// so external signers are not asked to sign more than once.
bool complete;
wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, false /* sign */, true /* bip32derivs */);
const TransactionError err = wallet.FillPSBT(psbtx, complete, SIGHASH_ALL, true /* sign */, false /* bip32derivs */);
if (err != TransactionError::OK) return false;
complete = FinalizeAndExtractPSBT(psbtx, mtx);
return complete;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: as this is the same code that we have in "rpc/send" --> FinishTransaction, could decouple it into a new function and use it from both sides.

Copy link
Member Author

@Sjors Sjors Jul 18, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I looked into deduplicating the part where we fill without signing and then call fill, but it's not that easy. The following doesn't work: Sjors@5d55117 (because it won't add the bip32 info for some reason)

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approach ACK

I was able to successfully sign for a fee increase on my external signer. Want to continue to do more testing.

@achow101
Copy link
Member

ACK 2c07cfa

Copy link
Member

@jarolrod jarolrod left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

tACK 2c07cfa

I have tested and reviewed the code and agree it can be merged.

@achow101 achow101 merged commit cbcad79 into bitcoin:master Dec 20, 2022
sidhujag pushed a commit to syscoin/syscoin that referenced this pull request Dec 21, 2022
2c07cfa gui: bumpfee signer support (Sjors Provoost)
7e02a33 rpc: bumpfee signer support (Sjors Provoost)
304ece9 rpc: document bools in FillPSBT() calls (Sjors Provoost)

Pull request description:

  The `bumpfee` RPC call and GUI fee bump interface now work with an external signer.

ACKs for top commit:
  achow101:
    ACK 2c07cfa
  furszy:
    code review ACK 2c07cfa
  jarolrod:
    tACK 2c07cfa

Tree-SHA512: 0c7b931f76fac67c9e33b9b935f29af6f69ac67a5ffcc586ed2f1676feac427735b1d971723b29ef332bb6fb5762949598ebbf728587e8f0ded95a9bfbb3e7a4
@Sjors Sjors deleted the 2021/04/signer_bumpfee branch January 2, 2023 11:07
@bitcoin bitcoin locked and limited conversation to collaborators Jan 2, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

9 participants