-
Notifications
You must be signed in to change notification settings - Fork 15
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
Simples changes that are required to support taproot LN channels #129
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't understand why the ScriptTree
encoding is necessary, you don't seem to use it for the PSBT fields (which only require encoding/decoding script leaves)? Also, the leaf encoding defined in the PSBT bip doesn't match the encoding you're using?
Because we persist input information along with our peer's signature (or partial signature) in both |
Got it, that's what confused me, this is unrelated to PSBT. It seems to me that we only need to serialize the leaves in order to re-build the tree, don't we? We would lose the "leafIndex" but maybe we can re-work that to get rid of it? |
I've added the serialisation format for script trees defined in BIP371 (and kept ours which I find simpler :)). |
The id field was used in tests only, was not part of the tree hash and was not serialised. We also remove our custom serialisation format and keep only the format defined in BIP371.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
We need to be able to serialize taproot script trees, compare x-only pubkeys, and create taproot sessions to verify partial signatures.
This changes are imported from #128 which includes unrelated more complex changes to our PSBT implementation,