payjoin / rust-payjoin

Supercharged payment batching to save you fees and preserve your privacy
https://payjoindevkit.org
85 stars 37 forks source link

Allow mixed input scripts in v2 #367

Closed spacebear21 closed 1 month ago

spacebear21 commented 1 month ago

Closes https://github.com/payjoin/rust-payjoin/issues/39 and https://github.com/payjoin/rust-payjoin/issues/358

Adds support for mixed input script types in payjoin v2, and disables that option in v1.

Additionally, renames contribute_witness_inputs to contribute_inputs and changes the function signature to better support non-witness and nested segwit inputs.

DanGould commented 1 month ago

Coming in hot with the double whammy 🔥

Is the whole issue blocked by taproot? It doesn't seem to me that taproot mixed input logic would be different than other AddressTypes, only that it would affect weight calculation which I beleive you've already written unit tests for.

bitcoind is quite old now and we should update but perhaps that can be a less urgent issue of its own

spacebear21 commented 1 month ago

I wouldn't say it's a blocker for this issue but I'd like to follow up on it eventually. It looks like bitcoind might be on its way out so I'm fine with addressing this as a separate issue. I think I'll leave the commented out taproot test in as a reminder though.

This PR should be in a reviewable state by EOD.

DanGould commented 1 month ago

Probably good to get your review on my two changes @spacebear21 but I think this is good to go. Sequence is a distinct consideration and this PR doesn't change the original behavior that I brought into question

spacebear21 commented 1 month ago

Thanks for making those updates! Reviewed and merged.