comit-network / comit-rs

Reference implementation of COMIT, an open protocol facilitating trustless cross-blockchain applications.
GNU General Public License v3.0
191 stars 33 forks source link

Change cnd to use public keys for the Bitcoin identity #1296

Closed thomaseizinger closed 4 years ago

thomaseizinger commented 5 years ago

Right now our we use the "pubkey hash" as the identity in RFC005. This is the wrong choice for two reasons:

  1. This blocks the adoption of miniscript because the HTLC created from the miniscript policy uses public keys and not pubkey hashes. This makes sense because it is obfuscated through the P2WSH address anyway.
  2. In the taproot proposal outputs are locked to public keys. So sending to someone's public key will become the standard way of transferring Bitcoin (hopefully).

You would probably want to start by changing this line to a PublicKey:

https://github.com/comit-network/comit-rs/blob/5702e0a207784745e5bb256014487cb6cce1b20f/cnd/src/swap_protocols/ledger/bitcoin.rs#L31

and simply follow the compile errors :)

D4nte commented 4 years ago

Can't just get codin', need to update the HTLC hex first...

thomaseizinger commented 4 years ago

Can't just get codin', need to update the HTLC hex first...

Sure? Each party could hash the pubkey after receiving it. Then it would be an implementation detail of the current HTLC that would be removed once we move to miniscript.

bonomat commented 4 years ago

I think you only need to change the internals and once handed the pubkey to the htlc generation you create the hash.

//edit// the HTLC should be out of scope for this ticket