You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
FinalizePsbt fails if input utxo data is absent but fetches that utxo data anyway. Because the psbt's unsigned_tx input has a valid outpoint, lnd could fetch the missing utxo data. This behavior differs from bitcoin core, which retrieves the utxo data if it is missing.
See that FinalizePsbt does in fact already call `FetchInputInfo(&txIn.PreviousOutPoint). I think the first utxo check should be removed for convenience and to match the behavior of bitcoind. I have also suggested the spec which removes this utxo data (BIP 78) and led me to find this problem changes to be more compliant with BIP 174. BIP 174 says one should keep utxo data around.
I think the existing LND behavior is in fact BIP 174 compliant, but could be more convenient and match bitcoind while preserving compliance.
I think this check was just added to make sure the FinalizePsbt call isn't called with an incomplete PSBT.
I see why it looks weird that we require the UTXO information to be present just to fetch it anyway.
But making sure you have the UTXO information for each input (not just the one you want to sign) is especially important once P2TR inputs are present. Because you can only sign a P2TR input if you have the UTXO information of all of the inputs, otherwise the sighash will be incorrect.
So I'm not sure if removing the UTXO check here is a good idea, even if it would fix your immediate problem...
FinalizePsbt fails if input utxo data is absent but fetches that utxo data anyway. Because the psbt's unsigned_tx input has a valid outpoint, lnd could fetch the missing utxo data. This behavior differs from bitcoin core, which retrieves the utxo data if it is missing.
See that FinalizePsbt does in fact already call `FetchInputInfo(&txIn.PreviousOutPoint). I think the first utxo check should be removed for convenience and to match the behavior of bitcoind. I have also suggested the spec which removes this utxo data (BIP 78) and led me to find this problem changes to be more compliant with BIP 174. BIP 174 says one should keep utxo data around.
I think the existing LND behavior is in fact BIP 174 compliant, but could be more convenient and match bitcoind while preserving compliance.
lnd/lnwallet/rpcwallet/rpcwallet.go
Lines 267 to 286 in cf9a986
Proposed BIP 78 change: bitcoin/bips#1396
Proposed PayJoin library change: Kixunil/payjoin#39
@nickfarrow
The text was updated successfully, but these errors were encountered: