Closed gorazdko closed 3 years ago
@OR13, two items:
1 - We are getting a different pub key than you.
2 - Does this DID document look correct?
{
"@context": [
"https://www.w3.org/ns/did/v1",
{
"@base": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid"
}
],
"id": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid",
"VerificationMethod": [
{
"id": "#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E",
"type": "JsonWebKey2020",
"controller": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid",
"publicKeyJwk": {
"crv": "Ed25519",
"kty": "OKP",
"x": "LIUp9Jdi2R17QcZnbPFZOYyV5oyotNHU2J5dQUdTUa4"
}
},
{
"id": "#5CRqmSH-XbX2V1qysBH0vPWzgveQEZObyOrAiaOY9U8",
"type": "JsonWebKey2020",
"controller": "did:onion:fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid",
"publicKeyJwk": {
"crv": "X25519",
"kty": "OKP",
"x": "785EYGRUOU2sNrWMZJgsCgQFs4lXpVWgvM9K6CyBogU"
}
}
],
"authentication": "#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E",
"assertionMethod": "#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E",
"capabilityInvocation": "#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E",
"capabilityDelegation": "#g7r2t9G8dBBnG7yZkD8sly3ImDlrntB25s2pGuaD97E",
"keyAgreement": "#5CRqmSH-XbX2V1qysBH0vPWzgveQEZObyOrAiaOY9U8"
}
@ChristopherA your did document looks correct.
In my example i generated 2 keys, the first key I generate is for the identifiers (I am avoiding tor key conversion).
the second key is used in the did document, to derive the ed25519 and x25519 keys.
the identifiers for the keys are multicodec, per did key, but thats optional, they can be any url safe strings.
This is the script i use to generate the DID:
https://github.com/OR13/did-onion.js/blob/master/keys/gen.sh https://github.com/OR13/did-onion.js/blob/master/keys/hidden-service.yaml
I don't translate from TOR Keys, I just generate them once using that script and then generate the keys I want to use in the did document using:
https://github.com/OR13/did-onion.js/blob/master/packages/did-onion-cli/generate.js#L24
I think the issue may be confusion over the kid
not being https://tools.ietf.org/html/rfc7638 for did key.
the id
value of the verification methods can be any URL safe string, in did key its defined like this: https://w3c-ccg.github.io/did-method-key/#format
I suggest we add a note to the spec recommending https://tools.ietf.org/html/rfc7638 for JWK identifiers, and "did key multicodec identifiers" for base58 keys... this will help eliminate future confusion.
Comment added.
Abstract
This PR updates the test vector to reflect the fact that there is a single
ed25519
keypair. The ed25519 pubkey is part of the onion address:onion_address = base32(PUBKEY | CHECKSUM | VERSION) + ".onion"
Also, I'm getting different results when calculating
id
. Orie's library givesid
z6MkiTBz1ymuepAQ4HEHYSF1H8quG5GLVVQR3djdX3mDooWp
for aseed of 32 zeros
:My library gives id
9ZP03Nu8GrXPAUkbKNxHOKBzxPX83SShgFkRNK-f2lw
generated with this code snippetThe algo was tested correctly against https://w3c-ccg.github.io/lds-jws2020/#example-4
Other
Our site
http://fscst5exmlmr262byztwz4kzhggjlzumvc2ndvgytzoucr2tkgxf7mid.onion
was updated to show the example that Orie has come up with inhttps://github.com/OR13/did-onion.js
These changes are now also reflected in
https://github.com/BlockchainCommons/torgap-demo
where one can set up the hidden service on a linode with their own minisign secret key. It is now based on warp servertorgap-sig now allows generating a simple DID document and Tor v3 authentication keys (for client authorization)