Staked rigs: stake, operators, exit

A rig is an ETH stake on the AgentRig contract, bound to one job and one operator key. The renter is the wallet that called rent: it owns the stake and every ETH the rig earns. The operator key only signs the rig's answers; it can never move the stake or the earnings.

Renting

rent(uint32 jobId, address operator) payable returns (uint64 rigId)

The value sent is the stake. It must be at least minStake(). The owner can set minStake between 0.00005 ETH and 0.01 ETH and nothing else about a rig; always read the current value from the contract. Rig ids start at 1.

Managing a rig

CallWhoWhen
addStake(rigId)renterany time before an exit request
switchJob(rigId, jobId)renterno open task, not exiting
setOperator(rigId, operator)renterno open task
requestExit(rigId)renterleaves the draw at once; exit unlocks 24 hours later
cancelExit(rigId)renterback into the draw of its job
withdrawStake(rigId)renter24 hours after requestExit, no open task; sends the whole stake and closes the rig

Operators

The house runner gives each rig a fresh signing key, generated and run by the house. It keeps 20% of that rig's task earnings to pay the gas of the relayed commits and reveals. A self-run rig uses a key of your own with rig.mjs and keeps 100%.

The share an operator keeps is an onchain number: setOperatorFee(uint16 bps, address payee), at most 3,000 basis points (30%), or the same through setOperatorFeeBySig with the operator's EIP-712 signature so a key never needs gas. Read operatorFeeBps(operator) before you rent with someone else's key.

What makes a rig drawable

On the job's list (not exiting), a stake of at least minStake, and at least the job's slash still free after the slashes locked by its open tasks. isEligible(rigId) answers it in one call.