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 BIP 78 & BIP 174 Conflict: Keep input utxo data through input finalization #1396

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

DanGould
Copy link

@DanGould DanGould commented Dec 20, 2022

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

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.
@murchandamus
Copy link
Contributor

Seems reasonable, but needs an endorsement from the original BIP author, @NicolasDorier.

@murchandamus murchandamus added Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification labels May 8, 2024
@DanGould
Copy link
Author

@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.

sparrowwallet/sparrow#1428

It would be great to resolve this as payjoin adoption is mounting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Pending acceptance This BIP modification requires sign-off by the champion of the BIP being modified Proposed BIP modification
Projects
None yet
2 participants