-
Notifications
You must be signed in to change notification settings - Fork 198
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
feat: add secp256k1 diddoc and verification method #1736
feat: add secp256k1 diddoc and verification method #1736
Conversation
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
There are two formats of verification methods for key-type
Which verification method should be used ? {
"id": "did:key:zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme#zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme",
"type": "EcdsaSecp256k1VerificationKey2019",
"controller": "did:key:zQ3shokFTS3brHcDQrn82RUDfCZESWL1ZdCEJwekUDPQiYBme",
"publicKeyBase58": "23o6Sau8NxxzXcgSc3PLcNxrzrZpbLeBn1izfv3jbKhuv"
} or {
"id": "did:key:zQ3shjRPgHQQbTtXyofk1ygghRJ75RZpXmWBMY1BKnhyz7zKp#zQ3shjRPgHQQbTtXyofk1ygghRJ75RZpXmWBMY1BKnhyz7zKp",
"type": "JsonWebKey2020",
"controller": "did:key:zQ3shjRPgHQQbTtXyofk1ygghRJ75RZpXmWBMY1BKnhyz7zKp",
"publicKeyJwk": {
"kty": "EC",
"crv": "secp256k1",
"x": "RwiZITTa2Dcmq-V1j-5tgPUshOLO31FbsnhVS-7lskc",
"y": "3o1-UCc3ABh757P58gDISSc4hOj9qyfSGl3SGGA7xdc"
}
} |
@@ -27,7 +33,7 @@ const didDocumentKeyTypeMapping: Record<KeyType, (did: string, key: Key) => DidD | |||
[KeyType.P256]: getJsonWebKey2020DidDocument, | |||
[KeyType.P384]: getJsonWebKey2020DidDocument, | |||
[KeyType.P521]: getJsonWebKey2020DidDocument, | |||
[KeyType.K256]: getJsonWebKey2020DidDocument, | |||
[KeyType.K256]: getSecp256k1DidDoc, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Let's use JsonWebKey by default. This seems to be one of the two defaults in DataIntegrity. I think they're moving away from key specific types
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- Updated to
JsonWebKey
as default - Should we later add a way to use different didDoc If someone specifically wants to use them ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yeah that might be useful -- currently they can call the getSecpVerificationMethod
and construct a did doc on their own.
@sairanjit would be great to get this in for 0.5.0, so if you can update it somewhere today to use |
Sure will do it today itself |
Signed-off-by: Sai Ranjit Tummalapalli <sairanjit.tummalapalli@ayanworks.com>
Signed-off-by: Timo Glastra <timo@animo.id>
Signed-off-by: Timo Glastra <timo@animo.id>
Summary
keyDidSecp256k1
EcdsaSecp256k1VerificationKey2019
test-vector
fromhttps://github.com/w3c-ccg/did-method-key/blob/main/test-vectors/secp256k1.json