CS 251: Bitcoin and Cryptocurrencies


Autumn 2016


The potential applications for Bitcoin-like cryptocurrencies are enormous. The course will cover the technical aspects of cryptocurrencies, blockchain technologies, and distributed consensus. Students will learn how these systems work and how to engineer secure software that interacts with the Bitcoin network and other cryptocurrencies. This course is intended for advanced undergraduates and graduate students.

Prerequisites and programming languages

The course assumes a basic familiarity with computer programming. CS110 (Principles of Computer Systems) or equivalent is strongly recommended. In terms of programming languages, the requirements for each assignment are:

  1. Your choice of language, though we will provide support only for Java and the BitcoinJ library.
  2. Must be completed in Java.
  3. Your choice of language. No starter code will be provided.
  4. Must be completed in Solidity, Ethereum's most popular smart contract language which claims similarity to JavaScript. No prior experience with Solidity is expected. Additional testing code may be required in JavaScript.

CS255 (Introduction to Cryptography) is helpful but not necessary; we will introduce concepts from cryptography as needed during class but students with no background in cryptography may wish to do extra reading.

Textbook and Readings

We will list external reading sources on the course syllabus page. These readings will often serve to expand on what we'll talk about in the lectures and sometimes present the material in a different way. They are not a replacement for the lectures. They are also not necessary to be read before coming to lecture. The lectures will be self-contained so the readings can be read afterwards to help reinforce the concepts presented in the lectures. They can equivalently be read before lecture to help the lectures make sense, depending on your learning style.

We will be using the textbook Bitcoin and Cryptocurrency Technologies: A Comprehensive Introduction by Narayanan, Bonneau, Felten, Miller and Goldfeder (referred to as NBFMG in the syllabus). The textbook is available online as well as at the Stanford bookstore. If you don't wish to purchase the textbook, you may use the author's preprint edition which is available for free online. Note that this version is a rough draft and is known to contain many editorial mistakes. The published version has been professionally edited and also contains nicer diagrams and other niceties. However, the two are largely compatible content-wise and chapter and section numbers should directly correspond.

Course readings will also include several other freely available online sources listed in the syllabus page:

  • We will work through the research survey paper Research Perspectives and Challenges for Bitcoin and Cryptocurrencies by Bonneau, Miller, Clark, Narayanan, Kroll and Felten which includes references to most of the research literature on Bitcoin.
  • A few other technical papers will be listed on the syllabus. If you want more technical papers covering the latest research, Jeremy Clark maintains an extensive online bibliography of Bitcoin research papers which is a great resource if you want more detailed information about a specific topic.
  • Bitcoin does not have any official technical specification, but the Bitcoin Developer Reference is the closest thing available. It is a good reference for low-level technical details.
  • Ethereum maintains an extensive wiki with reference documentation for many aspects of the system.
  • For a few topics for which there are no other good options, we may assign readings from the (unofficial) Bitcoin Wiki or the Bitcoin Talk forum. While there is a wealth of knowledge contained in these sources, please be careful when reading them, as a substantial amount of it is technically inaccurate or out of date. In particular, the original white paper Bitcoin: A Peer-to-Peer Electronic Cash System by Satoshi Nakamoto is now inconsistent in several respects with the actually deployed Bitcoin network (though we'll still be assigning it).


  • There will occasionally be a section on Friday 3:30-4:20pm in Gates B03.
  • Attendance at the sections is optional, but highly recommended.

Homework Assignments

  • There will be three written homework assignments and four programming projects.
  • You may collaborate when solving the written assignments, however when writing up the solutions you must do so on your own. If you collaborate, please list the names of your collaborators on your assignment.
  • Programming projects may be done in pairs or alone.
  • You must submit all homeworks and projects electronically. Submission instructions will be provided.
  • Extensions:  Each student has a total of 72 extension hours throughout the quarter. This automatic extension can be spent in units of 24 hours on any of the assignments and projects. Please mark the submission time for any late assignment.
  • Homework and projects will be due at 11:59pm on the specified deadline.


There will be a final exam in the regularly scheduled time slot during final exam week. We will also provide an alternate final for those who cannot make the scheduled time. There will not be a midterm exam.


Final placement in the class will be determined by the following formula:

0.25 H + 0.5 P + 0.25 F

  • H is your average score on the three written homework assignments.
  • P is the weighted average grade on the four programming projects.
  • F is your final exam score.