$SENTIK CA: TBA
Open app
$SENTIK CA: TBA
Developers

Bring your own engine

Prototype

Sentik handles the parts around the model: segments, hashes, saving, retrying, stitching and an optional on-chain record. You bring the engine.

Engine interface

One method. The runner calls it once per segment and saves the answer immediately. A thrown error marks that segment failed and nothing else.

// src/lib/resume/engine.ts
export interface TranscriptionEngine {
  readonly id: string;       // committed on chain as keccak256("<id>@<version>")
  readonly version: string;
  readonly label: string;
  transcribe(input: SegmentInput, signal?: AbortSignal): Promise<{ text: string }>;
}

type SegmentInput = {
  index: number; startMs: number; endMs: number; sampleRate: number;
  sha256: string;            // of the segment's 16-bit PCM bytes
  pcm: Float32Array;         // mono samples in [-1, 1]
  attempt: number;           // 1 = first try, 2 = first retry, ...
};

// Throw SegmentError(message, code) for a failure worth retrying (lost GPU,
// timeout, out of memory). Any throw marks the segment failed; only failed
// and unfinished segments run again.

Local runner and its HTTP API

examples/runner/server.ts runs on your machine, listens on 127.0.0.1 only, reads WAV files (PCM 8/16/24/32-bit or float), and keeps every job in a folder (job.json rewritten after every segment, plus the exact audio bytes). Kill it at any moment; the next run does only unfinished and failed segments. Every request needs the token it prints at start; requests with another Host, or from a web page (an Origin header), are refused unless you pass --allow-origin; JSON must be sent as application/json; {"path": …} jobs read only regular files inside --input-dir (symlinks resolved). Still, keep it on your own machine: do not expose it to a network. The public repository link appears here once it exists.

# from the repository root
npm install
npm run runner                       # 127.0.0.1:6526, simulated engine
# it prints a fresh token once:  Token (send as "Authorization: Bearer <token>"): 3f9c…
SENTIK_FAIL_FIRST=2,5 npm run runner # make segments 2 and 5 fail once
npm run runner -- --input-dir ~/recordings   # allow {"path": …} jobs for files in this folder only

# your own engine: any command that prints the text of one WAV file
SENTIK_ENGINE_CMD="/path/to/transcriber --input {wav}" \
  npm run runner -- --engine examples/runner/command-engine.mjs
T=<token printed at start>; H="Authorization: Bearer $T"
curl -s -X POST -H "$H" -H 'content-type: audio/wav' --data-binary @meeting.wav \
  'http://127.0.0.1:6526/jobs?targetSec=30'          # -> {"id":"5d2b…","segmentCount":180,...}
curl -s -X POST -H "$H" -H 'content-type: application/json' -d '{"path":"meeting.wav"}' \
  http://127.0.0.1:6526/jobs                         # only with --input-dir

curl -s -X POST -H "$H" -H 'content-type: application/json' -d '{}' http://127.0.0.1:6526/jobs/<id>/run
curl -s -H "$H" http://127.0.0.1:6526/jobs/<id>               # counts + every segment's status
curl -s -X POST -H "$H" -H 'content-type: application/json' -d '{"only":"failed"}' http://127.0.0.1:6526/jobs/<id>/run
curl -s -H "$H" 'http://127.0.0.1:6526/jobs/<id>/transcript?format=srt'   # 409 + missing list until complete
curl -s -H "$H" http://127.0.0.1:6526/jobs/<id>/manifest       # root, leaves, proofs, result hashes

No speech engine is bundled. command-engine.mjs writes each segment to a temporary 16-bit WAV, runs your command, and takes its standard output as the text; a non-zero exit, a timeout or empty output marks the segment failed.

SentikSegmentManifest on Elysium

Prototype Written and tested (unit, fuzz, invariant and Elysium fork tests); not deployed yet. No owner, no fee, no upgrade path, no payable function. It stores hashes only: no audio, no text, no funds. Deploying costs about 1,650,000 gas in HYPE.

FunctionWhat it does
commitJob(salt, root, segmentCount, durationMs, engine, openWorkers, workers[])Job id = keccak256(owner, salt), so nobody can take another owner's id. 1 to 1,024 segments. ~164,000 gas.
postReceipt(jobId, index, startMs, endMs, audioSha256, resultHash, proof[])Owner, an allowed worker, or anyone when the job is open. Checks the Merkle proof against the root; one receipt per segment. ~120,000–137,000 gas.
postReceipts(jobId, items[])Up to 64 receipts in one transaction; one bad item reverts the batch. ~85,000 gas per segment.
reportFailure(jobId, index, reason)Counts an attempt and emits the reason; refused once the segment has a receipt.
rejectReceipt(jobId, index, reason)Owner only: clears a receipt so the segment counts as missing and is redone.
finalize(jobId)Owner only, when every segment has a receipt. Stores the digest of all result hashes. ~45,000 + 2,300 gas per segment.
cancel(jobId) · setWorker(jobId, worker, allowed)Owner only, while the job is open.
getJob · missingSegments(jobId, from, limit) · presentWord · receiptOf · attemptsOf · verifySegment · leafHashViews. missingSegments pages through the gaps; presentWord returns 256 segments per read.

Manifest tree and digests

leaf(i)  = keccak256(keccak256(abi.encode(uint32 i, uint64 startMs, uint64 endMs, bytes32 sha256)))
node     = keccak256(abi.encode(min(a, b), max(a, b)))    // sorted pair
odd node at the end of a layer moves up unchanged
result   = keccak256(utf8(JSON {"index","startMs","endMs","text"}))
digest   = keccak256(result[0] ‖ result[1] ‖ … ‖ result[n-1])   // stored by finalize()

The site, the runner and the contract compute the same values; a test vector written by the TypeScript tests is checked by the Solidity tests.

Trust, stated plainly

  • A receipt proves that a worker posted a result hash for a segment whose audio hash is in the committed manifest. It does not prove the text is a correct transcription.
  • With open workers, anyone can post a receipt; the owner can reject one, which makes that segment missing again.
  • The job owner alone can finalize or cancel. A finalized job is frozen.
  • Every write costs gas in HYPE. Nothing is needed on chain to run, retry or stitch.

Check a deployment

npm run contracts:artifacts -- --check      # artifacts.json equals a fresh forge build
npm run verify-deployment -- --manifest <address> --tx <creation tx hash>