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

Allow more options on Secp256k1KeyPair.generate() #87

Open
sondreb opened this issue Apr 4, 2021 · 1 comment
Open

Allow more options on Secp256k1KeyPair.generate() #87

sondreb opened this issue Apr 4, 2021 · 1 comment

Comments

@sondreb
Copy link

sondreb commented Apr 4, 2021

The Secp256k1KeyPair.from() method allows specifying the .id and .controller using the options argument, while the generate only allows secureRandom and sets both id and controller automatically.

I know this library is for "did:key", but it would be nice to use similar pattern on both generate and from, and not having to override the id and controller for alternative DID Methods. Thanks!

@OR13
Copy link
Sponsor Member

OR13 commented Jun 6, 2021

https://github.com/transmute-industries/verifiable-data/tree/main/packages/secp256k1-key-pair

^ we're planning on making all the did key libraries in this repo small wrappers around these "LDKeyPair" classes in our mono repo...

We tend to think of did:key are just a format for keys, and we often start with it and then assign new values for id and controller when using did:web or sidetree did methods.

On proposed solution to this might be to make the options for LDKeyPair.generate look like this:

{
  secureRandom:  () => UInt8Array,
  id?: string,
  type?: string,
  controller?: string,
}

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