Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Payjoin: Add back original PSBT input to payjoin proposal #269

Merged
merged 6 commits into from
Jul 14, 2023

Conversation

cryptoquick
Copy link
Member

Fixes #267

DanGould and others added 5 commits July 12, 2023 14:40
Unlike Bitcoin Core's walletprocesspsbt RPC, BKD's finalize_psbt only checks
if the script in the PSBT input map matches the descriptor and does not
check whether it has control of the OutPoint specified in the unsigned_tx's
TxIn. So the original_psbt input data needs to be added back into
payjoin_psbt without overwriting receiver input.

BIP 78 spec clears script data from payjoin proposal.
@DanGould
Copy link
Collaborator

Thanks for this. As you can see I did 3 things with this PR (separated by commit of course). Is this best practice for this repo or would you prefer separate PRs for distinct features in the future?

@cryptoquick
Copy link
Member Author

You'll see we have our repo configured so that it's all squashed when it's merged, and the PR can be referenced instead:
https://github.com/diba-io/bitmask-core/commits/development

@cryptoquick cryptoquick merged commit 01f13ba into development Jul 14, 2023
@cryptoquick cryptoquick deleted the payjoin-fix branch July 14, 2023 17:41
Comment on lines +154 to +155
proposed_psbtin.witness_utxo = original_psbtin.witness_utxo.clone();
proposed_psbtin.non_witness_utxo = original_psbtin.non_witness_utxo.clone();
Copy link
Collaborator

Choose a reason for hiding this comment

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

This is broken because propose_psbtin is cloned, so this does not mutate the original_psbt as it needs to. PR inbound

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants