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

docs: add documentation for signing/creating PSBT packets #1988

Open
ripoff2 opened this issue May 29, 2023 · 4 comments
Open

docs: add documentation for signing/creating PSBT packets #1988

ripoff2 opened this issue May 29, 2023 · 4 comments

Comments

@ripoff2
Copy link

ripoff2 commented May 29, 2023

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.

@guggero
Copy link
Collaborator

guggero commented May 30, 2023

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.

@ripoff2
Copy link
Author

ripoff2 commented May 30, 2023

@guggero thanks a lot!

@guggero
Copy link
Collaborator

guggero commented May 30, 2023

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?

@Roasbeef Roasbeef changed the title Signing PSBT docs: add documentation for signing/creating PSBT packets May 31, 2023
@ripoff2
Copy link
Author

ripoff2 commented Jun 2, 2023

@guggero sry I forgot to make a reply. I've solve my issue, ty for providing info about lnd codebase - rly helpful!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants