Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for signatures without v value #57

Open
jannikluhn opened this issue May 7, 2019 · 3 comments
Open

Support for signatures without v value #57

jannikluhn opened this issue May 7, 2019 · 3 comments
Labels

Comments

@jannikluhn
Copy link
Contributor

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:

  • Implement ecdsa_verify in all backends without falling back to ecdsa_recover
  • Allow instantiation of Signature with an (r, s) tuple and/or a 64 byte signature. All recover methods should raise some kind of exception (ValidationError?) if v is not set.
@jannikluhn
Copy link
Contributor Author

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

@pipermerriam
Copy link
Member

At the highest level I'm 👎 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
Copy link
Contributor Author

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants