-
Notifications
You must be signed in to change notification settings - Fork 271
Add scripts for taproot channels #3016
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
Conversation
These scripts have been generated with miniscript and are different from the ones included in the "simple taproot channels" proposal at lightning/bolts@e25132d.
eclair-core/src/main/scala/fr/acinq/eclair/transactions/Scripts.scala
Outdated
Show resolved
Hide resolved
This original script is: <local_delayedpubkey> OP_DROP <revocation_pubkey> OP_CHECKSIG It includes a NOOP push of the local delayed payment pubkey, which is needed to spend the anchor output once the 16-blocks CSV delay has passed.
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.
It took me quite a while to figure out how we will then use those scripts. I think that after merging this, we need a follow-up PR that adds helpers around producing witnesses and makes the changes to Transactions.scala
to support signing all transaction types: it's not obvious how we will make that work without relying on error-prone assumptions around the ScriptTree
in the TaprootInput
...
This follow-up PR should update the existing test to use typed transactions and the exposed sign
and addSigs
methods instead of having the logic directly inside the test.
eclair-core/src/main/scala/fr/acinq/eclair/transactions/Scripts.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/main/scala/fr/acinq/eclair/transactions/Scripts.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/transactions/TransactionsSpec.scala
Outdated
Show resolved
Hide resolved
eclair-core/src/test/scala/fr/acinq/eclair/transactions/TransactionsSpec.scala
Outdated
Show resolved
Hide resolved
Can you add comments to the BOLTs PR with the scripts we are using? This needs to be recorded somewhere to ensure other implementations ACK on those scripts before we start using them. |
9dc01da
to
c43a714
Compare
I took nearly all the changes you proposed in #3018, thanks! |
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 👍
There are no functional changes, this PR just adds low-level methods to create taproot lightning transactions.
The scripts used in this PR are slightly different from the ones included in the "simple taproot channels" proposal at ttps://github.com/lightning/bolts/pull/995/commits/e25132d8de0164224578964fcd3f7328ddfc3281, because they have been generated with miniscript (the "miniscript code" is included in the comment). We expect the the taproot channels PR will also be modified to become "miniscript compatible".