Blockchain and Cryptocurrencies
Background Reading
Bitcoin whitepaper (2009): A Peer-to-Peer Electronic Cash System by Satoshi Nakamoto
Ethereum whitepaper (2014): Ethereum: A Next-Generation Smart Contract and Decentralized Application Platform by Vitalik Buterin
The Blockchain Trilemma
The Blockchain Trilemma refers to the idea that no blockchain can have all three of the following: security, scalability, and decentralization. Any blockchain is forced to optimize for two features to the detriment of the third. The term was coined by Ethereum founder Vitalik Buterin.
Layer 1 (Consensus)
Summary
An area of problems about how to get distributed systems to agree on state or some other piece of information. Found new application with the emergence of blockchains.
- State Machine Replication (SMR)
- The problem of ensuring that a group of machines maintains agreement on a collective state even under updates (which may only be sent to some of the machines)
- Byzantine Agreement (BA)
-
- Consistency: All honest parties output the same bit
- Validity: If all honest parties input \(b\), all honest parties will output \(b\)
- Termination: All honest parties eventually terminate and output some value
State Representation
There are two main accounting models used to represent the state of a blockchain system:
- UTXO
- Unspent Transaction Output. Every transaction tx consists of input transactions and output transactions; before executing tx, the chain (miners) check that the input transactions are unspent, i.e., they are as-yet unused output transactions from some previous tx' (they are in the UTXO set). Once tx is processed its inputs are removed from the UTXO set. That means that there is a directed acyclic graph (DAG) describing how assets (UTXOs) have moved between addresses. This DAG represents the global state. (Account balances are computed locally by adding up an account's UTXOs.)
Used by: Bitcoin, Litecoin, and Monero. - Account-based
- The account model simply maintains a database mapping accounts to balances. This database represents the global state. Use by: Ethereum.
Further Reading
Layer 2
Summary
Layer 2 protocols are protocols which rely on an underlying "main" chain and are meant to help with scalability.
- Payment channel (PC)
-
- ** Payment channel network (PCN)**
- Sidechain
- Rollup
- These are often erroneously called "zk" even though they are not zero-knowledge.
Layer 3 (UI)
- Deterministic wallet
- A deterministic wallet is a cryptocurrency wallet where the keys are deterministically dervied from some seed (e.g., a string of words written on a piece of paper). If the user loses their keys, they can re-derive them from the seed.