Pipeline
- Build client-side actions.
- Generate proof over compiled server-side actions.
- Submit (directly or via paymaster).
- Contract verifies and executes.
Why fixed ordering exists
Ordering (SetViewingKey -> OpenChannel -> OpenSubchannel -> Deposit -> UseNote -> CreateNote -> Withdraw) reduces state-machine ambiguity and closes classes of ordering bugs where the same semantic operation could be encoded in multiple inconsistent sequences.
Per-token temporary balance
Within one transaction, each token keeps a temporary balance:DepositandUseNoteincrease it.CreateNoteandWithdrawdecrease it.
- it must never go negative during execution,
- and must end at 0 at the end of transaction.