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

Add support EcdsaSecp256k1Signature2019 #74

Open
OR13 opened this issue Aug 7, 2019 · 6 comments
Open

Add support EcdsaSecp256k1Signature2019 #74

OR13 opened this issue Aug 7, 2019 · 6 comments

Comments

@OR13
Copy link

OR13 commented Aug 7, 2019

@msporny Would you / someone you know be interested in co-authoring / editing the spec for this:

w3c-ccg/lds-ecdsa-secp256k1-2019#2

I'm happy to help get this into jsonld-signatures, once the spec is formalized a bit more.

@dlongley
Copy link
Member

dlongley commented Aug 9, 2019

cc: @mattcollier -- we'll need to figure out what's going on with the above and https://github.com/digitalbazaar/ecdsa-secp256k1-signature-2019 ... hopefully they're doing the same thing or can be easily reconciled.

@OR13
Copy link
Author

OR13 commented Aug 11, 2019

Looks very similar, I can make sure to add interop tests with the above library once thats possible.

Here's the direct link to the repo: https://github.com/decentralized-identity/lds-ecdsa-secp256k1-2019.js

I based the linked implementation on https://w3c-dvcg.github.io/lds-ed25519-2018/ and followed the example implementation in https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/suites/Ed25519Signature2018.js

The main difference currently is the lack of built in documentLoader.

It would be easier to align implementations with a clearer spec, if you could provide comments on:

w3c-ccg/lds-ecdsa-secp256k1-2019#2

and / or help author it, I would greatly appreciate it. You guys have much more experience with this stuff than I do :)

@OR13
Copy link
Author

OR13 commented Aug 14, 2019

I added support for the documentLoader, so our interfaces can be even closer. I've also added support for the Universal Resolver for DIDs.

@OR13
Copy link
Author

OR13 commented Sep 27, 2019

Related note... I'm not a huge fan of where the encoding and signing are happening under the current inheritance model: https://github.com/digitalbazaar/jsonld-signatures/blob/master/lib/util.js#L142

especially for JWS, with detached signatures.

I would prefer to see the signature suite, in this case JOSE JWS, be called directly, and have it handle encoding, since it is supposed to handle encoding... This is probably more of a result of the lack of support for ES256K than anything else, but for example, I would expect the places where encoding happens to be different if we were supporting all valid JWS alg, for example here: https://www.npmjs.com/package/@panva/jose

One of these days we will find ourselves in a situation where these non standard curves are not allowed :)

@OR13
Copy link
Author

OR13 commented Sep 27, 2019

note that the library above supports ES256K natively assuming you are running node 12.

@OR13
Copy link
Author

OR13 commented Jan 27, 2020

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

2 participants