Giter Club home page Giter Club logo

Comments (4)

OR13 avatar OR13 commented on May 29, 2024

It should be possible to overwrite the signer similar to how we do for gpg here: https://github.com/transmute-industries/lds-gpg2020/blob/master/bin/bin.js#L117

The issue is that 90% of what this suite does is actually in jsonld.js & bitcoin-ts... the signing itself is defined here:

https://bitauth.github.io/bitcoin-ts/interfaces/secp256k1.html#signmessagehashcompact

I would actually recommend avoiding this library and using https://github.com/transmute-industries/lds-jws2020

Which makes it much clearer how to generate signatures, because it uses standard jose...

https://github.com/transmute-industries/lds-jws2020/blob/master/src/JsonWebKeyLinkedDataKeyClass2020.js#L198

^ this library also supports ed25519 / p-256 / rsa.... so for the cost of understanding one kind of signature (detachd jws), you can now use all the JWS algs supported by jose... of course, if you know you only need secp256k1 or ed25519, you can choose to use suites that only support them.

from lds-ecdsa-secp256k1-2019.js.

OR13 avatar OR13 commented on May 29, 2024

This web app demo: https://identity.foundation/lds-ecdsa-secp256k1-2019.js/demo/

uses the web assembly version of bitcoin-ts, does the signing locally in browser, but the interface requires keys in JWK format... you can use this to convert to JWK from hex:

https://github.com/decentralized-identity/lds-ecdsa-secp256k1-2019.js/blob/master/packages/es256k-jws-ts/src/keyUtils.spec.ts#L20

from lds-ecdsa-secp256k1-2019.js.

OR13 avatar OR13 commented on May 29, 2024

c) A webapp doing the signing locally that can test with given WIF and HEX private keys.

This should be very easy to do, we just do the key conversion locally before using the library as we do in the demo today.

b and c) are sorta accomplished here:

It would probably be better to just make a new test in jws2020 which was closer to https://tools.ietf.org/html/rfc7520

from lds-ecdsa-secp256k1-2019.js.

OR13 avatar OR13 commented on May 29, 2024

the difference between this suite and jws2020, is that this one runs in the browser, and only supports ES256K.

from lds-ecdsa-secp256k1-2019.js.

Related Issues (12)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.