Roles & Components
1. Users
Users interact with the ERC-0 system to perform gasless transactions.
Key Responsibilities
- ETH/Token Commit: Deposit funds into the ERC-0 contract.
function commit() external payable {
// Lock ETH or tokens for off-chain use
}
- Off-Chain Transactions: Execute transfers, trades, or contract calls without paying gas.
- Disperse Request: Submit a
disperse()
call to finalize off-chain transactions on Ethereum.
2. Projects (DEX, Launchpad, Authorized Entities)
dApps or services connected to the ERC-0 contract.
Use Cases
- A DEX allows users to trade tokens off-chain.
- A Token Launchpad processes token sales without on-chain gas costs.
Project Responsibilities
- Validate user transactions.
- Submit
disperse()
requests with ZK-proofs to Ethereum.
3. Off-Chain Validators (Bundlers)
Entities that collect, batch, and submit transactions to Ethereum.
Core Functions
-
Manage UserOperations Mempool
- Aggregate transactions.
- Filter invalid operations (e.g., incorrect nonce, insufficient balance).
-
Generate ZK-Proofs
zk_proof = generate_proof(batch_transactions, previous_state, new_state)
- Submit Disperse to Ethereum
function disperse(bytes calldata zkProof) external {
require(verifyProof(zkProof), "Invalid proof");
_updateBalances();
}
4. ERC-0 Main Contract
The central smart contract deployed on Ethereum mainnet.
Key Functions
commit()
→ Lock user funds.disperse()
→ Finalize off-chain transactions on Ethereum.verifyProof()
→ Validate ZK-proofs.
Storage Structure
Variable | Type | Description |
---|---|---|
balances | mapping(address => uint256) | User balances |
stateRoot | bytes32 | Latest verified state hash |
nonces | mapping(address => uint256) | Prevents replay attacks |
5. ZK-Proof Mechanism
Ensures off-chain transactions are valid without revealing details.
How It Works
- User transactions are stored off-chain.
- Validators generate a ZK-proof for the batch.
- The proof is submitted to Ethereum and verified by the ERC-0 contract.
- If valid, balances are updated on-chain.
✅ Advantages
- ✔ Reduces Gas Costs → Only proof verification happens on-chain.
- ✔ Instant Finality → No 7-day delay like Optimistic Rollups.
- ✔ Security & Privacy → Validity is proven without exposing transaction data.