Curriculum overview
The FHEVM Bootcamp is a comprehensive, hands-on training program consisting of 20 modules organized into a 4-week progressive curriculum. Each module includes lecture content, code examples, hands-on exercises, and assessments.Program structure
Total duration: ~63 hours (~16 hours/week over 4 weeks)| Week | Theme | Modules | Hours | Milestone |
|---|---|---|---|---|
| Week 1 | Foundation & operations | 00-04 | ~12h | Encrypted Calculator homework |
| Week 2 | Core patterns | 05-09 | ~14h | Encrypted Vault homework |
| Week 3 | Applications & testing | 10-14 | ~18h | Token + Voting homework |
| Week 4 | Mastery & capstone | 15-19 | ~19h | Capstone DAO project |
Assessment system
The bootcamp uses a comprehensive assessment framework:| Component | Weight | Description |
|---|---|---|
| Quizzes | 20% | End-of-module knowledge checks (multiple choice + short answer) |
| Exercises | 40% | Hands-on coding graded on correctness (50%), code quality (25%), and security (25%) |
| Capstone project | 40% | Original FHE application with contracts, tests, documentation, and presentation |
Passing requirements
- Overall score of 70% or higher
- Minimum 60% in each component
- Capstone must compile, deploy, and pass all provided test cases
Grading scale
| Grade | Range |
|---|---|
| Distinction | 90-100% |
| Merit | 80-89% |
| Pass | 70-79% |
| Fail | Below 70% |
Module breakdown
Week 1: Foundation & operations
Module 00: Prerequisites & Solidity review (2 hours)
Module 00: Prerequisites & Solidity review (2 hours)
- Write basic Solidity contracts using mappings, structs, modifiers, and events
- Compile and deploy contracts using Hardhat
- Explain why public blockchains leak information
- Describe encryption types at a high level
- Set up a working Node.js development environment
SimpleStorage.sol, BasicToken.solModule 01: Introduction to FHE (2 hours)
Module 01: Introduction to FHE (2 hours)
- Explain what “fully homomorphic” means
- Identify core FHE schemes (BGV, BFV, CKKS, TFHE) and trade-offs
- Articulate why FHE solves problems that ZK proofs and TEEs cannot
- Describe the noise budget concept
- Explain fhEVM architecture at a high level
Module 02: Development setup (2 hours)
Module 02: Development setup (2 hours)
- Set up Hardhat with the fhEVM plugin
- Diagram the fhEVM architecture (coprocessor, gateway, on-chain components)
- Explain the role of the global FHE key and ACL system
- Deploy and interact with an encrypted contract
- Describe the lifecycle of an encrypted transaction
ZamaEthereumConfig, Relayer SDKContract: HelloFHEVM.solModule 03: Encrypted types (3 hours)
Module 03: Encrypted types (3 hours)
ebool to euint256 and eaddress. Learn type fundamentals, casting, and storage patterns.Learning objectives:- List all encrypted types and their plaintext equivalents
- Declare and initialize encrypted state variables
- Cast between encrypted types using
FHE.asEuintXX() - Explain overflow/wrapping behavior
- Choose the appropriate encrypted type for use cases
EncryptedTypes.sol, TypeConversions.solModule 04: Operations (arithmetic, bitwise, comparison) (3 hours)
Module 04: Operations (arithmetic, bitwise, comparison) (3 hours)
- Perform arithmetic operations (
FHE.add,sub,mul,div,rem) - Apply bitwise and shift operations
- Use all comparison operators (return
ebool) - Use
FHE.min,FHE.max, andFHE.neg - Mix encrypted and plaintext operands
ArithmeticOps.sol, BitwiseOps.sol, ComparisonOps.solWeek 2: Core patterns
Module 05: Access control / ACL (3 hours)
Module 05: Access control / ACL (3 hours)
- Explain why ACLs are necessary
- Use
FHE.allow()andFHE.allowThis()for persistent permissions - Use
FHE.allowTransient()for temporary access - Design correct permission flows for multi-party interactions
- Debug common ACL errors
ACLDemo.sol, MultiUserVault.solModule 06: Encrypted inputs & proofs (3 hours)
Module 06: Encrypted inputs & proofs (3 hours)
externalEuintXX types.Learning objectives:- Encrypt values client-side using Relayer SDK
- Receive and convert inputs using
FHE.fromExternal(value, proof) - Implement input validation for encrypted values
- Handle multiple encrypted inputs
- Explain security properties of input encryption
externalEuintXX types, FHE.fromExternal(), ZKP proofs, input validationContract: SecureInput.solModule 07: Decryption patterns (3 hours)
Module 07: Decryption patterns (3 hours)
FHE.makePubliclyDecryptable() and user-specific decryption.Learning objectives:- Use
FHE.makePubliclyDecryptable()for on-chain reveal - Use ACL +
instance.userDecrypt()for user-specific decryption - Understand the deprecated Gateway callback pattern (historical context)
- Evaluate privacy implications of decryption strategies
- Design contracts that minimize unnecessary decryption
PublicDecrypt.sol, UserDecrypt.solModule 08: Conditional logic / FHE.select (3 hours)
Module 08: Conditional logic / FHE.select (3 hours)
FHE.select() as an encrypted ternary operator.Learning objectives:- Use
FHE.select(ebool, valueIfTrue, valueIfFalse)for conditionals - Combine encrypted booleans with
FHE.and,or,xor,not - Refactor branching logic into branchless patterns
- Implement multi-condition encrypted logic chains
- Apply the “compute both paths, select the result” pattern
if doesn’t work on encrypted values, FHE.select pattern, boolean logic, nested selects, refactoring guideContracts: ConditionalDemo.sol, EncryptedMinMax.solModule 09: On-chain randomness (2 hours)
Module 09: On-chain randomness (2 hours)
- Generate encrypted random numbers using
FHE.randEuintXX() - Explain security properties (unpredictability, privacy)
- Use encrypted randomness in gaming, lotteries, random selection
- Apply range reduction techniques
- Identify common pitfalls
FHE.randEuintXX(), FHE.randEbool(), security model, range reduction, use cases, best practicesContracts: RandomDemo.sol, EncryptedLottery.solWeek 3: Applications & testing
Module 10: Frontend integration (3 hours)
Module 10: Frontend integration (3 hours)
- Initialize the Relayer SDK and connect to fhEVM network
- Encrypt user inputs and submit as
externalEuintXXparameters - Request and process re-encrypted outputs
- Build a complete React frontend
- Handle wallet connection and encrypted state display
SimpleCounter.solModule 11: Confidential ERC-20 (4 hours)
Module 11: Confidential ERC-20 (4 hours)
- Implement encrypted ERC-20 with confidential balances
- Handle “sufficient balance” check using
FHE.ge()andFHE.select - Manage ACL permissions across transfers and approvals
- Implement encrypted
approveandtransferFrom - Add selective balance viewing via ACL + client-side decryption
externalEuint64, encrypted transfers, silent fail pattern, approvals, ACL managementContract: ConfidentialERC20.solModule 12: Confidential voting (4 hours)
Module 12: Confidential voting (4 hours)
- Design a confidential voting protocol
- Implement encrypted vote submission via
externalEuint32 - Perform homomorphic tallying using
FHE.add - Handle tally reveal using Gateway decryption
- Prevent common voting attacks
ConfidentialVoting.sol, PrivateVoting.solModule 13: Sealed-bid auction (4 hours)
Module 13: Sealed-bid auction (4 hours)
- Design a sealed-bid auction protocol
- Implement encrypted bid submission via
externalEuint64 - Perform encrypted bid comparison using
FHE.gtandFHE.select - Implement first-price and Vickrey auction variants
- Analyze security properties and limitations
SealedBidAuction.sol, RevealableAuction.sol, EncryptedMarketplace.solModule 14: Testing & debugging FHE contracts (3 hours)
Module 14: Testing & debugging FHE contracts (3 hours)
- Set up fhEVM mock testing
- Write comprehensive tests with encrypted input creation and decryption assertions
- Debug encrypted contracts with silent failures
- Handle and diagnose silent failures from
FHE.selectlogic - Test ACL permissions
TestableVault.solWeek 4: Mastery & capstone
Module 15: Gas optimization for FHE (3 hours)
Module 15: Gas optimization for FHE (3 hours)
- Understand the FHE gas cost model
- Optimize type selection to reduce costs
- Use plaintext second operands for cheaper computation
- Apply batch processing and caching patterns
- Profile and benchmark gas usage
GasOptimized.sol, GasBenchmark.solModule 16: Security best practices for FHE (3 hours)
Module 16: Security best practices for FHE (3 hours)
- Prevent information leakage via gas side-channels
- Implement proper ACL management
- Validate encrypted inputs
- Protect against DoS attacks
- Implement the LastError pattern
FHE.isInitialized(), ACL security, input validation, rate limiting, LastError patternContracts: SecurityPatterns.sol, VulnerableDemo.solModule 17: Advanced FHE design patterns (4 hours)
Module 17: Advanced FHE design patterns (4 hours)
- Implement encrypted state machines with threshold transitions
- Apply the LastError pattern for rich error handling
- Build encrypted registries for per-user private data
- Design cross-contract composability using
FHE.allow - Implement batch processing and time-locked value patterns
EncryptedStateMachine.sol, LastErrorPattern.sol, EncryptedRegistry.solModule 18: Confidential DeFi (4 hours)
Module 18: Confidential DeFi (4 hours)
- Design a confidential lending protocol with encrypted collateral
- Build an encrypted order book with sealed orders
- Analyze DeFi privacy trade-offs
- Implement front-running prevention
- Describe the ERC-7984 standard
ConfidentialLending.sol, EncryptedOrderBook.solModule 19: Capstone - Confidential DAO (5 hours)
Module 19: Capstone - Confidential DAO (5 hours)
- Independently design an FHE application architecture
- Implement a Confidential DAO with encrypted governance and private treasury
- Integrate multiple FHE patterns from all previous modules
- Write comprehensive tests
- Apply security best practices and gas optimization
- Document security model and limitations
ConfidentialDAO.solDeliverables:- Smart contracts (30%)
- Test suite (20%)
- Documentation (20%)
- Security analysis (15%)
- Presentation (15%)
Module dependency graph
Learning paths
Choose the pacing that fits your schedule:4-week bootcamp (recommended)
Intensive (7 days)
Part-time (6 weeks)
Self-paced (8-14 weeks)
Resources
Each module is supported by comprehensive resources:- Lesson content — Detailed explanations with code examples
- Presentation slides — Marp format slides for each module
- Hands-on exercises — Starter templates in
exercises/ - Complete solutions — Reference implementations in
solutions/ - Quizzes — 215 questions across 20 modules
- Cheatsheet — Quick reference for FHE operations
- Common pitfalls — Mistakes to avoid and how to fix them
- Gas guide — Gas cost reference for all operations
- Security checklist — Audit checklist for FHE contracts
- Glossary — A-Z terminology