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 -> Invoke) reduces state-machine ambiguity and closes classes of ordering bugs where the same semantic operation could be encoded in multiple inconsistent sequences.
The final Invoke phase holds at most one external call per transaction: either InvokeExternal or ComputeAndInvoke (see Shadow accounts).
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.