CPSC 3640 ยท Yale Computer Science

Decentralized Payments, Contracts, and Finance for Humans and AI

Announcements

  • CPSC 3640 will be offered in Fall 2026. The course website is now live with the schedule and logistics.

Course Information

Time/location

  • MW, 11:35am-12:50pm
  • TBA

Platforms

Instructor

Prof. Fan Zhang

Prof. Fan Zhang

Office hours: TBD, TBD

Teaching Assistance

TBA

TBA

๐Ÿ“– Course Description

Blockchains provide a platform for humans to coordinate economic activity without relying on centralized intermediaries. Emerging standards such as EIP-8004 aim to extend these capabilities to autonomous agents, enabling AI systems to transact and coordinate through shared protocols. This introductory course explores such decentralized applications, including tokens, exchanges, lending protocols, stablecoins, oracles, decentralized governance, and emerging standards for AI coordination and interoperability. Students will learn system architecture, security intuition, and how to build and debug decentralized applications.

Course Units (click for details)

This course is organized into three units that build progressively from foundational concepts to the frontier where AI and blockchain intersect.

Unit 1 โ€” Foundation establishes the intellectual and technical bedrock of the course. Students learn why decentralized systems are needed by tracing the history of digital money: trusted-party approaches, e-cash and its problems of counterfeiting and double spending, and the challenges of censorship and equivocation that motivate consensus. The unit then covers Bitcoin’s breakthrough in permissionless consensus, payment methods in Bitcoin and efforts to do more with it, and Ethereum’s smart contract platform with programming in Solidity. It concludes with a unified view of blockchains as robust world computers built from faulty nodes through State Machine Replication, different virtual machines, and modular designs (L1s, L2s, and data availability).

Unit 2 โ€” DeFi as new fintech for Humans covers the major building blocks of the decentralized finance ecosystem and the risks that come with them. Students learn how tokens, stablecoins, decentralized exchanges (DEXes) and automated market makers (AMMs), oracles, and lending and borrowing protocols work under the hood, along with opportunities that DeFi uniquely enables, such as auditing and formal verification and cross-chain interoperability. The unit then turns to risk: smart contract bugs, Miner/Maximal Extractable Value (MEV), Proposer-Builder Separation (PBS) and its centralization problems, payment privacy and confidential smart contracts, key management, and scaling performance with payment channels and rollups.

Unit 3 โ€” Crypto for AI <> AI for Crypto explores the two-way relationship between blockchains and AI. In one direction, students examine how decentralized infrastructure can serve autonomous AI agents: payment protocols such as x402, confidential AI using Trusted Execution Environments (TEEs), securing the plumbing of AI, and identity, reputation, and coordination through emerging standards such as EIP-8004. In the other direction, the unit examines how AI systems participate in crypto markets, including trading algorithms and their privacy problems.

Prerequisites

Required: CPSC 201 and 202 (or equivalent), and a basic understanding of computer systems and networks.

Grading

Assessment Weight Details
Class Participation 10% Ongoing throughout the semester; includes in-class discussion and engagement
Homework & Labs 40% ~6 problem sets and hands-on Solidity labs, distributed roughly every 1โ€“2 weeks
Group Presentation 30% Students form a team to investigate a technical or societal topic related to the course and present to the class (~20 minutes), scheduled during the final weeks of the semester
Final Exam 20% In-class final exam on fundamental concepts across all three units

Lecture Schedule

Section I: Foundation

Slides forthcoming
Lecture 1 TBA

Course intro: from digital money and programmable asset to trusted computer for AI

Slides forthcoming
Lecture 2 TBA

Nakamoto broke new ground in 2009: Bitcoin

Slides forthcoming
Lecture 3 TBA

Payment methods in Bitcoin

Slides forthcoming
Lecture 4 TBA

Trying to do more with Bitcoin

Slides forthcoming
Lecture 5 TBA

Ethereum and smart contracts

Slides forthcoming
Lecture 6 TBA

A unified view: robust world computer from faulty nodes

Section II: DeFi as new fintech for Humans

Slides forthcoming
Lecture 7 TBA

Tokens & stablecoins

Slides forthcoming
Lecture 8 TBA

DEX and Automated Market Makers (AMMs)

Slides forthcoming
Lecture 9 TBA

DeFi opportunities: auditing & formal verification

Slides forthcoming
Lecture 10 TBA

Oracles

Slides forthcoming
Lecture 11 TBA

Lending & borrowing

Slides forthcoming
Lecture 12 TBA

DeFi opportunities: interoperability

Slides forthcoming
Lecture 13 TBA

DeFi risk: bugs

Slides forthcoming
Lecture 14 TBA

DeFi risk: MEV

Slides forthcoming
Lecture 15 TBA

PBS and their problems

Slides forthcoming
Lecture 16 TBA

DeFi risk: privacy (traceable payments)

Slides forthcoming
Lecture 17 TBA

Privacy II: confidential smart contracts

Slides forthcoming
Lecture 18 TBA

DeFi risk: key management

Slides forthcoming
Lecture 19 TBA

Scaling up performance

Section III: Crypto for AI <> AI for Crypto

Slides forthcoming
Lecture 20 TBA

Payment protocols for agents (x402)

Slides forthcoming
Lecture 21 TBA

Confidential AI using TEEs

Slides forthcoming
Lecture 22 TBA

Securing the plumbing of AI (Props)

Slides forthcoming
Lecture 23 TBA

Identity, reputation & coordination (EIP-8004)

Slides forthcoming
Lecture 24 TBA

Trading algos, and their privacy problems

Slides forthcoming
Lecture 25 TBA

TBD (buffer)

Final exam (in class)

Slides forthcoming
Lecture 26 TBA

In-class Final