Blockchain: Distributed Ledgers and Consensus
A blockchain is a distributed ledger secured by cryptographic hashing. Consensus mechanisms solve the Byzantine Generals Problem. Smart contracts extend the model to programmable transactions.
Brief History
- 1974: Ethernet. 1994: TCP/IP. 1994: HTTP.
- 1976: SSL/TLS (encryption). 1990: public key cryptography commercialised.
- 1982: Digicash. 1983: Cybercash. 1994: PayPal (1999). History of electronic payments.
- 1930: Enigma machine (mechanical cryptography). Mathematical cryptography formalised later.
- Satoshi Nakamoto published the Bitcoin whitepaper in 2007, solving the Byzantine Generals Problem with a peer-to-peer consensus mechanism.
What a Blockchain Is
A blockchain is a distributed, append-only ledger. Transactions are grouped into blocks. Each block contains a cryptographic hash of the previous block, forming a chain. Altering any block invalidates all subsequent blocks.
Key properties:
- Verifiable: hash functions allow anyone to verify the integrity of the chain.
- Distributed: no single authority controls the ledger.
- Append-only: once confirmed, records cannot be removed (only in permissioned chains with governance mechanisms).
A blockchain is not available only via logs. It is a shared ledger that can be read by permissioned participants.
Cryptographic Foundations
Encryption is the communication of information in the presence of adversaries. Two main approaches:
- Symmetric cryptography: same key for encryption and decryption. Fast but requires secure key exchange.
- Asymmetric cryptography: public/private key pair. The public key encrypts; the private key decrypts (or: private key signs, public key verifies). Used for digital signatures.
Digital signatures: two main functions. Verify that the data needs to be verified (integrity). Digital signatures create non-repudiation. Zero-knowledge proofs relate to asymmetric cryptography.
Hash functions: deterministic, one-way, fixed-length output. Used to create block identifiers and link blocks together.
The Byzantine Generals Problem
The Byzantine Generals Problem: how do distributed nodes reach consensus when some nodes may be faulty or malicious? Satoshi Nakamoto solved this for a permissionless network using proof-of-work.
- Hash functions → digital signatures → non-repudiation → consensus.
- Proof of work: nodes compete to solve a computational puzzle. The winner adds the next block. The difficulty makes falsifying history computationally expensive.
Ledger Types
| Type | Description |
|---|---|
| General ledger | Public, all transactions visible |
| Transaction ledger | Records of individual transactions |
| Sub-ledger | Subset of the general ledger |
- Bitcoin is a general ledger with a single asset (BTC).
- Ethereum is a general ledger with programmable state (smart contracts).
Smart Contracts
A smart contract is code deployed on a blockchain that executes automatically when conditions are met. It is unrelated to smart contract law. Applications: token transfers, DeFi protocols, supply chain tracking, voting.
Challenges: once deployed, code cannot be changed. Bugs are permanent. The code is public, so vulnerabilities can be exploited by anyone.
Blockchain Properties
| Property | Description |
|---|---|
| Verifiable | Hash-based integrity checks |
| Decentralised | No central authority |
| Permissionless / Permissioned | Public chains vs consortium chains |
| Interoperability | Ability to communicate with other chains |
| Performance / Scalability | Throughput measured in transactions per second |
| Governance | How changes to protocol rules are decided |
Permissioned vs permissionless:
- Permissionless (Bitcoin, Ethereum): anyone can participate.
- Permissioned (Hyperledger, enterprise blockchains): access controlled by an authority.
Finance and the Role of Money
Finance studies the economic activity related to economic relationships. A blockchain can act as infrastructure for:
- Digital currency (Bitcoin).
- Asset tokenisation (real estate, securities on-chain).
- Decentralised finance (DeFi): lending, trading, yield, without intermediaries.
A transaction between two parties involves two accounts. When there is a transaction between one party and a bank, there are some issues, especially when a transaction involves a currency exchange.
The key question blockchain addresses: can we have a trustless, permissionless record of value transfer without a central intermediary?