-
Notifications
You must be signed in to change notification settings - Fork 847
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
Non-segwit inputs are not serialized in PSBTs #1171
Comments
I managed to make it work by adding the NonWitnessUtxo by hand using Nbxplorer foreach (var item1Input in result.Item1.Inputs)
{
item1Input.NonWitnessUtxo = (await _nbXplorerService.GetTransactionAsync(item1Input.PrevOut.Hash, default)).Transaction;
} |
@Jossec101 if you are using NBXplorer, this endpoint https://github.com/dgarage/NBXplorer/blob/master/docs/API.md#create-partially-signed-bitcoin-transaction has Else, you are correct, the TransactionBuilder's PSBT doesn't include the |
I guess an improvement to the builder should programatically allow to add the |
The problem is that it doesn't have this information. There is no way to feed the previous transactions to the builder. |
It looks like that after getting the base64 string of a PSBT the non-witness UTXO fields are not serialised hence empty/null after deserialising back to the PSBT object.
Looks like orphanTxOut is not used much
NBitcoin/NBitcoin/BIP174/PSBTInput.cs
Line 20 in fb13874
If I retrieve a PSBTInput object, named
input
an doinput.GetCoin().TxOut
is filled if the PSBT was generated programatically from code (.i.e. PSBT Builder), this is because the orphanTxOut is filled.However, after deserialising back from a base64 PSBT, orphanTxOut is no longer present and therefore I cannot get the Coin of a non-segwit input. This is happening in the picture below.
Hope I explained well enough 👯
The text was updated successfully, but these errors were encountered: