Open ripoff2 opened 1 year ago
Per definition, the "unsigned TX" within the PSBT will never contain a scriptSig or a witness. So if you sign a PSBT, instead of putting the witness stack into the "witness" field of the TX input, you add it to the FinalScriptWitness field of the PSBT input.
There are examples in the lnd
code base. See SignPsbt
and its integration tests.
@guggero thanks a lot!
You're welcome. Did that help you answer your question and we can close the issue? Or do you see this as a feature request issue to add more documentation to the PSBT package?
@guggero sry I forgot to make a reply. I've solve my issue, ty for providing info about lnd codebase - rly helpful!
Hi, thank you for your work. Due to the lack of examples, I have a question, how can I add FinalScriptWitness to PSBT? The thing is, I have two base64 encoded PSBT: signed and unsinged. The only difference in them is that the one signed by the wallet (manually) has a FinalScriptWitness parameter. However, I have not been able to reproduce it. It is also worth noting that the signature was made with a Taproot address.