haskoin / secp256k1-haskell

Haskell bindings for secp256k1 library
Other
24 stars 35 forks source link

Add support for recoverable signatures #42

Closed evgeny-osipenko closed 1 year ago

evgeny-osipenko commented 1 year ago

This PR adds support for recoverable signatures. The implementation, for the most part, is lifted from the older version of secp256k1-haskell:0.2.5, though I tried to adapt it to the current version of the library.

These 65-byte (v,r,s)-signatures are used extensively in Ethereum and related projects, for example, in EIP-712: Typed structured data hashing and signing. There is little or no support for this signing mode in Haskell elsewhere, and secp256k1-haskell seems to be the best place for it.

evgeny-osipenko commented 1 year ago

PRs #44 and #45 provide the same functionality, but organized differently. This version simply adds the recovery functions to the single module; #44+#45 have them as a separate package (as outlined in issue #43).