payjoin / rust-payjoin

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

Include original_psbt input txos to payjoin_psbt for sender signing and broadcast #276

Closed DanGould closed 4 months ago

DanGould commented 4 months ago

BIP 78 (Payjoin V1) does not follow BIP 174 (PSBT V1) because it removins UTXO data from PSBT inputs, which a sender needs to sign the augmented Payjoin PSBT. It only keeps the input OutPoints. Many PSBT signers will not sign PSBT Inputs with unspecified input UTXO data. Payjoin Dev Kit may not have noticed this at first because bitcoind does sign inputs by looking up OutPoints, but other wallets still have problems.

The send module of the Dev Kit maintains the original_psbt including sender UTXO data and should add it back to the Payjoin PSBT before the sender signs to support as many wallets as possible. This would solve the protocol shortcoming for users of the Dev Kit without patching BIP 78.

These wallets are confirmed unable to sign inputs without PSBT UTXO data

LND Sparrow BDK

spacebear21 commented 4 months ago

As a more long-term goal, it would be great to have integration tests across a couple of other popular wallets. It seems like relying exclusively on bitcoind in tests is letting many little things slip through that other wallets can't handle (i.e. bitcoind doing its job a little too well).

DanGould commented 4 months ago

it would be great to have integration tests across a couple of other popular wallets

The easiest route to test more integration support would be bitcoin dev kit since there are already integrations to copy in the wild. Automated e2e testing of the supported wallets in the readme would also be amazing, but is definitely a lift.