COURSE · CY5

Blockchain and Decentralized Cryptographic Systems

בלוקצ'יין ומערכות קריפטוגרפיות מבוזרות

consensus under adversarial failure, smart-contract security, and decentralized trust

Building and securing blockchains, smart contracts, and DeFi.

Year 313 weeks2h lecture + 2h practiceProject-based

About this course

Study distributed ledgers, consensus, and smart contracts, and the security properties and limits of decentralized systems.

Course format. Thirteen weeks, four contact hours each: a two-hour lecture (concepts and theory) and a two-hour practice session. The course is project-based; teams carry one running project end to end and present it three times, in weeks 5, 8, and 13.
What you will build

Built a minimal but complete decentralized system, layering a simplified PBFT agreement module, Merkle-backed block integrity, proof-of-work mining, deployed Solidity contracts, ERC-20 or ERC-721 token flows, an IPFS-backed DApp interface, a hierarchical deterministic multi-signature wallet, and an automated market maker, then audited and hardened it against reentrancy, oracle, and flash-loan attacks.

HIT catalogue documents

Download the Word package prepared for the institutional catalogue process.

Expected outcomes

  • Explain Byzantine fault tolerance, the two-generals problem, and the safety-vs-liveness trade-off in distributed consensus; compare Proof of Work and Proof of Stake security arguments including hashrate, validator staking, slashing conditions, and Nakamoto probabilistic finality.
  • Construct Merkle tree proofs of inclusion and analyze the EVM execution model: opcode gas table, EIP-1559 base fee burn, stack-based execution, and ABI encoding for UUPS and Transparent proxy patterns.
  • Write, deploy, and test Solidity smart contracts on Ethereum testnets using Hardhat and Remix IDE, applying OpenZeppelin Contracts for upgradeable and access-controlled architectures with Ganache for local chain development.
  • Identify and exploit smart contract vulnerability classes (reentrancy, integer overflow, access control, tx.origin misuse) using Slither static analysis and manual audit, and produce structured findings reports with proof-of-concept exploits verified on Etherscan.
  • Analyze DeFi primitives including constant-product AMMs (x*y=k), collateralized lending and liquidation mechanics, and flash loan atomicity; assess price oracle manipulation via Chainlink feed analysis and cross-chain bridge trust models.
  • Derive BIP-32/39/44 HD wallet key hierarchies using ethers.js, manage keys with MetaMask, and evaluate zero-knowledge proof systems (Groth16 zk-SNARK, zk-STARK) for on-chain privacy and proof generation vs verification cost trade-offs.

Key topics

  • Consensus mechanisms
  • Smart contracts
  • Wallets & key management
  • DeFi security

Theoretical foundations

The concepts and results this course rests on.

  • distributed ledger and Byzantine fault tolerance: two-generals problem, BFT assumptions, and the safety vs liveness trade-off
  • Proof of Work vs Proof of Stake: hashrate mining, validator staking, slashing conditions, and Nakamoto probabilistic finality
  • Merkle trees and cryptographic integrity: Merkle root construction, proof of inclusion, and tamper-evident block headers
  • EVM execution model and gas economics: opcode gas table, EIP-1559 base fee burn, stack-based execution, and gas limit
  • smart contract programming model: storage slots, calldata vs memory, ABI encoding, proxy patterns (UUPS, Transparent)
  • common smart contract vulnerabilities: reentrancy (checks-effects-interactions), integer overflow, access control, and tx.origin misuse
  • DeFi primitives: constant-product AMM (x*y=k), collateralized lending and liquidation mechanics, and flash loan atomicity
  • wallet security and HD key derivation: BIP-32 hierarchical paths, BIP-39 mnemonic entropy, and BIP-44 account levels
  • zero-knowledge proofs on-chain: zk-SNARK (Groth16), zk-STARK, proof generation vs verification cost, and privacy use cases
  • cross-chain bridges and oracle security: price oracle manipulation attacks, bridge trust models, and decentralized proof-of-reserve mechanisms

Prerequisites

This is a Year-3 course. It assumes the mandatory CS core: data structures and algorithms, operating systems, computer networks, databases, software engineering, and the core mathematics (linear algebra, probability and statistics, calculus, discrete mathematics). It additionally requires the specific prior courses listed below.

Course-specific prerequisites:

  • Cryptography fundamentals
  • Distributed systems and computer networks

Weekly schedule 13 weeks · lecture + practice

