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

Use correct key types from LD cryptosuite registry #5

Open
kimdhamilton opened this issue Apr 4, 2018 · 2 comments
Open

Use correct key types from LD cryptosuite registry #5

kimdhamilton opened this issue Apr 4, 2018 · 2 comments

Comments

@kimdhamilton
Copy link
Contributor

Our current BTCR docs reference public key type EdDsaSAPublicKeySecp256k1 and mention encoding the key material according to the Koblitz Elliptic Curve Signature 2016 signature suite.

We should ensure we're consistent with the latest registry versions (or add a new entry if not already present): https://w3c-ccg.github.io/ld-cryptosuite-registry.

Also, ensure we're using proof instead of signature consistently.

@ChristopherA
Copy link
Contributor

We also need to note that when you extract the signature from the transaction, there are multiple public keys possible that could have generated it. Given a signature (an (r,s) pair), and the message it signs, there can be up to 4 different public keys for which it is valid.

To know which one, the number is encoded along the signature. The first byte is this recovery parameter plus 27. If the corresponding public key is to be a compressed one, 4 is added. The next 32 bytes encode r. The last 32 bytes encode s.

We by default use only compressed public keys.

By convention we choose the compressed version.

@danpape
Copy link
Contributor

danpape commented Aug 21, 2018

@ChristopherA Do you have a reference regarding the above comment that I can look at? I'm starting to get into all of this for our C++ library and need to come up to speed. thanks!

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

No branches or pull requests

3 participants