Tickbox documentation
Quickstart
Needs Node 18.17 or newer. The package has no dependencies. Run it without installing:
npx tickbox run -- echo hello # local: metered + signed, free
npx tickbox run --cloud -- echo hello # cloud sandbox, uses the free trial
npm install -g tickbox # or install itYour account is the ed25519 key the CLI creates at ~/.tickbox/node.key (mode 0600). No sign-up, no API key. A new account gets 0.02 USDG of free cloud time on its first request to the node, once (about 50 seconds).
Local vs cloud
Local (default, no --cloud): the command runs on your machine, seconds are metered and the receipt is signed by your local key with settlement: "local". No money moves.
Cloud (--cloud, --cloud <url> or TICKBOX_CLOUD): the command runs in a sealed sandbox on a Tickbox node. The budget is held from your balance, the seconds are paid, the rest is refunded, and the node signs the receipt with settlement: "ledger".
export TICKBOX_CLOUD=https://api.tickbox.cloud # make cloud the defaultCLI
| Command | What it does |
|---|---|
| tickbox run [--budget 2.00] [--worker name] [--cloud [url]] -- <cmd> | Runs the command, meters it per second, stops it when the budget runs out, signs a receipt. Exit code is the command's own, or 124 when the budget ran out. |
| tickbox quote <seconds> [--rate] | Cost of that many seconds. |
| tickbox receipts [--json] | All receipts on this machine, newest first. |
| tickbox verify <file | session id | URL> [--offline] | Checks a receipt's signature and node key, then its anchor on chain (--offline skips the anchor). |
| tickbox keys create --budget 1.00 [--expires 24h] [--workers python,shell] [--label name] | Makes an agent key paid by this account; saves it to ~/.tickbox/keys/<id>.key. |
| tickbox keys list | Your agent keys with spend, limit, expiry and status. |
| tickbox keys revoke <id> | Revokes a key at once and closes its open sessions. |
| tickbox account [--cloud [url]] | Prints your account id; with a node also balance, deposits, recent sessions and a funding link. |
| tickbox whoami | Key id and public key. |
| tickbox mcp [--max-budget 0.10] | Starts the MCP server on stdio. |
| tickbox mcp setup | Prints the JSON config block for Claude Desktop, Cursor and other clients. |
tickbox run --budget 2.00 -- python scraper.py
tickbox run --cloud --worker python --budget 0.05 -- python3 -c "print(6*7)"
tickbox run --cloud --worker shell -- sh -c 'cmd1; cmd2'SDK
import tickbox from "tickbox";
const s = await tickbox.open({ worker: "python", budget: "0.05", cloud: true });
const r = await s.exec('python3 -c "print(6*7)"'); // { code, stdout, stderr }
const receipt = await s.stop(); // signed receipt
tickbox.verifyReceipt(receipt); // { ok: true }open takes budget or seconds, plus an onTick callback. Leave out cloud to run locally.
Sandbox & limits
| Limit | Value |
|---|---|
| Workers | shell (POSIX sh), python (3.12), node (24) |
| Memory | 150 MB hard limit |
| CPU | 0.5 core |
| Processes | 64 max |
| File size | 64 MB per file |
| Network | none — no traffic in or out |
| Filesystem | read-only system; /work is writable and wiped when the session stops |
| Idle | closed after 120 s with no command running |
| Sessions | 1 open session per account |
| Isolation | own namespaces (bubblewrap or a locked-down container), seccomp syscall filter, no root |
Pricing
0.0004 USDG per started second. 1.2 s of wall clock bills as 2 seconds. A session holds at most 2 USDG; whatever is not used is refunded the moment it stops. Money is integer maths in 6-decimal units.
412 s at 0.0004 = 0.164800 USDG paid · 1.835200 refunded from a 2.00 budget
0.02 trial = 50 s
0.10 MCP cap = 250 sFunding
Deposit USDG to the Tickbox vault on Robinhood Chain (chain 4663). The node credits your account after 3 confirmations, once per (transaction, log index). Use the fund page, or script it:
1. USDG.approve(vault, amount) // USDG has 6 decimals
2. vault.deposit(bytes20 account, uint256 amount)
event Deposit(bytes20 indexed account, address indexed from, uint256 amount)Deposits pay for compute on that node and cannot be withdrawn back to the depositor. Unused session budget always returns to your balance.
Receipts
Saved as JSON in ~/.tickbox/receipts/ and served publicly at /v1/receipts/:id.
| Field | Meaning |
|---|---|
| v, mode | format version; local or cloud |
| session, account, worker, image | who ran what, where |
| opened, closed, seconds | wall-clock window and billed seconds |
| rate, budget, paid, refund | 6-decimal amounts with currency |
| status | completed, budget_exhausted, idle_timeout, interrupted, node_shutdown, failed |
| settlement | ledger (cloud) or local |
| key | the agent key that opened the session, when it was not the account key |
| execs | each command with its exit code and signal |
| output | sha256 of everything printed to stdout and stderr, in order |
| node | { id, pub } — id is the first 20 bytes of sha256(pub) |
| sig | ed25519 over the canonical JSON (sorted keys, no whitespace) of every other field |
npx tickbox verify ~/.tickbox/receipts/0x….json
npx tickbox verify https://api.tickbox.cloud/v1/receipts/0x…Agent keys
Give every agent its own key: a spend limit, an expiry, the workers it may use, revoke anytime. Sessions it opens are paid by your account, and its receipts carry a key field. An agent key cannot make or list other keys. You can also create them on the Playground.
tickbox keys create --budget 1.00 --expires 24h --workers python,shell --label my-agent
tickbox keys list
tickbox keys revoke 0x…
TICKBOX_KEY=~/.tickbox/keys/0x….key npx tickbox run --cloud -- echo hello
claude mcp add tickbox -e TICKBOX_KEY=/path/0x….key -- npx -y tickbox mcpRegistering a key takes two signatures: your account key signs the request, and the new key signs its own grant, so nobody can bind someone else's key to their account:
grant = { v: 1, type: "tickbox-subkey", parent: <account id>, key: <new key id>,
budget: "1.000000", expires: <ISO or null>, workers: [..] | null, label: <string | null> }
sig = ed25519(new key, canonical(grant))Anchoring
Every minute the node seals the receipts closed since the last batch into one sha256 Merkle root and publishes it on Robinhood Chain. A receipt then proves it existed in that batch, and nobody can rewrite it later — not even the node.
leaf = sha256(0x00 || canonical(receipt)) // whole signed receipt, sig included
node = sha256(0x01 || left || right) // an odd node moves up as is
root = "0x" + hex
GET /v1/receipts/:id/proof → { index, proof: [{ side: "L"|"R", hash }], anchor: { n, root, status, tx } }
check: recompute the root, then eth_call roots(n) on the contract → must equal root| TickboxAnchor | Does |
|---|---|
| anchor(uint256 n, bytes32 root, uint256 receipts) | Node publishes batch n (owner only). |
| roots(uint256 n) → bytes32 | The root published for batch n (selector 0xc2b40ae4). |
| count() → uint256 | Number of batches published. |
| event Anchored(uint256 indexed n, bytes32 root, uint256 receipts) | Emitted for every batch. |
tickbox verify prints the anchor status after the signature check; --offline skips it. Tickbox Scan runs the same check in your browser.
HTTP API
Base URL https://api.tickbox.cloud. Public routes need nothing; signed routes carry four headers.
| Route | Auth | Does |
|---|---|---|
| GET /v1/node | public | node id, rate, workers, limits, deposit details |
| GET /v1/stats | public | sessions, seconds, paid, accounts, recent receipts |
| GET /v1/receipts/:id | public | a closed session's receipt |
| GET /v1/account | signed | balance, held funds, deposits, recent sessions |
| POST /v1/sessions | signed | {worker, budget} — open a sandbox, hold the budget |
| POST /v1/sessions/:id/exec | signed | {cmd} — output streamed as NDJSON |
| POST /v1/sessions/:id/stop | signed | close, settle, return the signed receipt |
| GET /v1/sessions/:id | signed | status, and the receipt once closed |
| GET /v1/receipts/:id/proof | public | Merkle proof and batch (or status: unanchored) |
| GET /v1/anchors | public | latest batches: n, root, receipts, status, tx |
| POST /v1/keys | account | {pub, budget, expires, workers, label, sig} — register an agent key |
| GET /v1/keys | account | your agent keys |
| POST /v1/keys/:id/revoke | account | revoke a key, close its sessions |
x-tickbox-key SPKI public key, base64
x-tickbox-ts unix time in ms
x-tickbox-nonce random hex, never reused
x-tickbox-sig ed25519 over METHOD\nPATH\nTS\nNONCE\nsha256(body), base64
# requests older than 60 s or with a reused nonce are refusedMCP server
Give Claude, Cursor or any MCP client its own sandbox. Every run has a spend cap (default 0.10 USDG, set with --max-budget or TICKBOX_MAX_BUDGET).
claude mcp add tickbox -- npx -y tickbox mcp
npx tickbox mcp setup # JSON block for other clients| Tool | Does |
|---|---|
| tickbox_run | One shot: code (python, node or sh) or a command, optional files and outputs. Returns stdout, stderr, exit code, seconds, paid, refund and the verified receipt. |
| tickbox_session_open | Opens a persistent sandbox, billed per second, closed after 2 idle minutes. |
| tickbox_exec | Runs code or a command in an open session; /work persists between calls. |
| tickbox_session_close | Closes, settles, refunds and returns the verified receipt. |
| tickbox_account | Account id, balance, free trial, rate, workers and funding instructions. |
| tickbox_quote | Price of a number of seconds. |
| tickbox_verify | Verifies a receipt from a session id, URL or JSON. |
| tickbox_receipts | Latest receipts on this machine. |
Files are text content or a local_path, up to 512 KB per call, written into /work. Outputs are paths inside /work, saved to ~/.tickbox/files/<session>/; text files up to 64 KB also come back inline.