ethereum / eth-keys

A common API for Ethereum key operations.
MIT License
161 stars 64 forks source link

Support for signatures without v value #57

Open jannikluhn opened 5 years ago

jannikluhn commented 5 years ago

What was wrong?

The v4 identity scheme defined in the ENR spec uses signatures consisting of only r and s, not v. eth-keys currently does not allow verification of signatures without v.

How can it be fixed?

Suggested approach:

jannikluhn commented 5 years ago

Oh, and we probably need a method to create such a signature. Maybe PrivateKey.sign_non_recoverable?

pipermerriam commented 5 years ago

At the highest level I'm :-1: on this.

Wondering if we could segregate this into two classes so that rather than having APIs that might raise an error, you instead decide what type of signature you are working with and don't have to do any value checking.

Signature -> RecoverableSignature

We can figure out how to deal with names and the existing signature class if we like this approach.

jannikluhn commented 5 years ago

Agreed, two classes sound like the safer approach (probably with a shared base class).