Clear sender input witness before processing PSBT#241
Clear sender input witness before processing PSBT#241DanGould merged 3 commits intopayjoin:masterfrom
Conversation
By the time the receiver is applying its own signatures, it should have extracted the valid Original PSBT Transaction and may remove the final_scriptwitness.
DanGould
left a comment
There was a problem hiding this comment.
@grizznaut May you share how you were able to set up and test JoinMarket with this change?
Overall looks like a correct implementation. I ask that we consider in this PR if any other signatures (or other field?) should also be removed before apply_fee or wallet_process_psbt are called. Or, if the signature contents removal should be done after apply_fee.
| let sender_input_indexes = self.get_sender_input_indexes(); | ||
| for i in sender_input_indexes { | ||
| log::trace!("Clearing sender script witness for input {}", i); | ||
| self.payjoin_psbt.inputs[i].final_script_witness = None; |
There was a problem hiding this comment.
should final_script_sig and tap_key_sig also be removed at this step? Might they cause problems if they were not removed before wallet_process_psbt of various implementations?
There was a problem hiding this comment.
It seems reasonable to remove all signatures at this step as they would be invalid anyways. Updated and smoke-tested with another test receive.
I reused the same setup I described briefly in the Setup Notes section here #51 (comment), but pulled and built this branch for the payjoin-cli receiver. I can make a more detailed write-up of how I obtained the certificate, setup the nginx proxy, etc. if that would be helpful! |
Based on ongoing conversation: #51 (comment)