fmgp.did.method.peer.DIDPeer4
See theDIDPeer4 companion trait
object DIDPeer4
Attributes
Members list
Type members
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
To “contextualize” a document:
To “contextualize” a document:
- Take the decoded document
- Add id at the root of the document and set it to the DID
- Add alsoKnownAs at the root of the document and set it to a list, if not already present, and append the short form of the DID
- For each verification method (declared in the verificationMethod section or embedded in a verification relationship like authentication): - If controller is not set, set controller to the DID
Attributes
-
- JSON stringify the object without whitespace
-
- Encode the string as utf-8 bytes
-
- Prefix the bytes with the multicodec prefix for json (varint 0x0200)
-
- Consider this value the hash
Attributes
-
- Take SHA2-256 digest of the encoded document (encode the bytes as utf-8)
-
- Prefix these bytes with the multihash prefix for SHA2-256 and the hash length (varint 0x12 for prefix, varint 0x20 for 32 bytes in length)
-
- Multibase encode the bytes as base58btc (base58 encode the value and prefix with a z)
-
- Consider this value the hash
Value parameters
- hash
-
digest of the encoded document (encode the bytes as utf-8)
Attributes
Value parameters
- initDoc
-
that will create the DID
- keySeq
-
MUST have relative references
Attributes
- Returns
-
AgentDIDPeer for the long form of did:peer:4
Value parameters
- initDoc
-
that will create the DID
- keySeq
-
MUST have relative references
Attributes
- Returns
-
AgentDIDPeer for the short form of did:peer:4
In this article