clipright

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

NetworkChain idAddress
Monad Testnet101430x943767372469f18d9635a10b2c42cbc8f0cf8ea6

Source verified on Sourcify. Solidity source: packages/contracts/contracts/StampRegistry.sol.

FunctionWhat 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.
ErrorWhen
BadSignatureThe signature is not from the stream's key, or a nonce was reused.
AlreadyStampedThat minute already has a root.
TooEarlyMinute m was sent before m minutes had passed since the stream opened.
UnknownStreamNo stream with that id.
EmptyRootThe 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

EndpointReturns
GET /api/configChain id, registry address and RPC URL.
GET /api/streamsEvery stream opened on the registry, from onchain events, and whether fingerprints are stored here.
GET /api/streams/:idThe stream's metadata, stamp receipts and minute fingerprint files.
POST /api/streamsRelays openStream. Body: signer, title, sig.
POST /api/streams/:id/minutesRelays one stamp. Body: the minute file and sig. 425 with retryAfter if the minute is early.
POST /api/linksRelays a wallet link. Body: signer, owner, signerSig, ownerSig.
POST /api/identifyLeads 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/verdictsCreates 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/:idThe checked clip's sound landmarks, so a viewer's browser can compare its own copy.
POST /api/leadsCached 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:

minute-0.json
{
  "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.