Bitcoin and Blockchain Technology, Fall 2020

Department of Statistics and Quantitative Methods, University of Milano-Bicocca

Because of COVID-19 the course will be streaming only.

e-learning: <elearning.unimib.it/course/view.php?id=31548>

If you have an e-mail @campus.unimib.it please join the 202010-bicocca channel in the Slack BBT workspace using your first and last name (no nicknames) and a profile picture. Updates and conversations about the course will be posted in the Slack channel.

The course is for the students of University of Milano-Bicocca only; anyone else, please consider https://dgi.io/workshop.

Learning objectives

The course is an introduction to bitcoin and the associated blockchain technology.

Starting from a computationally focused approach to elliptic curves over finite fields and presenting the discrete logarithm problem as cornerstone of public-key cryptography, bitcoin is introduced as ingenious breakthrough innovation.

Its game theory, computer science (distributed systems, distributed consensus), and monetary theory elements are examined in the attempt to properly convey the interdisciplinarity of the topic and appreciate its relevance.

Technical and programming elements about digital signatures, blockchain, Merkle tree, addresses, transactions, and timestamping are also provided to assess features and limits of the Bitcoin protocol.

Prerequisites

There are no strict prerequisites, even if a computer science mindset and some familiarity with algebra and finance might help to appreciate the course. While a rigorous formal approach is almost impossible in a course touching on so many and so different knowledge areas, intellectual curiosity is stimulated about the interplay between maths, cryptography, economic incentives, technology, monetary theory, regulatory issues, and politics.

Contents

  • Cash, Electronic Money, Central Bank Money, eCash
  • Internet Money
  • Bitcoin Transactions
  • About Money
  • Private Money and the Centralization Dilemma
  • The Double Spending Problem
  • Bitcoin as Digital Gold
  • Bitcoin as Investment Asset
  • Bitcoin Financial Services
  • Discrete Logarithm Problem on Finite Cyclic Groups
  • Modular Arithmetic
  • Finite Fields
  • Elliptic Curves Over Real Numbers
  • DLP on Elliptic Curves Over Finite Fields
  • Hash Functions
  • Partial Hash Inversion
  • Hash Pointer Data Structures: Blockchain and Merkle Tree
  • Design of A Simplified Digital Currency
  • Distributed Consensus
  • Mining
  • P2P Network
  • Protocol Governance
  • Elliptic curve digital signature algorithm
  • Elliptic curve Schnorr signature algorithm: Mu(lti)Sig(nature), threshold signature, batch verification
  • Addresses and WIFs
  • Hierarchical deterministic wallets: BIP32, BIP43, BIP44
  • Mnemonic phrase: BIP39 and Electrum
  • TxIns, TxOs, UTxO, nLockTime
  • Bitcoin script language
  • Transactions
  • Blocks
  • Wallets and Bitcoin Core
  • Testnet, regtest, and wallet workshop
  • Money and innovation: monetary and token engineering
  • Hayek money and dual asset ledger money
  • Blockchain beyond bitcoin
  • Finance and blockchain
  • Timestamping, notarization, and anchoring
  • Smart contracts
  • Distributed ledger technology

Teaching method

  • Slide based lessons with associated bibliography
  • Python 3 programming assignments and technology assignments
  • Workshop labs on Bitcoin Core, Electrum, and OpenTimestamps

Teaching language

Italian or English, the latter if foreign students are present.

Exam

Students attending the lessons are asked to solve the homework assignments for each lesson. Homeworks have a deadline and are not required/allowed for students that did not actively partecipate to the semester activity.

Homework can be tackled cooperatively by team of students, up to three students. Successfull homeworks will contribute up to 5 points to the final grade.

Please send the homeworks to the e-mail that will be indicated with subject BBT202010-BICOCCA #1 for the first assignment, BBT202010-BICOCCA #2 for the second assignment, etc.

The final exam will be individual: a grade of at least 18/30 is required to pass the exam.

Lessons’ calendar and material

Assistant lecturer: Paolo Mazzocchi.

  1. 2020-10-07 Wednesday 16:30-18:30
    Bitcoin as Digital Gold (Part 1)
    slides
  2. 2020-10-14 Wednesday 16:30-18:30
    Bitcoin as Digital Gold (Part 2)
    slides
    Homework #1: read the “Bitcoin: oro digitale, finanza e tulipani” interview; then send up to three questions that, in your opinion, might deserve further clarifications; deadline: 2020-10-20
  3. 2020-10-21 Wednesday 16:30-18:30
    Discrete Logarithm Problem on Finite Fields and Elliptic Curves
    slides
    Homeworks are included in the slides; deadline: 2020-11-10
  4. 2020-10-28 Wednesday 16:30-18:30
    Hash Functions
    slides
    Homeworks are included in the slides; deadline: 2020-11-10
    Blockchain, Mining, and Distributed Consensus (Part 1)
    slides
  5. 2020-11-04 Wednesday 16:30-18:30
    Blockchain, Mining, and Distributed Consensus (Part 2)
    slides
  6. 2020-11-11 Wednesday 16:30-18:30
    Elliptic Curve Digital Signature Algorithm
    slides
  7. 2020-11-18 Wednesday 16:30-18:30
    Addresses, WIFs, and Bitcoin Message Signing
    slides
    Transactions and Scripts
    slides
  8. 2020-12-02 Wednesday 16:30-18:30
    Beyond Bitcoin: Between Hype and Reality
    slides
  9. 2020-12-09 Wednesday 16:30-18:30
    Wallets and Deterministic Key Chains
    slides
  10. 2020-12-16 Wednesday 16:30-18:30
    The Cryptocurrency Frontier in Monetary Engineering
    slides
    Bitcoin: oro digitale per nuovi standard monetari
    Hayek Money: The Cryptocurrency Price Stability Solution
  11. 2020-12-23 Wednesday 16:30-18:30
    Final Q&A

Python library

https://btclib.org
https://github.com/btclib-org/btclib

Python scripts, Excel spreadsheets, and regtest lab material

https://github.com/btclib-org/bbt

Introductory reading

Technology references

Cryptography references

Monetary theory references

  • Friedrich A. Hayek,
    “Denationalisation of Money: The Argument Refined”,
    <mises.org/library/denationalisation-money-argument-refined>
  • Saifedean Ammous,
    “The Bitcoin Standard: The Decentralized Alternative to Central Banking” (2018),
    Wiley, 978-1119473862
  • Ferdinando M. Ametrano,
    “Hayek Money: The Cryptocurrency Price Stability Solution” (2014),
    https://ssrn.com/abstract=2425270
  • Robert Sams,
    “A Note on Cryptocurrency Stabilisation: Seigniorage Shares” (2015),
    https://github.com/rmsams/stablecoins/blob/master/paper.pdf
  • Ferdinando M. Ametrano,
    “Bitcoin: oro digitale per nuovi standard monetari” (2020),
    published in “Dal sesterzio al bitcoin”, Rubettino Editore (edited by Angelo Miglietta, and Alberto Mingardi)
    https://bit.ly/2NQg9VJ