This course cover the technical aspects of 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. The introductory material will cover the following areas: basics of cryptography; Merkle tree, blockchain; distributed consensus, mining; incentives, proof of work; proof of stake, economics, security, smart contracts; applications. The advanced material will delve into active research problems in the area, including attacks, network scalability, alternatives to proof of work/stake.