Foundations
Wk 1
Byzantine fault tolerance and consensus
LectureCover the two-generals problem, BFT assumptions, and the safety vs liveness trade-off; compare Proof of Work hashrate security and Proof of Stake staking, slashing, and Nakamoto finality (P1, P2).
PracticeSet up a local Ethereum chain with Ganache; observe block production, transaction ordering, and fork behavior under simulated conditions.
ProjectSet up the project repository and DeFi protocol design specification with consensus assumptions documented.
Wk 2
Merkle trees and cryptographic block integrity
LectureExplain Merkle root construction, proofs of inclusion, and tamper-evident block headers as the cryptographic backbone of distributed ledgers (P3).
PracticeWrite Hardhat scripts to inspect block and transaction Merkle structure; construct and verify Merkle inclusion proofs programmatically.
ProjectMerkle-backed integrity layer for the project's block data.
EVM and contracts
Wk 3
EVM execution model and gas economics
LectureExplain the EVM opcode gas table, EIP-1559 base fee burn, stack-based execution, and gas limit as the execution budget (P4).
PracticeUse Remix IDE to inspect EVM bytecode and measure opcode gas costs; analyze gas usage of live transactions on Etherscan.
ProjectGas-optimized architecture design for the DeFi protocol contracts.
Wk 4
Smart contract programming model and proxy patterns
LectureCover storage slots, calldata vs memory, ABI encoding, and UUPS and Transparent proxy upgrade patterns (P5).
PracticeImplement and deploy an upgradeable UUPS proxy in Solidity using OpenZeppelin Contracts; test upgrade logic with Hardhat on Ganache.
ProjectCore smart contract suite with OpenZeppelin proxy and access-control architecture deployed locally.
Wk 5
Design specification and security modelPresentation
LectureReview smart contract audit methodology and common vulnerability class overview (P6); discuss DeFi threat model framing.
PracticeTeam presentation: each team defends project architecture, proxy design, consensus assumptions, and threat model.
ProjectFreeze project specification, contract design, and threat model document.
Security
Wk 6
Smart contract vulnerabilities
LectureAnalyze reentrancy (checks-effects-interactions), integer overflow, access control flaws, and tx.origin misuse with real exploit case studies (P6).
PracticeRun Slither static analysis on the project contracts; exploit a reentrancy vulnerability in a Ganache sandbox and document the proof of concept.
ProjectSlither audit report with identified vulnerability classes and planned fixes.
Wk 7
DeFi primitives and AMM design
LectureExplain constant-product AMM (x*y=k), collateralized lending and liquidation mechanics, and flash loan atomicity (P7).
PracticeDeploy a simplified AMM contract with Hardhat; use ethers.js to simulate swap and liquidity provision operations against the local Ganache chain.
ProjectDeFi protocol core business logic: lending or AMM contract deployed and functional.
Wk 8
Contract suite and test coveragePresentation
LectureCover property-based and invariant testing patterns with Hardhat; OpenZeppelin security best practices and access-control patterns.
PracticeTeam presentation: demo deployed contracts with Hardhat unit tests, Slither results, and at least one documented vulnerability fix.
ProjectPresent interim contract suite with test coverage report and Slither findings.
Wallets and ZK
Wk 9
HD wallets and key derivation
LecturePresent BIP-32 hierarchical derivation paths, BIP-39 mnemonic entropy, and BIP-44 account-level structure for wallet security (P8).
PracticeDerive an HD wallet key hierarchy with ethers.js; integrate MetaMask for DApp front-end transaction signing on the Ethereum testnet.
Projectethers.js front-end integration with HD wallet key derivation and MetaMask signing on an Ethereum testnet.
Wk 10
Zero-knowledge proofs on-chain
LectureIntroduce zk-SNARK (Groth16), zk-STARK, proof generation vs verification cost trade-offs, and on-chain privacy use cases (P9).
PracticeIntegrate an OpenZeppelin Contracts-compatible Groth16 verifier; deploy and test ZK proof verification in a Hardhat environment.
ProjectZK verifier or privacy component integrated with the DeFi protocol.
Oracles and audit
Wk 11
Cross-chain bridges and oracle security
LectureCover price oracle manipulation attacks, bridge trust models, and decentralized proof-of-reserve mechanisms (P10).
PracticeIntegrate a Chainlink price feed in Hardhat; simulate oracle manipulation to demonstrate front-running and price manipulation risk.
ProjectOracle integration for the DeFi protocol with manipulation-resistant design documented.
Wk 12
Full audit and hardening
LecturePresent the manual audit methodology: severity ratings, proof-of-concept exploits, fix verification in reaudit engagements, and economic security assessment for DeFi.
PracticeComprehensive Slither pass on all contracts; review deployed bytecode on Etherscan; Hardhat invariant test suite for AMM and lending invariants.
ProjectComplete Hardhat unit and invariant test suite; Slither report; manual audit targeting at least three vulnerability classes.
Capstone
Wk 13
Final system and audit defensePresentation
LectureSynthesize the full stack from consensus and Merkle integrity through EVM contracts, DeFi primitives, ZK proofs, and oracle security.
PracticeTeam presentation: live demo on Ethereum testnet, full audit report walkthrough, and oral defense of design choices.
ProjectDeliver the complete DeFi protocol with Hardhat tests, Slither audit, ethers.js front-end on testnet, and structured audit report.
AI tools in this course.

