-
Notifications
You must be signed in to change notification settings - Fork 906
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
Locked funds due to funding a channel with a transaction with the wrong txid from a P2SH wallet #4416
Comments
OK, the txid of the global tx is NOT the txid of the PSBT! I spoke with @achow101 and I think we both winced that bitcoin-core and spectre display the txid, as it's dangerous. Now, for non-P2SH-wrapped segwit inputs, the txid of the PSBT will be the global tx TXID. But they're the exception! We have a function of our own which calculates it properly (https://github.com/ElementsProject/lightning/blob/master/bitcoin/psbt.c#L787). Perhaps we should allow fundchannel_complete to take a PSBT? Then it would Do The Right Thing? @niftynei ? |
Agreed. A PSBT and/or a raw transaction in lieu of the txid & outpoint would be a huge improvement here. We can identify the appropriate out-index by finding the expected funding script, etc. |
…h PSBT Requiring the user to calculate the txid of the PSBT is a horrible, bad, no-good idea. Doesn't deprecate yet, so I can test that this path works while multifundchannel still uses it. Fixes: ElementsProject#4416 (at least for future users!) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
…h PSBT Requiring the user to calculate the txid of the PSBT is a horrible, bad, no-good idea. Doesn't deprecate yet, so I can test that this path works while multifundchannel still uses it. Fixes: ElementsProject#4416 (at least for future users!) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
…h PSBT Requiring the user to calculate the txid of the PSBT is a horrible, bad, no-good idea. Doesn't deprecate yet, so I can test that this path works while multifundchannel still uses it. Fixes: ElementsProject#4416 (at least for future users!) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
…h PSBT Requiring the user to calculate the txid of the PSBT is a horrible, bad, no-good idea. Doesn't deprecate yet, so I can test that this path works while multifundchannel still uses it. Fixes: ElementsProject#4416 (at least for future users!) Signed-off-by: Rusty Russell <rusty@rustcorp.com.au> Changelog-Added: JSON-RPC: `fundchannel_complete` takes a psbt parameter.
Next related question here is if there is anything left that can be done now or possibly in the future if the 2016 blocks have passed since the attempted funding? Or is there any data which can be extracted now and possibly used later and will be deleted at the pending channel expiry? |
Ok learned on the developer meeting and IRC that this proposal can help the case: |
I have attempted to fund a channel from an external P2SH wallet
When converting the PSBT to a rawtxn the txid has changed.
The transaction broadcasted sent the the right amount to the right address, but the txid was not which was passed to
fundchannel_complete
.Unfortunately the transaction has confirmed quickly so now I need to find a way to recover it.
The channel peer is Fulmo - running c-lightning also.
To help to reproduce:
Funding start:
The created PSBT contained the scriptpubkey:
And the txid ( Specter Desktop showed also: 408abf9ae8e2228266ea30985fa3bb47ee5e9fb964263bf2bb4166226bb33ea3):
TXID Confirmed in Specter Desktop
Passed the txid to
fundchannel_complete
:Now the issue was that imported the PSBT to Electrum to broadcast and did not realize that it shows a changed TXID (but the funding address and amount remained the same):
The raw transaction broadcasted:
The actual confirmed transaction: https://blockstream.info/search?q=f74459ad229f47edb0835925c4211f51bac2a879bd466173f02b43a9fdce38ae
As discussed with on the developer meeting with @rustyrussell :
Thank you for your time spent on looking into this.
The text was updated successfully, but these errors were encountered: