sidetree
sidetree copied to clipboard
Add precise language on DID unique suffix generation and test vector
Example test vectors can be found at: https://tools.ietf.org/html/rfc3394
Suffix = ASCII(Base64URL(Multihash(SHA256, UTF8(Suffix JSON data))))
Related note:
https://identity.foundation/sidetree/docs/spec/#did-suffix-composition refers to the
Create operation’s Suffix Data Object
but this object isn't defined in that section. (Rather, you can implicitly see an example in: https://identity.foundation/sidetree/spec/#anchor-file under Create).
Another note: multi-hash isn't mentioned in the spec.
WIP:
DID Methods based on the Sidetree protocol all share the same identifier format. The unique identifier string is a hash of a set of initialization values the controller generates when they create a Sidetree-based DID. This composite hash of initial state values enables Sidetree DIDs to be self-certifying, meaning the person or entity who generates a Sidetree-based DID knows their unique identifier immediately, and it is cryptographic secured for instant use (for more on instant use capabilities of Sidetree DIDs see the Long-Form Sidetree Format section below).
The process below MUST be used to correctly generate a Sidetree-based DID identifier string:
-
From the values generated during the Create operation process, assemble an Anchor File Create Entry object, composed as follows:
{ "delta_hash": DELTA_HASH, "recovery_key": JWK_OBJECT, "recovery_commitment": COMMITMENT_HASH }- The object MUST contain a
delta_hashproperty, and its value MUST be a hash of the Create Operation Delta Object. - The object MUST contain a
recovery_keyproperty, and its value MUST be the Initial Recovery Public Key. - The object MUST contain a
recovery_commitmentproperty, and its value MUST be the Initial Recovery Commitment
- The object MUST contain a
suggested change:
HTTP POST http://example.com/operations { body } -H { accept: application/json }
body : { type: 'create', suffix_data: base64url ( { "delta_hash": DELTA_HASH, "recovery_key": JWK_OBJECT, "recovery_commitment": COMMITMENT_HASH }) delta: base64url({ "patches": PATCH_ARRAY, "update_commitment": COMMITMENT_HASH }) }
Suffix = ASCII ( Base64URL ( Multihash ( SHA256 ( suffix_data ) ) )
Long Form = (suffix_data).(delta)
Recommend a note that JSON Canonicalization MAY be performed: https://github.com/decentralized-identity/sidetree/issues/564
@csuwildcat @thehenrytsai to define what happens in the spec language.
Assuming this is documented, we can have test vectors.
Blocked pending reference implementation catchup...
Henry, are the vectors the same as in the spec here?: https://identity.foundation/sidetree/spec/#long-form-did-uris
@thehenrytsai are the vectors present in the spec, as linked above, true and correct for what is implemented?
ACTION: Dan will update examples
ACTION: Copy reference implementation test vectors into spec. @thehenrytsai @csuwildcat
Copying the resolution output test vectors into the Spec has been done.