# Proposed did:webnext history format ## Header line - first line of the log - establish log format and base protocol - place to override parameters like the hash function used - list any relevant extensions Examples: ["history:1", "did:webnext:1", {}] ["history:1", "did:webnext:1", {"ext": ["ML-KEM"]}] ## Data lines - list of [version hash, version ID, timestamp, patch, proofs] - hashes are based only on data in the log, not on the resulting document - using multibase+multihash, but not CID - proofs reference the version hash of the current log line in the `challenge` property - the document does not contain any custom properties (`created`, `updated`, `versionId`, `proof`, `previousHash`) Example: ["zQmbacL3sFb1VbmXGJVEGhKWja3AAbvLP9qbztjk4MHi8nA", 2, "2024-03-20T18:42:33Z", [{"op": "add", "path": "/alsoKnownAs", "value": ["did:web:example.com"]}], [{"type": "DataIntegrityProof", "cryptosuite": "eddsa-jcs-2022", "verificationMethod": "did:webnext:example.com:15ymutv3c5wkkrltlq6apjrcd#dnSuE8FBZjE5ua6Fx5l-4mD7A-uvx9vSj5AD3VGPR3Y", "created": "2024-03-20T18:42:33Z", "challenge": "zQmbacL3sFb1VbmXGJVEGhKWja3AAbvLP9qbztjk4MHi8nA", "proofPurpose": "authentication", "proofValue": "z46qJXR6Uxyt1EDGDhEJ2Gd7AfBmf5xuTVkq6LfuPZmsL2nhFqRi7g4mB2TmfDQ3fgkPZXt1cnWFzPGCjjLvdYvWC"}]] ## Version hash calculation - take the version hash of the previous line as `prevHash`. for the first line, calculate `prevHash` using the base protocol as input, ie. `SHA2-256(b"did:webnext:1")` - calculate the raw digest as `SHA2-256(JCS([prevHash, versionId, timestamp, patch]))` - output version hash = `multibase(multihash(digest, "sha2-256"), "base58btc")` Example: hash input: JCS([ "zQmcPRLmBy5KwV74epZ9fvoEngjbukRphUdaZS1nxqKfM16", 2, "2024-03-19T23:39:37Z", [{"op": "add", "path": "/alsoKnownAs", "value": ["did:web:example.com"]}], ]) output: zQmYWPhdCeVuJnKS5Bg131bVcQiTwhbepUAPDYdq35jzTtF