Updating a DID Document
A DID is updated by performing an HTTP POST of a signed DID Document to
the `veresOneUpdateService`. The following HTTP status codes are defined
for this service:
HTTP Status Description
------------- ------------------------------------
200 DID update request was successful.
400 DID update request failed.
An example exchange for a DID update request is shown below:
Example 11: DID Document
update request
``` {.highlight .hljs .http aria-busy="false" aria-live="polite"}
POST /dids/did:v1:215cb1dc-1f44-4695-a07f-97649cad9938 HTTP/1.1
Host: example.com
Content-Type: application/ld+json
Content-Length: 1062
Accept: application/ld+json, application/json, text/plain, */*
Accept-Encoding: gzip, deflate
{
"@context": "https://w3id.org/webledger/v1",
"type": "WebLedgerEvent",
"operation": "Update",
"input": [{
"@context": "https://w3id.org/veres-one/v1",
"id": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84",
"authorizationCapability": [{
"permission": "UpdateDidDocument",
"entity": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84",
"permittedProofType": [{
"proofType": "LinkedDataSignature2015"
}, {
"proofType": "EquihashProof2017",
"equihashParameterAlgorithm": "VeresOne2017"
}]
}],
"authenticationCredential": [{
"id": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84/keys/1",
"type": "CryptographicKey",
"owner": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\r\n
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAmbDqPu6IKHiiIQ4d0AQ6\r\n
PBduDhUUVqyQirvxqsdcNdKgZ2L8whBml/nTyuB4cd+hHrsfMDiHiT5kX2pbZ7Yy\r\n
2ctWkGw8e0J94CbwVh2H15gBQBUCjLiGvVIHO2pni693qmre+3Ya2NJ8gGwPLJ7h\r\n
TLca2b2dX0y16qu0MT0osUGGEoPsdg6ibD2pxnADS3GNPObHT12GrAuxjYFMHecF\r\n
A4hLZ8U+MIcVmHZuokqqbcyJyjOV+kmhFNeTKFP5P5U8HA3Y42/rE1UJp/wyy7Lc\r\n
ZAvq0t75ddXKyvYh5dkzxxeeELNKNWVxJ2yvgAr0SatLEPzxJoeYdCyU5N5E22Fj\r\n
jQIDAQAB\r\n-----END PUBLIC KEY-----\r\n"
}, {
"id": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84/keys/2",
"type": "CryptographicKey",
"owner": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84",
"publicKeyPem": "-----BEGIN PUBLIC KEY-----\r\n
MIIBIj0BAQEFAKHiiIQ4d0AQ6ANBgkqhkiG9wAOCAQ8AMIIBCgKCAQEAmbDqPu6I\r\n
xqsdcNdKgZ2L8whBml/nTyuBiHiPBduDhUUVqyQirvT5kX2pbZ7Yy4cd+hHrsfMD\r\n
VhVIHO2pni693qmre+2ctWkGw8e0J94Cbw3Ya2NJ8gGwPLJ7hH15gBQBUCjLiGv\r\n
0osUNPObHT12GrAuxjYFMHecFGTLca2b2dX0y16qu0MTGEoPsdg6ibD2pxnADS3G\r\n
kqqbcyJyjOV+kmh8HA3Y42/rE1UJpA4hLZ8U+MIcVmHZuo/wyy7LcFNeTKFP5P5U\r\n
5dkzxxezxJoeYdCyU5N5E2ZAvq0t75ddXKyvYh2FjeELNKNWVxJ2yvgAr0SatLEP\r\n
AQABjQID\r\n-----END PUBLIC KEY-----\r\n"
}]
}],
"signature": [{
"type": "EquihashProof2017",
"equihashParameterN": 64,
"equihashParameterK": 3,
"nonce": "AQAAAA==",
"proofValue": "AAAaPwABxrIAAFOKAAGo4QAAVW0AAN7cAACXcgABjEI="
}, {
"type": "LinkedDataSignature2015",
"created": "2017-09-30T02:54:31Z",
"creator": "did:v1:770f2d84-5e62-4caa-af95-111a3205bc84/keys/2",
"signatureValue": "Zg7o26UYnyGYTvKdSN6hcpZnm9cGvSZB+hJFhXzSer/S+XkMbsPqLn
VMncCJ00SRoOzCOZUABRJV/azBFDizeJu/gHVk68bNSAfpELkrdWx8/xvMIF8r+LWhwdKCS
XTQT5j6qYZtP8ut1BenahNhXisS5385Ljlf5Cae8TMH17txP0CfzHbUMJFnHA1+Nru+e/Pw
K40yD5rOvQn/GlC+unyB8ziOw4DjSwIFe60jCToz/UOJNZBiIYwo+Pwwx28Wqd4Jkb3IeDr
VVZsxAYTKCAOJvJMIE+nlHjpB+RyPwuQ+VZYlXOB7g/tKsKs9z4ZzVtddntqqAcvbZxV/o7
/45H=="
}]
}
```
If the update request for the DID was successful, an HTTP 200 status
code is expected in return:
Example 12: Successful
ledger creation response
``` {.highlight .hljs .http aria-busy="false" aria-live="polite"}
HTTP/1.1 200 Success
Cache-Control: no-cache, no-store, must-revalidate
Pragma: no-cache
Expires: 0
Date: Fri, 14 Oct 2016 18:35:33 GMT
Connection: keep-alive
Transfer-Encoding: chunked
```