Mental model
Layer-2 rollups scale blockchains by decoupling Execution from Data Availability and Settlement. Rollups execute thousands of transactions off-chain and post compressed transaction data or state diffs to L1 for global consensus verification.
Theory
Rollup architecture components:
- Optimistic Rollups (Arbitrum, OP Stack): Assume transactions are valid; enforce a 7-day challenge window for fraud proof submission.
- ZK-Rollups (zkSync, Scroll, Starknet): Submit cryptographic ZK-SNARK/STARK validity proofs with every batch, enabling instant L1 finality upon proof verification.
- Data Availability (DA): Ephemeral EIP-4844 blobs prune after ~18 days, dramatically reducing L2 costs. Modular DA (Celestia, EigenDA) provides dedicated data sampling layers.
Alternatives and trade-offs
- Centralized Infrastructure: High performance and zero protocol overhead, but vulnerable to single-point-of-failure outages, vendor lock-in, and centralized censorship.
- Decentralized Verifiable Infrastructure: Provides cryptographic guarantees, data immutability, and zero-trust execution, but introduces computational prover overhead and consensus latency.
Failure modes and misconceptions
- Semantic Truth vs Computational Integrity: Misinterpreting a ZK execution proof as proof that an AI model's output is real-world factually true (it proves execution integrity $M(X)=Y$, not semantic correctness).
- Unrestricted Private Key Delegation: Giving an autonomous AI agent direct access to un-constrained private keys without a Policy Engine or Smart Account rules.
Decision scenario
Adopt verifiable decentralized infrastructure when building autonomous financial agents, multi-party data mesh collaborations, or mission-critical AI systems where execution auditability, asset safety, and cryptographic provenance are mandatory.
Learning outcomes
- Architect end-to-end blockchain transaction lifecycles from signature generation to state finality.
- Implement smart contract security patterns to defend against reentrancy, oracle manipulation, and delegatecall risks.
- Design verifiable AI agent pipelines leveraging ZK proofs, zkVMs, Account Abstraction, and Policy Engines.
Trade-offs
Verifiable blockchain infrastructure guarantees asset safety and execution integrity, but requires disciplined contract auditing, gas optimization, and policy-bounded agent sandboxing.