Hi everyone, I’m starting this thread for weekly progress updates on atomic swaps using adaptor signatures.
Over the past week, I’ve made decent progress implementing the cryptographic primitives needed for ECDSA adaptor signatures.
- Fischlin proofs: https://github.com/geneferneau/fischlin
- Dual Schnorr consistency proofs: https://github.com/GeneFerneau/adaptor/blob/main/src/schnorr.rs
- ECDSA pre-signatures + verification: https://github.com/GeneFerneau/adaptor/blob/main/src/lib.rs
- Exposed some necessary functions in rust-secp256k1: https://github.com/rust-bitcoin/rust-secp256k1/compare/master…GeneFerneau:adaptor
Not sure if the changes would be welcome upstream for rust-secp256k1
, so will open discussion through an issue/PR. Depending on how the discussion goes, I may end up re-implementing ECDSA adaptor signatures as a libsecp256k1 module. Then expose interfaces in rust-secp256k1. TBD
Some problems came up when trying to implement Positive ECDSA pre-signatures. Because pre-signatures are not verified normally, I’m having a problem with the dual Schnorr proofs when s
is negated (to ensure |s| <= (q-1) / 2
).
The concrete NIZK proof isn’t specified in the paper, and I designed the dual Schnorr proof based on the scheme specified in https://tools.ietf.org/html/rfc8235. It works when s
is not negated, but fails when s
is. Still working on how to modify the proof to make it work, and still retain all its security properties.
When verifying the pre-signature in a way closer to how the original ECDSA schemes are verified:
r == f({H(m) * s^-1}*g + {r * s^-1}*X)
when r = k*g during signing
the signature verifies even when s
is negated (as expected). So, the problem is definitely in the Schnorr proof I’m working on.
Will keep working on the problem, since it is fundamental for the security of the adaptor signature scheme.
After I solve the issue with the dual Schnorr proofs, I’ll continue with implementing the witness extraction and adaption algorithms.
When those are finished most of the cryptographic primitives will be finished™ (still need more testing and refactoring). Then I can start working on integrating the signatures into mimblewimble/grin-wallet
and a PoC wallet using rust-bitcoin/rust-wallet
.
Please feel free to ask questions, and give feedback in this thread.
Thanks for reading