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.

Try: certificate:2026-001 · certificate:2026-003 · revocation:2026-002 · «Hello, class 11»

The digests

FunctionDigest of these 15 bytes (UTF-8)
keccak2560x2c9bbfcf5410f3720d92358b15ca3371e074cef5f3a1e4d286fa45e9f06b774c
sha2560x08d8c0fcc8bfdd7b8e80558d865ffd85ce282af094717ef35897c663c8c5593e

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?

Not registered

get(digest) → author 0x000…000, registeredAt 0, uri ""

A mapping has no «not found»: an unknown key reads as zeros, and the author is what tells them apart.

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.