Skip to content
Rules
CA$NOCTIQ · TBA
Rules

How one budget is shared, and who can touch it.

Everything on this page is enforced by NoctiqRetryBudget or by the runner code on this site. Where something is a measurement and not a proof, it says so.

The rule in one example

A task has a 60 s budget. Attempt 1 starts with an allowance of 60 s and fails after 25 s. Attempt 2 starts with 35 s and fails after 20 s. Attempt 3 starts with 15 s. If it is still running at 15 s it is stopped and the task ends with its whole budget used; if it succeeds earlier, the task ends there and what was held for the unused seconds goes back to the manager. Per-session caps would have allowed 60 + 60 + 60 s.

This is the arithmetic of the rule; forge test test_SharedBudget_60s_25_20_then15 runs exactly these numbers against the contract.

How time is measured

  • In this browser: Pyodide (CPython compiled to WebAssembly, served by this site) runs in a Web Worker. The clock starts when the script is handed to the loaded interpreter and stops when it ends; loading the interpreter is not counted. A timer equal to the allowance terminates the worker: that is the hard stop. It is wall-clock time on your device.
  • With the CLI: the script runs as a python3 process on the agent's machine, killed at the allowance. Time runs from spawning the process to its exit, so Python's start-up is included. That machine is not a sandbox.
  • On chain: the contract cannot observe either. It records what the named runner reports, cuts anything above the allowance, and keeps the order and the totals. A runner you do not trust can over-report up to the allowance; the cap is the most it can ever bill.

Roles and every power they have

WhoCanCannot
Manager (opens the task)set budget, price and runner at opening; change the runner or add budget while nothing runs; close the task (over a running attempt only after allowance + 1 h); withdraw refundslower the budget or price, take back what a finished attempt cost, report attempts (unless it named itself runner)
Runner (named by the manager)start the next attempt, report its duration, status and output hash, sign those reports for anyone to submit, withdraw earningsbill more than the allowance, report twice, change budget, price or runner, touch held ETH
Anyoneread every task, attempt and balance; submit a runner's signed report; re-hash an output fileanything else
Owner / admindoes not exist: no owner, admin, fee, pause or upgrade—

Limits the contract enforces

Budget per task
0.1 s to 7 days (100 to 604,800,000 ms); the manager may add more, never take it back
Price
0 to 1 ETH per second, fixed when the task opens
ETH held
holdFor = budget × price ÷ 1000, rounded up; exactly this value must be sent
Cost of an attempt
billed ms × price ÷ 1000, rounded down (so the costs always fit in what was held)
Attempts
one at a time, up to 1,000 per task
Allowance of an attempt
everything left when it starts; a report above it is cut to it and ends the task
Grace before a manager may close over a running attempt
the attempt's allowance (rounded up to seconds) + 1 hour
Label
up to 64 bytes, kept in the TaskOpened event only
Signed reports
EIP-712, domain NoctiqRetryBudget / 1 / chain id / contract; EOA keys, low-s only; a start signature carries a deadline

Refusal reasons

Every refusal is Rejected(bits). The check…() views return the same bits before anything is signed; the site shows them in plain words.

BitNameMeaning
0R_NO_TASKNo task with this number
1R_NOT_OPENThe task has ended
2R_NOT_RUNNEROnly the task's named runner can report attempts
3R_NOT_MANAGEROnly the task's manager can do this
4R_IN_FLIGHTAn attempt is still running
5R_NO_BUDGETNo budget left
6R_NOT_RUNNINGThat attempt is not the one running
7R_BAD_STATUSStatus must be failed, succeeded or stopped
8R_ZERO_RUNNERA runner address is required
9R_BUDGET_RANGEBudget must be between 0.1 s and 7 days
10R_PRICE_HIGHPrice above 1 ETH per second
11R_WRONG_VALUEThe ETH sent must equal the amount to hold exactly
12R_LABEL_LONGLabel longer than 64 bytes
13R_TOO_SOONThe running attempt still has time to report
14R_EXPIREDThe signed start has expired
15R_BAD_SIGThe signature is not a valid runner signature
16R_TOO_MANYThe task reached 1,000 attempts
17R_NOTHING_OWEDNothing to withdraw

Money

Native ETH only, and only when the price is above 0. Held ETH sits in the contract per task. A finished attempt moves its cost to the runner's balance; when the task ends (success, budget used up, or closed) the rest moves to the manager's balance. Balances leave only through withdraw(), to the account they belong to, guarded against re-entry. A balance that cannot be received (a contract that refuses ETH) stays claimable. Plain ETH transfers to the contract are refused.

The contract

NoctiqRetryBudget on Robinhood Chain: not deployed yet. Check that an address runs this exact build with npm run verify-deployment. Machine-readable: /api/proof, /api/abi. Agents: SDK and CLI.