Master Account
The Master Account serves as the single source of truth for:
- Asset custody: Holds all deposited funds in the shielded pool
- Commitment tree: Maintains the Merkle tree of all note commitments
- Proof verification: Validates zk-SNARK proofs for operations
- Operation execution: Processes user actions via App Accounts
Core Functions
1. Deposit Assets
Entry point: depositAssets(Deposit[] calldata deposits)
Who calls this: The Deposit Manager (after screening is complete)
What happens:
- Validates each deposit
- Transfers assets from Deposit Manager to Master Account
- Computes note commitments:
- Inserts commitments into the Merkle tree
2. Transact (Bundle Processing)
Entry point: transact(Operation[] calldata ops)
Who calls this: Bundlers (permissionless actors submitting batches)
What happens:
Phase 1: Validation
For each operation in the bundle:
- Check that nullifiers haven't been spent
- Ensure stealth addresses or tokens aren't blacklisted
Phase 2: Proof Extraction and Verification
- Extract zk-SNARK proofs and public inputs from all operations
- Verify proofs through Verifier contract
- If verification fails: Entire bundle reverts (no partial execution).
Phase 3: Execution
For each operation:
- Process JoinSplits
- Consume input notes
- Create output notes
- Transfer assets to app accounts (if net difference ≠ 0)
- Send funds to Executor
- Execute user-defined actions via the delegated
AppAccount
- Execute user-defined actions via the delegated