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 44 bytes (UTF-8) |
|---|---|
| keccak256 | 0x1d38a204cc9a92a2c898611a48b4ba77931ee6f964663d8adf7a41450a94aef7 |
| sha256 | 0xd33f37c8b5710a27f6028f0bf988a9f8df4c868a0675c3fe0448b0d356f40e3e |
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 1793404800 (2026-10-31 00:00:00 UTC)
uri https://data.csoares.me/certificate/2026-001
block 8412991 · tx 0x5ebcd5…937c1d
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.