-
Notifications
You must be signed in to change notification settings - Fork 12
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
reconcile the UCAN keypair API with keystore-idb
#2
Comments
Hey @nichoth thanks for the issue. I tried to make this library as compatible as possible. You're right that I don't think we want to pull I'm also not sure that Thanks for bringing this up. Good food for thought, and something I'd like to address soon. Feel free to post any questions/issues you run into along the way. |
keystore-idb
keystore-idb
keystore-idb
keystore-idb
I like that idea. There could be another dependency, |
I think the
That's why I think it's a great candidate for an interface between webnative and the ucans library. A |
True it seems unnecessary. Would |
I like it @matheus23 👌 @nichoth It does not. Since it's an interface, we can just use a matching interface in |
Side note on this:
I am planning to implement both secp256k1 & the NIST curves in this library in the relatively short term, so that will give even better compatibility with |
I see; thanks @dholms. So these remain completely decoupled — |
Yes. We would duplicate the type in Also, I'd actually like to kick off a small discussion about the I'd propose this: export interface Keypair {
publicKey: Uint8Array
keyType: KeyType
sign: (msg: Uint8Array) => Promise<Uint8Array>
} Thus, removing If they're inside the interface, then the interface can be in an impossible state where It would also be possible to only require this reduced |
Good call @matheus23 I like it 👍 I might hack on this a bit today 👀 |
@matheus23 Thoughts? enums in TS kinda suck 😛 and I'm not sure how well they play in terms of structural typing |
Oh yeah good point. And I haven't had issues with not using enums so far :D |
Alrighty I decided to just go for it real quick: |
I think we can close this issue and continue tracking this in keystore-idb instead. |
The
ucans
library has a methoducan.keypair.create
, which returns a keypair object with a.did
method. In real life you would want to use thekeystore-idb
library though to manage persistent keys over time. However, the keystore-idb library returns a different API for a keypair. I started by forking the keystore-idb repo here; this gives a methodgetKeypair
that should return the same API that is returned byucans
.It uses a different test library and bundler though, so not ideal for merging at this point
The text was updated successfully, but these errors were encountered: