Lecture 15 - Cryptocurrencies III
Introduction
This lecture examines the technical foundations of cryptocurrencies, focusing on the mechanisms introduced in Satoshi Nakamoto’s Bitcoin protocol. The key objective of the protocol is to create a decentralised ledger that records transactions securely without relying on a central authority.
The fundamental economic and technological problem is the trust problem in decentralised systems. In traditional financial systems, institutions such as banks validate and record transactions. Cryptocurrencies attempt to replicate these functions through cryptography, incentives, and distributed verification.
The lecture therefore explores three core mechanisms:
- Cryptographic hash functions
- Proof-of-work and blockchain structure
- Digital signatures and authentication of transactions
Together these mechanisms ensure immutability, consensus, and trustless verification in cryptocurrency systems.
1. Cryptographic Hash Functions
A Cryptographic Hash Function (CHF) is a mathematical function that takes a bit string of arbitrary length and outputs a bit string of fixed length.
Bit Strings and Data Representation
All information stored digitally can be represented as bit strings, which are sequences of zeros and ones.
Examples of data represented as bit strings include:
- Text
- Images
- Audio
- Transaction records
Thus, in blockchain systems, all transaction data ultimately reduces to bit strings.
If a CHF is denoted by
is called the hash of
Properties of Cryptographic Hash Functions
A secure cryptographic hash function satisfies several crucial properties.
1. Fixed-Length Output
Regardless of the length of the input string, the output hash has constant length.
For example:
- Bitcoin uses SHA256
- Output length is 256 bits
Thus:
2. Efficiency
A function is efficient if computing
Hash functions must be fast to compute, enabling nodes to verify transactions quickly.
3. Collision Resistance
A function is collision resistant if it is computationally infeasible to find two different inputs
This property ensures:
- Data integrity
- Tamper resistance
If an attacker modifies data, the hash changes.
4. Pseudo-randomness
Hash outputs appear random, even though the function itself is deterministic.
If the output length is
Hash functions create a system where finding a specific output requires brute force search. This feature is crucial for the design of proof-of-work systems.
Pre-images
The pre-image of a hash refers to the set of inputs that produce that hash.
Given a hash value
is computationally difficult.
This is known as pre-image resistance.
Cryptographic hash functions create computational asymmetry:
- Creating valid structures (such as blocks) requires large computational effort.
- Verifying validity requires minimal effort.
This asymmetry forms the economic foundation of blockchain security, as attackers must expend massive computational resources to manipulate the ledger.
2. Satoshi’s Protocol: Core Mechanism
The protocol can be understood through a simplified analogy involving a book composed of pages.
Each page represents what in Bitcoin is called a block.
Structure of the Ledger
A ledger is valid if:
- Page
contains a predefined text. - For every page
:
The page contains:
- The hash of page
- Additional content
- A special number called a nonce
The nonce must satisfy a cryptographic condition.
Hash Linking
Each page begins with the hash of the previous page.
Thus
This creates a chain structure.
A Blockchain is a sequence of blocks where each block contains the hash of the previous block.
Proof-of-Work Condition
The page must also include a number
This number
A Proof-of-work is a nonce
Difficulty Parameter
The parameter
Because hashes behave randomly:
Thus the expected number of attempts is:
Proof-of-work introduces computational scarcity. Producing a block requires large computational investment, which creates a cost that secures the network.
3. Consensus Rule
Participants follow a simple rule:
Always work on the longest valid blockchain known to you.
This ensures that the network converges toward a single shared ledger.
If two chains of equal length appear, nodes ignore the alternative until one becomes longer.
This rule implements a decentralised consensus mechanism.
Rational participants coordinate on the longest chain because it represents the chain with the greatest cumulative computational work.
4. Security of the Protocol
To verify that the protocol is stable, several deviations must be considered.
Deviation 1: Modifying Previous Blocks
Suppose an attacker modifies block
Because hashes are linked, the attacker must recompute:
- block
- block
- ...
- block
Total work required:
Meanwhile the honest chain continues to grow.
The attacker must catch up with the entire network's computational power, making the attack extremely unlikely unless the attacker controls the majority of computing power.
Deviation 2: Ignoring Updates
A miner could ignore newly discovered blocks and continue mining their own chain.
However:
- The rest of the network grows faster
- Their chain falls behind
Expected growth rate is lower.
Deviation 3: Withholding a Block
A miner might discover a valid block but keep it secret to gain a head start.
However:
- The network continues mining
- The secret advantage disappears quickly
This makes withholding unprofitable in expectation.
The protocol discourages deviations because:
- Rewriting history requires enormous computation
- Ignoring consensus reduces expected rewards
- Withholding blocks provides little advantage
5. Digital Signatures
While the blockchain structure secures the ledger, it does not yet guarantee that transactions are authorised.
Bitcoin therefore uses digital signatures.
A digital signature is a cryptographic method that verifies the identity of the sender of a message.
Public and Private Keys
Each individual generates two mathematical functions:
- Public key:
- Private key:
These functions satisfy
The public key is shared publicly, while the private key remains secret.
Authentication Process
To send a message
where
Others verify authenticity by computing$$
s_A(\tilde{m}) = m
(A, x, B, \tilde{m})
s_A(\tilde{m}) = (A,x,B)