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

bolt-simple-taproot: fix, clarify and add things #3

Open
wants to merge 22 commits into
base: simple-taproot-chans
Choose a base branch
from

Conversation

antonilol
Copy link

@antonilol antonilol commented Aug 13, 2022

lightning#995

i read through the document again and found many things that i would change.

notable changes:

  • use of htlc keys in anchors to have a higher chance of them being able to be swept to minimize utxo set bloat
  • use of revocation key in the to_remote script (explanation in the document and in this comment)

one question:
is this correct? (lines +844, +845)

  * saves storage for both channel peers as (just like with other outputs) only the
   TapTweak has to be remembered

@antonilol
Copy link
Author

rebased (2 days ago) on your most recent commit in lightning#995, can you review my changes?


The to remote output has the following form:

* `OP_1 to_remote_output_key`
* where:
* `to_remote_output_key = combined_funding_key + tagged_hash("TapTweak", combined_funding_key || to_remote_script_root)`
* `to_remote_output_key = revocationpubkey + tagged_hash("TapTweak", revocationpubkey || to_remote_script_root)`
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This'll end up breaking the deterministic nature of the output, which is important for things like SCB recovery. If this changes every state, then a party that has lost data (but knows the funding keys) can't find it on chain. As is, they just needs this static information that never changes and they can detect this output. For the history here, see the static_remote_key feature bit/saga.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

good point, reverting this change

arik-so and others added 11 commits November 18, 2022 14:47
In this commit, we build off the prior JIT nonce proposal modifying the
following:

  * The funding flow returns to being symmetric. Both `open_channel` and
    `accept_channel` carry nonces.

  * The `shutdown` message once again transmit a nonce that'll be used
    by both sides to sign the shutdown transaction. A symmetric nonce
    approach is used here as both sides already know what the other will
    use for their nonce, and there's only a single message to sign.

  * The `closing_signed` message now only carries a 32-byte
    `partial_sig` value, as the nonces has already been transmitted
    ahead of time. Additionally, the existing "negotiation" feature has
    been done away with. Cooperative close will now always succeed after
    a single round, as the initiator is the only that ultimately pays
    fees.
bolt-simple-taproot: make funding symmetric, add new type for shutdown
- clarify `output_key_y_parity`
- add usage of htlc keys for anchors in case no balance output exists
- fix `2:` -> `2.` markdown ordered list
- clarify `SIGHASH_SINGLE|SIGHASH_ANYONECANPAY` usage in HTLC second level txs
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants