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: https://github.com/comit-network/RFCs/issues/74
The suggested way forward is (on purpose implementation-first):
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.
Finish the PoC in https://github.com/comit-network/comit-rs/tree/miniscript 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.
Change the Bitcoin Contract RFC to:
state the use of miniscript
include the new hex code
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:
Working on #1218 revealed the following:
The suggested way forward is (on purpose implementation-first):
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.When grooming this ticket and the team agrees to move forward with this: