Semantic Web and Web 3.0 · class 11 · demo
Anchor a document
On chain goes the digest — 32 bytes — never the document. Type a document: the page computes its digest and asks the contract
whether it has it, with get(digest). As in example 06, the certificates' «document» is their URI, so typing a certificate URI finds it.
The digests
| Function | Digest of these 43 bytes (UTF-8) |
|---|---|
| keccak256 | 0x736e394a86226f896b7fda931ce781f70f281ebcbeeb65610ddfb98c9eab42d6 |
| sha256 | 0x2204a4a4a5f179e958c9e3fb0aba7ec367e64a0703a6819d0555fd064a7292be |
Both are 32 bytes, so either fits a bytes32. The class uses keccak256 (what Solidity and ethers call
natively); a registry must just say which one. One character more — a space, a newline — and both change completely.
On the chain?
Registered
author 0x1111111111111111111111111111111111111111
registeredAt 1793404836 (2026-10-31 00:00:36 UTC)
uri https://data.csoares.me/revocation/2026-002
block 8412994 · tx 0xb8f20a…1fd509
Whoever holds these exact bytes can prove they existed at that time, signed by that account — without the chain ever holding the document.
An in-memory chain (the Ethereum virtual machine, @ethereumjs/evm), in this one process: no test network, no wallet, no keys, no money. Nothing a visitor does is kept.