Instructor

Prof. Pramod Viswanath, pramodv@illinois.edu,  217-244-8999

Teaching assistant

Xuechao Wang, xuechao2@illinois.edu

Peiyao Sheng, psheng2@illinois.edu

Lectures

    Topic Lecture notes Summary video Course materials MP due
  1 Introduction Notes Video Slides  

Foundations

Module 1a: Bitcoin

2 Cryptographic primitives Notes Video Slides  
3 Nakamoto consensus Notes Video Slides Warmup1
4 P2P network Notes Video Slides  
5 Bitcoin system Notes Video Slides Warmup2
6 Bitcoin safety Notes Video Slides  
7 Bitcoin liveness Notes Video Slides MidtermProject1

Foundations

Module 1b: Scaling Bitcoin

8 Scaling throughput Notes Video Slides  
9 Scaling latency Notes Video Slides MidtermProject2
10 Sharding Notes Video Slides  
11 Proof of stake Notes Video Slides MidtermProject3
12 Scaling externally (a) Notes Video Slides  
13 Scaling externally (b) Notes Video Slides MidtermProject4

Foundations

Module 1c: Beyond Bitcoin

14 Streamlet and Hotstuff Notes Video Slides  
15 Algorand Notes Video Slides MidtermProject5
16 Finality gadget: bridge BFT and longest chain protocols Notes Video Slides  
17 Bootstrapping blockchains Notes   Slides MidtermProject6
18a Zcash architecture Notes Video Slides  
18b Privacy bridge Notes Video    

Applications

19 Blockchain computer of Hyperledger     Slides  
20 Blockchain computer of Ethereum     Slides  
21 Solidity programming     Slides  
22 Stablecoins and synthetic assets     Slides  
23 Transaction ordering and front running attacks     Slides  
24 Oracles and cross chain bridges        
25 Decentralized exchanges     Slides  
26 Decentralized autonomous organization     Slides  

Course Outline

Blockchains are decentralized digital trust engines and are a potential replacement to "digital platforms" that we encounter in today's world. Digital platform companies occupy 7 of the largest companies in the world based on market capitalization (eg: Apple, Google, Microsoft, Amazon, Alibaba, Tencent). Blockchains came into prominence through Bitcoin, a cryptocurrency, introduced in 2009. In the decade since its inception, blockchain designs have evolved significantly, although the corresponding evolution of applications (beyond cryptocurrencies) have not caught up yet. In this course, we study a full-stack design of blockchains: we view the blockchains as a whole integrated system involving networking, incentives, consensus, application layer support. The course is structured into two components: Foundations and Applications. The foundation component itself is divided into 3 parts: in the first part we study the Bitcoin design in detail. Although very secure and remarkably incentive compatible in the real world, Bitcoin has very poor performance in many ways: throughput, latency, energy, compute, storage and communication. In the second part we study the various efforts to scale the performance of Bitcoin in all the different dimensions, while maintaining the incentive compatibility and security of Bitcoin. In the final part, we study aspects of blockchain design that were simply not considered in Bitcoin (e.g., privacy, finality). In the spirit of Nakamoto (who implemented and tested the Bitcoin client before writing the white paper), this course will be implementation-heavy. We will use the Rust programming language for our assignments and projects for the foundation component of the course. By the middle of the course, you will implement a Bitcoin client in Rust and test it out internally. In the final project you will implement features for scaling the Bitcoin client developed earlier. The homework assignments will help you in these implementation efforts by leading you along. Example: the first assignment is on getting you used to Rust and the second assignment lets you build and use basic crypto primitives (hash functions, Merkle trees, signatures) in Rust. In the projects at the second part of the course you will work on implementing prototype smart contracts (in Solidity) representing to major application areas of blockchains: DeFi (decentralized finance) and NFTs (non-fungible tokens)..

Course Notes

Prerequisites

The basic technical prerequisites are a background in probability and algorithms. Decent amount of software programming background is essential. At Illinois, the prerequisites are met by: Probability (ECE 313), a strong programming course (eg: ECE 390), algorithms (CS 473) and networking (ECE/CS 438)

Lectures

Tuesdays and Thursdays, 12:30pm-1:50pm, 2017 ECEB

Online lectures:  Zoom link

Office Hours

Prof. Viswanath - Fridays 12-1pm, online, zoom link

Xuechao Wang - Mondays 3-4pm, online, zoom link

Grading

Based on performance on MPs. Roughly 10 MPs, each worth equally (other than the warmup). 

Warmup MPs

Week 1: Warmup 1 - In this introductory assignment, you will get to learn the basics of Rust programming language and useful libraries. The assignment will be accessed and completed on Gitlab, available here: [ Warmup 1 ]. Due date: 12:30PM, January 25, 2022.

Week 2: Warmup 2 - In this assignment, you will get to learn to basic cryptographic primitives (hash functions and signatures) and build fundamental data structures that form the core of blockchains: block chains and Merkle trees. The assignment will be accessed and completed on Gitlab, available here: [ Warmup 2 ]. Due date: 12:30PM, Feb 1, 2022.

Bitcoin Client Project

We are going to build a simplified Bitcoin client with full node functionality. Students will create a private test net amongst their team members(groups of 2) and have fun changing various parameters of layer 1. The project will be a continuation of the code used in Warmup 2. The project will be split into 6 weeks with checkpoints every week as listed below.

Week 3: Block and Blockchain structure - Create block and blockchain struct and add some functions related to it. More detailed instructions can be found at [ Bitcoin Project Week 3 ]. Due date: 12:30PM, Feb 8, 2021.

Week 4: Mining - Implement a mining module of the bitcoin client. The mining module(miner) will produce blocks by solving the proof-of-work puzzle. More detailed instructions can be found at [ Bicoin Project Week 4 ]. Due date: 12:30PM, Feb 15, 2022.

Week 5: Network - Implement the network module of Bitcoin client. The network module is in charge of communicating with other nodes/clients. It forms the peer-to-peer (p2p) network and uses gossip protocol to exchange data, including blocks and transactions. More detailed instructions can be found at [ Bitcoin Project Week 5 ]. Due date: 12:30PM, February 22, 2022.

Week 6: Putting together a data blockchain - Combine last 3 week's work to make a functioning data blockchain. Most of this week's work will be combining mining, network, and blockchain modules. You will need to add PoW validation and a block buffer to handle orphan blocks. More detailed instructions can be found at [ Bitcoin Project Week 6 ]. Due date: 12:30PM, March 1, 2022.

Week 7: Transactions - Include transactions in the codebase. Integrate the transaction structure inside the block content, add network functionality to transaction propagation and adding a transaction mempool to be used by the miner to include transaction content in the block being mined. More detailed instructions can be found at [ Bitcoin Project Week 7 ]. Due date: 12:30PM, March 22, 2022.

Week 8: State transition and validation - This is the last part of midterm project, and you are going to finish the Bitcoin client. You need to maintain a state for the ledger that the blockchain creates and add all the necessary checks related to it. More detailed instructions can be found at [ Bitcoin Project Week 8 ]. Due date: 12:30PM, March 29, 2022.

Video Lectures

The recorded lecture videos can be found here.