Documentation Index
Fetch the complete documentation index at: https://docs.x0protocol.dev/llms.txt
Use this file to discover all available pages before exploring further.
Core Invariants
These invariants are enforced on-chain and must hold at all times. Violation of any invariant halts the transaction.1. Spend Limit Invariant (x0-guard)
Where:- is the set of spending entries within the rolling 24-hour window
- is the amount of each spending entry
- is the proposed transfer amount
- is the agent’s configured daily limit
2. Per-Transaction Limit Invariant
Where is the maximum single transaction amount (maxSingleTransaction).
Enforcement: Checked in the guard before every transfer. Error: SingleTransactionLimitExceeded (0x1141).
3. Reserve Invariant (x0-wrapper)
Where:- is the USDC balance held in the reserve account
- is the total outstanding x0-USD supply
ReserveInvariantViolated (0x1611).
Corollary: The redemption fee ensures the reserve is always slightly overcollateralized:
Where is the redemption fee in basis points.
4. Delegation Invariant (x0-guard)
The agent and owner must be different keys. Error:SelfDelegationNotAllowed (0x111A).
5. Bound Account Invariant (x0-guard)
The source token account must be owned by the policy owner. Error:TokenAccountOwnerMismatch (0x1119).
6. Escrow State Machine Invariant
The escrow state can only transition through valid paths:InvalidEscrowState (0x1109).
7. Confidential Amount Bound
All confidential transfer amounts must be representable in 48 bits. Error:AmountExceedsConfidentialMax (0x150F) or AmountTooLarge (0x1710).
8. Proof Freshness Invariant
ZK proof contexts expire after 5 minutes. Stale proofs cannot be used for transfers. Error:ProofExpired (0x1704).
9. Fee Bounds Invariant (x0-wrapper)
The wrapper redemption fee must stay within governance-defined bounds (0.1% to 5.0%). Errors:FeeRateTooLow (0x1625) or FeeRateTooHigh (0x1624).
10. Timelock Invariant (x0-wrapper)
Admin actions cannot be executed before the 48-hour timelock expires. Error:TimelockNotExpired (0x1643). Exception: emergency pause bypasses the timelock.
Derived Properties
These properties follow from the core invariants:| Property | Follows From | Implication |
|---|---|---|
| Maximum loss from compromised agent | Invariant 1 | At most can be spent in any 24-hour window |
| x0-USD is always redeemable | Invariant 3 | Every x0-USD in circulation is backed by at least 1 USDC |
| Agent cannot self-authorize | Invariant 4 | Agent always operates under owner’s delegated authority |
| Proofs are non-replayable | Invariant 8 | A proof context can only be used once within its 5-minute window |
| Governance changes are observable | Invariant 10 | Community has 48 hours to react to any admin action |