p2pderivatives / rust-dlc

Rust library for working with Discreet Log Contracts
MIT License
138 stars 36 forks source link

Remove reliance on `secp256k1_zkp` #226

Closed bennyhodl closed 3 weeks ago

bennyhodl commented 4 months ago

secp256k1_zkp complicates updating bitcoin to new minor version. Issues that I faced with #223. This is a better starting point for #221 & #223 will be closed if this is merged.

Using secp256k1_zkp does not make much sense when it is exported from bitcoin. Changes all references except the EcdsaAdaptorSignature. Would like options to remove secp256k1_zkp completely.

luckysori commented 4 months ago

@bennyhodl: Perhaps I'm missing the point, but why does it matter where you import the types from?

Whether you import transitively through bitcoin or transitively through secp256k1_zkp, you're still getting the same types.

Would like options to remove secp256k1_zkp completely

This seems impossible since we need to use ECDSA adaptor signatures to implement the DLC protocol.

bennyhodl commented 4 months ago

Whether you import transitively through bitcoin or transitively through secp256k1_zkp, you're still getting the same types.

Inline with the ₿itcoin crate is best imo. For example, we cannot do #221 becuase secp256k1_zkp does not have a version compatible with the secp crate exported in bitcoin.

This seems impossible since we need to use ECDSA adaptor signatures to implement the DLC protocol.

It should be opened in broader discussion to implement adaptor signatures to bitcoin. They are both ~the same~ library.

luckysori commented 4 months ago

For example, we cannot do #221 becuase secp256k1_zkp does not have a version compatible with the secp crate exported in bitcoin.

Wouldn't it be simpler to ask the secp256k1_zkp maintainers to update the secp256k1 dependency?

I think what you are proposing here may not even work because, once you bump rust-bitcoin, you will very likely end up needing to use a secp256k1:0.28.0 type returned by secp256k1_zkp with an API that now expects secp256k1:0.29.0 (or vice versa). I assume you will run into mismatched types: perhaps two different versions of crate secp256k1 are being used?

It should be opened in broader discussion to implement adaptor signatures to bitcoin. They are both ~the same~ library.

Yeah, if ECDSA adaptor signatures were added to secp256k1 then things would be easier. But I don't think this is happening any time soon.

bennyhodl commented 3 months ago

Moved to draft until zkp has adaptor signatures