Students use AI assistants throughout the decentralized-system build: scaffolding and refactoring Solidity contracts, DApp clients, token flows, IPFS metadata handling, and the off-chain ledger code, generating Foundry and Echidna test suites and invariants, and explaining Slither static-analysis output. They vibe-code exploit proofs of concept, prompting the assistant to write a reentrancy, oracle-manipulation, or flash-loan attack against their own AMM and then to propose the checks-effects-interactions fix or an oracle hardening strategy. AI helps interpret EVM traces in Tenderly, derive HD-wallet and multi-signature logic, compare ethers.js and Web3.js calls, and turn an audit pass into a structured findings report, and students drive deployment tooling and wallet libraries through it, but they re-run every AI-proposed fix through the fuzzer and on-chain tests, because a contract that merely looks safe can still lose funds.

Student project

Teams design, implement, test, and audit a DeFi protocol in Solidity: a simplified lending or AMM protocol with core business logic, a comprehensive Hardhat test suite covering unit and invariant tests, Slither static analysis, a manual audit targeting at least three vulnerability classes with proof-of-concept exploits, and a front-end integration with ethers.js deployed on an Ethereum testnet.

Requirements

  • Build a working system, not a set of disconnected exercises.
  • Be original: a new system that solves a real problem, not a re-implementation of a tutorial or course demo.
  • Show real depth: real data, real users or realistic load, and engineering trade-offs that are measured rather than assumed.
  • Carry one running project from specification to a deployed, defensible result across the whole term.
  • Work in a team of three or four and defend the design at each of the three presentations (weeks 5, 8, and 13).

Example projects

Mini proof-of-work blockchainPBFT permissioned ledgerToken with audited contractsICO-style crowdfunding DApp with ERC-20 tokenNFT marketplace security study with ERC-721HD multi-sig walletAutomated market maker with auditLending protocol exploit labIPFS-backed DAO voting systemCross-layer audit toolkit

Assessment & grading

Grading is project-based, with no written exam. Teams of three or four present one running project three times.

ComponentWhat it coversWeight
Project · SpecificationPresentation 1 (week 5): problem, objectives, and architecture20%
Project · InterimPresentation 2 (week 8): the working system demonstrated live30%
Project · FinalPresentation 3 (week 13): end-to-end demo with oral defense50%

Tools & platforms

  • Solidity: smart-contract programming language
  • Foundry: contract development, testing, and fuzzing
  • Hardhat: Ethereum development and deployment environment
  • Remix: browser-based contract IDE and debugger
  • OpenZeppelin Contracts: audited ERC-20, ERC-721, access-control, and security libraries
  • Slither: static analysis for Solidity vulnerabilities
  • Echidna: property-based smart-contract fuzzing
  • Ganache: local Ethereum test chain
  • ethers.js: blockchain interaction and wallet library
  • Web3.js: blockchain interaction library for legacy and browser-based DApps
  • MetaMask: wallet and key-management client
  • IPFS: decentralized content-addressed storage for DApp metadata and assets
  • Chainlink: oracle network for studying external data dependencies
  • Tenderly: transaction simulation and debugging

Free online courses

Existing free, video-based courses this course can build on, for self-study or as a teaching basis.

In Hebrew · בעברית

Primary literature

Seminal works for advanced study.

References

Books and resources link to an online or publisher page.

Role in each concentration

ConcentrationRole
Intelligent Software SystemsElective
Networking & Cyber SecurityCore · Semester 2
AI & RoboticsElective
AI and Quantum Computing for FinanceCore · Semester 2
Immersive Systems & Game DevelopmentElective
Defense Technologies & Autonomous SystemsElective