
The four guarantees
Every one of these is enforced on chain, not by the co-signer:Per-pull cap
perPullMax bounds a single pull. This is the real subscription guarantee: even a
misbehaving co-signer cannot drain the cumulative cap in one call.Interval
interval seconds must pass between pulls. A merchant that tries to charge twice
in a month reverts with TooSoon.Cumulative cap
maxAmount is the most the box will ever pay out in its lifetime, across all
pulls. It cannot be raised.Expiry
After
expiry no outbound payment is possible at all, whatever the co-signer
signs.Set
perPullMax to the per-period amount, not to the total. A 5 USDC monthly
subscription over a year is maxAmount: 60 USDC, perPullMax: 5 USDC, interval: 30 days. Leaving perPullMax at 0 means “no tighter cap than maxAmount”,
which is legal and gives away the guarantee that matters most.Creating one
Pulling
The merchant (or a relayer on their behalf) asks the co-signer to authorize, then submits. The payer signs nothing, and is not required to be online.action is ACTION_PULL (1), not ACTION_PAY (0), and the two are separate
fields in the EIP-712 struct. That is deliberate: a pay authorization can never be
replayed as a pull, or the reverse.

Reading its state
Everything a UI needs is a getter, so nothing depends on replaying events:remaining is what is left of the cumulative cap, spent is what has gone out,
and nonce counts settled spends. There is deliberately no owner and no vault
getter, so a merchant reading the box they are paid from learns nothing about who
funded it.

Cancelling
Sweep it. There is no separate revoke, because a box with no balance cannot pay anyone.Both sweeps require
msg.sender == vault. Bind the box to an address you can
transact from. For a stealth subscription that address is the stealth address, so
you sweep by deriving its key: see Stealth boxes.Agent wallets
The same shape, pointed at software instead of a merchant. Hand an agent a tightly-scoped PULL box and it transacts autonomously inside a policy it cannot exceed, because the caps are on chain and the co-signer vetoes anything outside them. The keeper in this repository is exactly that, and it pays its own gas from a PULL box whose target is itself. See The keeper.Next
- Make the box unattributable: Stealth boxes.
- The veto that gates every pull: The co-signer.
- The model: Payer-side shield.