-
Notifications
You must be signed in to change notification settings - Fork 5.4k
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 BIP 78 & BIP 174 Conflict: Keep input utxo data through input finalization #1396
base: master
Are you sure you want to change the base?
Conversation
Seems reasonable, but needs an endorsement from the original BIP author, @NicolasDorier. |
@NicolasDorier This issue cropped itself up in Sparrow wallet too, where sparrow won't sign based solely on an outpoint but requires the utxo scripts to sign. It would be great to resolve this as payjoin adoption is mounting. |
The reference sender implementation should also be updated to remove this check:
The test vectors should likely be updated as well. |
+1 It would at least be good to understand why this information is removed from the original PSBT, which is technically in conflict with BIP174. |
My guess was that the spec was written this way out of convenience for the original NBitcoin / BTCPayServer implementation. The BTCPayServer sender calls |
The reference sender implementation and \`payjoin proposal\` test vectors are adjusted accordingly. According to the psbt Input Finalizer spec "All other data except the UTXO and unknown fields in the input key-value map should be cleared from the PSBT. The UTXO should be kept to allow Transaction Extractors to verify the final network serialized transaction." I ran into a problem where an LND acting as sender FinalizePsbt gRPC fails when sender utxo information is missing. I see no good reason to remove utxo information from the PSBT.
@NicolasDorier could you please weight in here? |
Hey, has there been any movement on this PR? @NicolasDorier, I think it might be waiting for your review. |
According to the psbt Input Finalizer spec "All other data except the UTXO and unknown fields in the input key-value map should be cleared from the PSBT. The UTXO should be kept to allow Transaction Extractors to verify the final network serialized transaction." In Bip78, the receiver clears this data after it finalizes its inputs, even if the utxo belongs to the sender which will need that data.
I ran into a problem where LND's FinalizePsbt gRPC fails when this utxo data is missing. I see no good reason to remove this utxo information from the PSBT. I think LND's RPC should also succeed regardless of this data being present because it can look it up with the unsigned_tx's input outpoint (that's what bitcoind's finalizePsbt rpc does). Still I think LND's RPC is technically BIP-0174 spec-compliant while BIP-0078 seems not to be.
https://github.com/lightningnetwork/lnd/blob/cf9a9864cf253dbbcac5904d360bbbde763e1ebe/lnwallet/rpcwallet/rpcwallet.go#L270-L286
According to the psbt Input Finalizer spec "All other data except the UTXO and unknown fields in the input key-value map should be cleared from the PSBT. The UTXO should be kept to allow Transaction Extractors to verify the final network serialized transaction."
I ran into a problem where an LND acting as sender FinalizePsbt gRPC fails when sender utxo information is missing. I see no good reason to remove utxo information from the PSBT.
Edit Jun 2024: This problem also cropped up in sparrow wallet
tagging this issue in the rust-payjoin library
@nickfarrow @Kixunil @NicolasDorier