3.0.2 • Published 3 days ago

@verida/did-document v3.0.2

Weekly downloads
-
License
ISC
Repository
github
Last release
3 days ago

DID Document

This library handles the creation and update of DID documents meeting the W3C DID Document specification.

It has additional helper methods:

  • addContext(): Manage information about a Verida context to a document. This adds relevant service endpoints and public keys.
  • removeContext():
  • addContextService():
  • addContextSignKey():
  • addContextAsymKey():
  • signProof():
  • verifyProof():
  • verifySig():
  • verifyContextSignature():
  • locateServiceEndpoint():

Example DID Document

{
  "_id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
  "_rev": "1-f7161a44c70c2f56bcd6556be71d3775",
  "doc": {
    "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
    "controller": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
    "assertionMethod": [
      "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
      "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#sign"
    ],
    "verificationMethod": [
      {
        "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
        "type": "EcdsaSecp256k1VerificationKey2019",
        "controller": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
        "publicKeyHex": "0x04d0843b161fbeb68af22bef5f93acd375ce9c80135c2589b87bca6e88b5aff4e5bb50d3d2177d3f9fefe67f42abbe1fa25f131b65ea6e849df4c14438fe5959fe"
      },
      {
        "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#sign",
        "type": "EcdsaSecp256k1VerificationKey2019",
        "controller": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
        "publicKeyHex": "0x034d51203e92581a65f6625da3ebe1ff7952f190bed8365419bda068c9525a2d1a"
      },
      {
        "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#asym",
        "type": "Curve25519EncryptionPublicKey",
        "controller": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
        "publicKeyHex": "0xfcd0a3c0e7fa0588670309e2bbce93dbeae0c272dfe695ae2bfaaa2de7d6452a"
      }
    ],
    "service": [
      {
        "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#database",
        "type": "VeridaDatabase",
        "serviceEndpoint": "https://db.testnet.verida.io:5002/"
      },
      {
        "id": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#messaging",
        "type": "VeridaMessage",
        "serviceEndpoint": "https://db.testnet.verida.io:5002/"
      }
    ],
    "keyAgreement": [
      "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289?context=0xa8b06901f1ed1ccefd33164727d07b2778445c7f491746527cc8d9a47c102b14#asym"
    ],
    "proof": {
      "type": "EcdsaSecp256k1VerificationKey2019",
      "verificationMethod": "did:vda:0x0159c90eceecfeec7b92936f5249e17969d18289",
      "proofPurpose": "assertionMethod",
      "proofValue": "0x972664a19cff034db53f4958ae36b72679c25f69267fc1ffe2b57f9fdc7b68137c972f67e2947ea7ebbc8ec316201f7c41d53ec96e3a40418da1d30f909b71b01b"
    }
  }
}
3.0.3

3 days ago

4.0.0-alpha.0

16 days ago

3.0.2

2 months ago

3.0.2-alpha.0

4 months ago

3.0.1

5 months ago

3.0.0

5 months ago

2.3.2

8 months ago

2.3.3

8 months ago

2.4.0-rc1

5 months ago

2.3.0

1 year ago

2.2.1

1 year ago

2.2.0

1 year ago

2.3.1

1 year ago

2.1.3

1 year ago

2.3.0-rc1

1 year ago

2.3.0-rc2

1 year ago

2.3.0-rc3

1 year ago

2.1.1

1 year ago

2.0.2

1 year ago

2.0.5

1 year ago

2.0.4

1 year ago

2.1.0

1 year ago

2.0.0-rc5

1 year ago

2.0.0-rc4

1 year ago

2.0.0-rc3

2 years ago

2.0.0-rc2

2 years ago

2.0.0-rc1

2 years ago

2.0.0

1 year ago

1.0.5

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

3 years ago

0.1.1

4 years ago

0.1.0

4 years ago