w3c-ccg / didm-btcr

WORK ITEM: BTCR DID Method Spec
https://w3c-ccg.github.io/didm-btcr/
Other
5 stars 4 forks source link

Use correct key types from LD cryptosuite registry #5

Open kimdhamilton opened 6 years ago

kimdhamilton commented 6 years ago

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 commented 6 years ago

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 commented 6 years ago

@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!