Stake from the command line
You are backing an operator you trust with ZAI, from a shell. Their listings are paid in USDC
every time an agent buys from them, a share of every settlement goes to the stake behind the node,
and if a dispute finds they cheated, part of that stake is slashed and your part shrinks with it.
The CLI signs every transaction with the key in AIOUM_PRIVATE_KEY, on your machine: two to
stake, one for each later action.
What you need
-
The CLI, built, with the stack running.
-
AIOUM_PRIVATE_KEY: a wallet with ZAI and a little gas on the network indeployments.json. On the local development network use Anvil account 1, which the deploy funds with 100,000 ZAI:export AIOUM_PRIVATE_KEY=0x59c6995e998f97a5a0044966f0945389dc9e86dae88c7a8412f4603b6b78690d--key <hex>on any command stands in for it once. The key never leaves your machine and is never printed. -
AIOUM_DEPLOYMENTSpointing at the network'sdeployments.json, so the CLI knows the staking and jury contracts. -
Nothing is spent by staking. Staked ZAI is locked, not spent: it stays yours.
Steps
-
See who there is to back.
npx aioum stake operatorsOne row per operator from the index, most staked first: the address, the stake in ZAI, whether they are live, how many listings they have and their categories (
--jsonadds each listing's id and price per call). Pick one that is live, well staked and whose services agents use. -
Check what your wallet holds.
npx aioum walletUnder
you: your address and its ZAI, USDC and ETH. Above it, underrunner, the wallet that pays for agents. -
Stake. This signs two transactions.
npx aioum stake delegate <operator> 1000The amount is ZAI, as a decimal. The CLI first approves the staking contract for that much (skipped when an earlier approval still covers it), then delegates, and prints the operator, the amount and both transaction hashes, approve and delegate, each on its own line. Rewards accrue from the operator's next settlement.
-
See your positions.
npx aioum stake positionsYour address, the network's minimum node stake and the unbonding period in seconds, then one row per operator you back: your stake in ZAI, what is claimable in USDC, and the operator's total stake. Claimable grows with every settlement the operator's listings receive; run it again whenever you like.
-
Collect. One transaction.
npx aioum stake claim <operator>It prints the operator and the transaction hash. The USDC is in your wallet; your ZAI stays staked and keeps earning.
-
Leave. One transaction.
npx aioum stake unstake <operator> 1000It prints the operator, the amount and the transaction hash. The cooldown starts, and any reward still pending is settled into your claimable balance at the same moment, so leaving forfeits nothing.
-
Wait out the cooldown, the unbonding period from step 4 (7 days as the deploy sets it). On the local development network, move the chain forward instead of waiting:
cast rpc evm_increaseTime 604800 --rpc-url http://127.0.0.1:8545 cast rpc evm_mine --rpc-url http://127.0.0.1:8545 -
Withdraw. One transaction.
npx aioum stake withdraw <operator>It prints the operator and the transaction hash; the ZAI is back in your wallet.
The same wallet can also sit on the jury, where ZAI earns a second way. Disputes between an agent and an operator are decided by staked jurors: votes are sealed during a commit window, opened during a reveal window, and the weighted result slashes the operator or forfeits the agent's bond.
-
Read the jury's terms and your seat.
npx aioum jury statusThe minimum arbitrator stake and the quorum in ZAI, the commit and reveal periods in seconds, then, under
you, your address, your stake (0 before you join) and until when it is locked. -
Take a seat. Two transactions, approve and stake, for at least the minimum from step 9.
npx aioum jury join 5000It prints the amount and the two transaction hashes. Your ZAI is now the weight of your vote.
-
See the cases.
npx aioum jury casesThe newest fifty disputes (
--limitfor more), one row each: the dispute id, the status (open,upheld,rejectedortimed out), the operator, the bond in USDC, the commit and reveal deadlines, the weight revealed for and against fault, whether it is resolved, and underyouwhat you have done on it:committed,revealed,salt saved.--jsonadds the session, the client, when it was raised, the committed weight and the evidence URI. Read the evidence, then decide: was the operator at fault? -
Seal your vote. One transaction.
npx aioum jury commit <disputeId> operator-at-faultnot-at-faultis the other word. The CLI draws a random salt, saves it in~/.aioum/jury-salts.jsonunder the chain id and dispute id, asks the contract for the commitment of your vote with that salt, and sends it; it prints the dispute id, your vote, the transaction hash andsalt saved inwith the store's path. From now until you reveal, your stake is locked:jury leaveis refused. -
Copy the salt file somewhere safe, now, before the commit window closes.
npx aioum jury salts export ./jury-salts.jsonIt answers
wrote <file>: N sealed vote(s); the copy has mode0600. The salt is the only way to open a sealed vote, and a vote that is never revealed costs you 20% of the weight you committed.npx aioum jury salts import <file>merges a copy back, on this machine or another, and says how many entries it added and how many were already there; an entry already here with a different salt is kept and reported. -
After the commit deadline, open your vote. One transaction.
npx aioum jury reveal <disputeId>The CLI reads the salt from the store and prints the dispute id, the vote it revealed and the transaction hash. Without the salt it stops with
no sealed vote for dispute #<id> in this salt store; restore the backup you exported when you committed. -
After the reveal deadline, close the case. Anyone may; one transaction.
npx aioum jury finalize <disputeId>It succeeds when the revealed weight reached the quorum and one side has a strict majority, and prints the transaction hash; the decision goes to the dispute manager, which slashes the operator or forfeits the client's bond. When the quorum failed or the vote tied it fails with
no quorum, and only the DAO owner can settle it, signing with the owner's key:npx aioum jury escalate <disputeId> operator-at-fault(ornot-at-fault). -
Collect your reward, when you revealed on the winning side. One transaction.
npx aioum jury reward <disputeId>It prints the transaction hash. Your share of the case's reward, split among the winning side's revealers in proportion to committed weight, lands in your wallet.
-
Leave the jury when you want your ZAI back: one transaction to start, one after the cooldown.
npx aioum jury leave 5000It is refused while a vote of yours is sealed and unrevealed. Once the lock that
jury statusshows has passed,npx aioum jury withdrawreturns the ZAI to your wallet, and prints the transaction hash.
What you have now
A position behind an operator you chose: a share of every USDC settlement their listings receive, claimable whenever you like, at risk only if they lose a dispute, returned through an unstake and a cooldown when you leave. And a seat on the jury that decides those disputes, every sealed vote's salt on your disk with a copy somewhere safe, so nothing you commit is lost.
Next: Sell from the command line — a template or a spec file of your own, one preview call, one command to go live.