Contract and API
For builders and reviewers.
One contract holds the record. A small HTTP API relays stamps and serves fingerprint files. Anything the API says can be checked against the contract.
StampRegistry
| Network | Chain id | Address |
|---|---|---|
| Monad Testnet | 10143 | 0x943767372469f18d9635a10b2c42cbc8f0cf8ea6 |
Source verified on Sourcify. Solidity source: packages/contracts/contracts/StampRegistry.sol.
| Function | What it does |
|---|---|
openStream(signer, meta, sig) | Opens a stream owned by signer. sig signs openDigest(signer, nonce, meta). Emits StreamOpened. |
stamp(streamId, minute, root, sig) | Records a minute's root once. sig signs stampDigest(streamId, minute, root). Emits Stamped. |
verifySecond(streamId, minute, second, audioDigest, pictureFull, pictureCenter, proof) | True if that second's fingerprints are in the stamped minute, plus the stamp time. |
secondLeaf(...) | The leaf hash for one second, identical to the engine's secondLeaf. |
streams(id), stamps(id, minute), nonces(signer) | Public state: signer, open time, stamp count; each minute's root and time; open nonces. |
| Error | When |
|---|---|
BadSignature | The signature is not from the stream's key, or a nonce was reused. |
AlreadyStamped | That minute already has a root. |
TooEarly | Minute m was sent before m minutes had passed since the stream opened. |
UnknownStream | No stream with that id. |
EmptyRoot | The root is zero. |
Signatures are EIP-191 personal signatures over the 32-byte digest.
CreatorLinks ties a stamping key to a creator wallet: link(signer, owner, signerSig, ownerSig) needs both signatures over linkDigest(signer, owner, nonce), accepts smart wallets (ERC-1271), and emits Linked. ownerOf(signer) returns the current wallet. Source: packages/contracts/contracts/CreatorLinks.sol.
HTTP API
| Endpoint | Returns |
|---|---|
GET /api/config | Chain id, registry address and RPC URL. |
GET /api/streams | Every stream opened on the registry, from onchain events, and whether fingerprints are stored here. |
GET /api/streams/:id | The stream's metadata, stamp receipts and minute fingerprint files. |
POST /api/streams | Relays openStream. Body: signer, title, sig. |
POST /api/streams/:id/minutes | Relays one stamp. Body: the minute file and sig. 425 with retryAfter if the minute is early. |
POST /api/links | Relays a wallet link. Body: signer, owner, signerSig, ownerSig. |
POST /api/identify | Leads for an unstamped clip. Body: frames (up to 10 base64 JPEGs) and audio (base64 WAV). Returns the transcribed lines, Wikiquote and trace.moe hits, and Gemini's unverified guess (null when Whisper on Groq stood in). 8 a minute. |
POST /api/verdicts | Creates a shareable link. Body: streamId, duration, landmarks, frames ([t, hash hex]) and an optional thumbnail. The server matches the fingerprint again and refuses clips that do not match. Returns the /v/<id> path. |
GET /api/verdicts/:id | The checked clip's sound landmarks, so a viewer's browser can compare its own copy. |
POST /api/leads | Cached leads for a clip. Body: landmarks ([hash, frame] pairs) and duration. Returns catalog hits found for the same sound earlier, or none. |
A minute file, abridged:
{
"v": 1,
"streamId": "0x…",
"minute": 0,
"root": "0x…",
"seconds": [
{ "s": 0, "a": [[hash, frame], …], "pf": "0x…", "pc": "0x…" }
]
}a holds the second's sound landmarks, pf and pc the full-frame and centre-crop picture hashes. Recomputing the root from this file must give the root stamped onchain.