-
Notifications
You must be signed in to change notification settings - Fork 10
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
Add support for secp256k1 #15
Comments
@OR13 - there's this repo, https://github.com/digitalbazaar/secp256k1-key-pair, which works with |
@OR13 so, unfortunately the |
Seems like it uses: elliptic Sounds like should I use the Any chance I can use jwk formatted keys for secp256k1, use that as the fingerprint and just support publicKeyBase58 as an additional property? Obviously, keyAgreement won't be included here. |
I don't really have a strong opinion on this. @dlongley ? |
Note that a "fingerprint" in this case is the full public key or it won't work with |
Thats not correct ATM i think... https://github.com/digitalbazaar/crypto-ld/blob/master/lib/Ed25519KeyPair.js#L363 Note that and similarly:
This fingerprint implementation is custom (multibase / multicodec), its probably possible to implement it for |
Sorry, to clarify, the fingerprint value doesn't need to match the base58 public key value byte for byte, it's just that the "fingerprint" (or value after |
yes, i understand now after reading the source code. We should update the method spec to define the fingerprint behavior, and note that it matches: https://w3c-ccg.github.io/did-method-key/#format |
Created an issue here: w3c-ccg/did-method-key#10 |
Whats the significance of the https://github.com/digitalbazaar/crypto-ld/blob/master/lib/Ed25519KeyPair.js#L352 will this be the same for secp256k1? |
It has to do with how multicodec encodes multi-byte varints, if I recall. |
@OR13 I don't remember if it'll be the same for secp256k. Basically it's whatever the npm |
No way to tell currently since the 'secp256k1-pub' change is not published yet.... |
@OR13 ah, boo, ok. I need to dig into https://github.com/multiformats/unsigned-varint carefully and figure it out, then. |
@OR13 Ok, confirmed: const varint = require('varint')
varint.encode(0xe7)
[ 231, 1 ] which is the same as your implementation in https://github.com/digitalbazaar/secp256k1-key-pair/pull/3/files
So, all good. |
We still need to publish a version of https://github.com/digitalbazaar/secp256k1-key-pair before we can implement support in did key. |
@OR13 |
Blocked by: digitalbazaar/crypto-ld#41 |
To close this issue, we should add an example to the README. The new code base would not include anything directly. |
I would also like to use this library with secp256k1. But struggling to get it working using https://github.com/digitalbazaar/ecdsa-secp256k1-verification-key-2019 I am attempting this:
The above code fails. And every time I fix the current error, another one bubbles up. The latest one I am stuck on is: So basically wondering if anyone has an example of this working? |
@dlongley @dmitrizagidulin I assume you may prefer for this to actually be added to
crypto-ld
. I'm eager to get this into DID Key, any quick advice that I might be able to follow to get a PR started on this.We use https://github.com/bitauth/bitcoin-ts WASM module for browser support.
There are also:
The text was updated successfully, but these errors were encountered: