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

Change Bitcoin HTLC to be created from miniscript-policy #1287

thomaseizinger opened this issue Aug 26, 2019 · 1 comment


Copy link

commented Aug 26, 2019

Working on #1218 revealed the following:

  • We can use miniscript to model our HTLC and create spending transactions for it. This is implemented in a PoC here:
  • To make full use of that, we should define the HTLC as a miniscript-policy which then compiles to a miniscript, which in turn compiles to a Bitcoin script
  • Doing so requires us to move away from pubkey-hashes as Bitcoin-identities and move to raw public keys. This has already been proposed here: comit-network/RFCs#74

The suggested way forward is (on purpose implementation-first):

  1. Change cnd to use PublicKeys instead of PubKeyHashes for the Bitcoin-identity. This requires changes on the messaging level as-well as some internal datatype changes.
  2. Finish the PoC in to compile the HTLC-hex from the policy. The problem is that we cannot (yet) re-construct the miniscript from the compiled hex and i.e. cannot use our own template. According to rust-miniscript, the mapping between miniscript and compiled script is static, hence we could embed the miniscript into the RFC instead of the hex code and roll with that.
  3. Change the Bitcoin Contract RFC to:
  • state the use of miniscript
  • include the new hex code
  1. Change the Bitcoin Ledger RFC to:
  • describe the use of public keys as identities instead of pubkey-hashes

When grooming this ticket and the team agrees to move forward with this:

  • Create a ticket for (1) and block #1218 on it
  • Create a ticket for (3) and block it on #1218 and (1)
  • Create a ticket for (4) and block it on (1)
  • Block blogpost ticket (coblox/blog#42) on (4)

This comment has been minimized.

Copy link
Member Author

commented Aug 28, 2019

Closed because it was only for gathering information for grooming.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
2 participants
You can’t perform that action at this time.