Script
Script
Thomas Schmelzer
thomas.schmelzer@gmail.com
Faculté des hautes études commerciales
University of Lausanne
1 Warm-Up 7
1.1 Powers of base 2 . . . . . . . . . . . . . . . . . . . . . . . . . 8
1.2 Binary and hexadecimal numbers . . . . . . . . . . . . . . . . 9
1.3 The rice and the chessboard . . . . . . . . . . . . . . . . . . . 11
1.4 Groups . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
1.5 Modular arithmetic . . . . . . . . . . . . . . . . . . . . . . . . 14
1.6 Shor’s algorithm . . . . . . . . . . . . . . . . . . . . . . . . . . 16
1.7 Elliptic curves . . . . . . . . . . . . . . . . . . . . . . . . . . . 18
1.8 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
1.8.1 Further references and comments . . . . . . . . . . . . 21
2 Cryptography 23
2.1 Key pairs and identity . . . . . . . . . . . . . . . . . . . . . . 24
2.2 Cryptographic hash functions . . . . . . . . . . . . . . . . . . 24
2.3 Digital signatures . . . . . . . . . . . . . . . . . . . . . . . . . 26
2.3.1 Creating the signature . . . . . . . . . . . . . . . . . . 26
2.3.2 Verifying the signature . . . . . . . . . . . . . . . . . . 27
2.3.3 Source code for digital signatures . . . . . . . . . . . . 27
2.4 A first blockchain . . . . . . . . . . . . . . . . . . . . . . . . . 29
2.5 Symmetric cryptography . . . . . . . . . . . . . . . . . . . . . 31
2.6 Diffie–Hellman key exchange . . . . . . . . . . . . . . . . . . . 32
3
4 CONTENTS
2.7 Summary . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34
2.7.1 Further references and comments . . . . . . . . . . . . 34
4 Money 43
CONTENTS 5
Preface
My goal is to provide an introduction to distributed ledger technology, blockchains
and cryptocurrencies. The course focuses on the applications of these tech-
nologies in finance and banking.
Obviously there is a short-term goal lurking. You all want to maximize
the likelihood of passing the exam. There will be only one exam. Don’t
forget that exams are rare moments in your existence to shine. You should
be very excited.
There’s a simple and well tested strategy to maximize this likelihood.
You have to attend all the lectures. Attendance is not enough though. You
have to participate and engage. You do the exercises, you ask questions and
you discuss with your fellow students. You even start writing your own little
programs and run experiments.
This little script is not a replacement for your physical presence in my
lectures. It is not self-contained. It shall help you to prepare for the exam
and will point you to literature.
Whereas there is plenty of literature on introducing the blockchain with-
out any computer science or mathematics we will drill a few levels deeper.
The technology is touching many wonderful subjects such as cryptography,
efficient hash functions and the idea of creating consensus in a truly dis-
tributed network.
By the end you should have a much deeper understanding of the blockchain.
You may also gain some rather fragmented mathematical knowledge suitable
for showing off at cocktail parties.
Morges, August 2019
Thomas Schmelzer
6 CONTENTS
Chapter 1
Warm-Up
Pierre de Fermat
7
8 CHAPTER 1. WARM-UP
and
210 = 1024 ≈ 1000 = 103 .
2a+b = 2a × 2b
and therefore
20 = 1
Using our (not so new) skills we can now estimate big powers of 2.
6 6
264 = 24 × 210×6 = 16 × 210 ≈ 16 × 103 = 1.6 × 1019
1
Mathematicians find this annoying. A correct way to label an analog watch would be
. . . , 10, 11, 0, 1, 2, . . .
1.2. BINARY AND HEXADECIMAL NUMBERS 9
1 # In Python use t h e ∗∗ n o t a t i o n
2 2∗∗256
The numbers 2n − 1 are called the Mersenne numbers. Such numbers are
popular candidates for prime numbers. The largest known prime numbers
today are Mersenne numbers. There’s the GIMPS project (Great Internet
Mersenne Prime Search) to check for primality. Note that the biggest known
prime number today is 282589933 − 1 and comes with 24862048 digits (in base
10). Large Mersenne numbers also play a crucial role in the context of random
number generators, see Mersenne Twister.
1.3. THE RICE AND THE CHESSBOARD 11
We are not too far off the 1.6 × 1019 we have estimated by hand above. The
accuracy is certainly good enough for your interviews in strategy consulting
firms.
Note that 264 − 1 is the 64th Mersenne number, however, it is not a prime
number.
Exercise 3: The rice problem
• Estimate the number of container ships you would need to trans-
port the 264 −1 grains of rice. Note that 1000 grams of rice contain
approximately 50000 grains. Before you start the computation
submit a guess. Make sure you carefully state your assumptions.
1.4 Groups
One of the most familiar groups is the set of integers Z which consists of the
numbers
. . . , −4, −3, −2, −1, 0, 1, 2, 3, 4, . . .
together with the familiar addition. The addition has the following proper-
ties:
• For any two integers a and b, the sum a + b is also an integer. That is,
addition of integers always yields an integer. This property is known
as closure under addition.
• For every integer a, there is an integer b such that a+b = b+a = 0. The
integer b is called the inverse element of the integer a and is denoted
a.
All groups share similar structural aspects. Each group is a pair of an under-
lying set and an operation (e.g. an addition or a multiplication) with the same
properties introduced above. Once demonstrated that a set and a suitable
operation are a group all results for groups carry over.
The order of a group is the number of elements in the underlying set. A
subgroup of G is the pair of a subset of set underlying G and the operation
of G, e.g. G is a subgroup of G. But also set only containing the neutral
element induces a subgroup.
Of particular interest for the blockchain are cyclic subgroups, generated
by an element g of a larger group G:
hgi = {kg | k ∈ Z} .
1.4. GROUPS 13
derlying laws. Once we have done so, we can see whether we can identify
other pairs of sets and operations that behave like groups. Only then we can
start to perform arithmetic. We love arithmetic.
S = {0, 1, 2, 3}
2 × 0 ≡ 0 mod 4
2 × 1 ≡ 2 mod 4
(1.1)
2 × 2 ≡ 0 mod 4
2 × 3 ≡ 2 mod 4
S = {0, 1, 2, 3, 4}
ap−1 ≡ 1 mod p
Z/pZ = {0, 1, . . . , p − 1}
a + b ≡ (a + b) mod p
16 CHAPTER 1. WARM-UP
and
a × b ≡ (a × b) mod p.
The pair Z/pZ and the addition are a group for all p ≥ 1. The pair
Z/pZ \ {0} and the multiplication are a group if and only if p is prime. In
this lecture we are only interested in situations when p is prime. In that
situation, mathematicians call the triple of a set Z/pZ, the addition and the
multiplication (over the reduced set) a finite field.
Exercise 5: Modular arithmetic
We consider the field K = Z/7Z.
a 2a mod 21
0 1
1 2
2 4
3 8
4 16
5 11
6 1
7 2
.. ..
. .
is even and if xr/2 6= 1 mod 21 we have found a non-trivial root of 1 mod 21.
Trivial roots would be 1 and −1.
Given
82 ≡ 1 mod 21
we have found
82 − 1 ≡ 0 mod 21.
But 82 − 1 = (8 − 1) × (8 + 1) = 7 × 9.
Obviously 7 × 9 6= 21 but we see
Schoof’s algorithm was the first deterministic polynomial time (in the size
of the elliptic curve group) algorithm for counting points on elliptic curves.
The algorithm was improved by Elkies and Atkin. We are touching here
bleeding edge mathematics.
So using this particular elliptic curve over this particular finite Galois
fields guarantees results in N being prime. The idea is now to show that those
N points equipped with a suitable addition are a group, e.g. to define the
addition such that the sum of two pairs is still a pair solving the Weierstraß
equation y 2 ≡ x3 + 7 mod p. There is both an algebraic and a geometric
approach to this problem. Any non-trivial cyclic subgroup of this group of
order N has therefore N elements. Hence any element of the group (expect
the neutral element, which is actually the point at infinity) can be used to
generate the entire group.
We need to agree on a pair g = (x, y), e.g. an element of the group and
therefore solution of the Weierstraß equation. The discrete logarithm of this
element will then be 1. For any other element of the cyclic group g 0 = n ∗ g
the discrete logarithm is n. It has been agreed to choose
1 x = 79BE667E F9DCBBAC 55 A06295 CE870B07
3
Elliptic Curves over Finite Fields and the Computation of Square Roots mod p, Math.
Comp., 44(170):483–494, 1985.
1.8. SUMMARY 19
• One solution is given by the point (8, 1). Compute all points of
the group generated by this point. Hint: To perform the addition
use the fastecdsa Python package. What can you say about the
order of this group?
1.8 Summary
It seems we haven’t seen a lot of Blockchain yet. However, our efforts will
soon pay off. Your patience will be rewarded.
We have seen our first elliptic curve in Figure 1.1. It doesn’t look exactly
like a curve and there is no ellipse. Already the name seems to be misleading.
If we would change the underlying field we may get closer to what the name
suggests. For us, an elliptic curve is a huge discrete set of enumerated points.
For the Bitcoin network a first point g has been chosen. To get to the second
point we perform the addition g + g, etc. There are N such points. However,
given a point n × g it is out of question to compute n. There are just too
many points to compute them all and run a brute force attack.
20 CHAPTER 1. WARM-UP
• There’s fantastic material out there on Youtube. For this week I rec-
ommend Computerphile on elliptic curves.
• I have done my private experiments with elliptic curves using this app.
22 CHAPTER 1. WARM-UP
Chapter 2
Cryptography
Evariste Galois
23
24 CHAPTER 2. CRYPTOGRAPHY
hash codes. This already resembles some of the properties of the Bitcoin
network.
Everything you learn in this chapter is useful in a context going far beyond
crypto-currencies.
1
Germany’s cryptography in WW2 was cracked by their habit to sign messages with
the same phrases
26 CHAPTER 2. CRYPTOGRAPHY
• The value s combines the hash of the message and the private key
s = [i−1 (t + rk)] mod N . It is infeasible to extract k given s.
(x1 , y1 ) = u1 G + u2 Kp
where the receiver chooses the coefficients as u1 = ts−1 and u2 = rs−1 . Note
that the receiver recomputes the hash digest t for the message m. It would
not make sense to send t as it is not possible to convert t back into the
message m. The signature is valid if r ≡ x1 mod N , invalid otherwise.
This algorithm is indeed correct as the definition of the public key K = kG
and the choice of coefficients yields
The point (x1 , y1 ) is the familiar ith point of the elliptic curve the receiver
reconstructed without the explicit knowledge of i.
12 # The p u b l i c key i s
13 p u b l i c k e y = c u r v e .G∗ p r i v a t e k e y
28 CHAPTER 2. CRYPTOGRAPHY
14
15 # There a r e n s o l u t i o n s on t h e e l l i p t i c c u r v e
16 # including the point at ” i n f i n i t y ”
17 n = curve . q
18
19 # We send t h e c l e a r message . . .
20 message = ” I l o v e t h i s l e c t u r e ”
21
22 # nonce
23 i = keys . g e n p r i v a t e k e y ( curve )
24
25 # nonce on e l l i p t i c c u r v e
26 P = c u r v e .G∗ i
27
28 # compute t h e s i g n a t u r e
29 r = Mod(P . x , n )
30 i n v i = Mod( i , n ) . i n v e r s e ( )
31 s = ( i n v i ∗ ( e n c r y p t s t r i n g ( message )+r ∗ p r i v a t e k e y ) ) . v a l u e
32 # The s e n d e r t r a n s m i t s ( r , s ) , t h e c l e a r message and h i s p u b l i c
key
33 # s depends on t h e p r i v a t e key and t h e h a s h c o d e o f t h e message .
34 # However i t i s not p o s s i b l e t o e x t r a c t t h e p r i v a t e key from s
35
36 # check the signature
37 w = Mod( s , n ) . i n v e r s e ( )
38 u1 = e n c r y p t s t r i n g ( message ) ∗w
39 u2 = r ∗w
40
41 # a d d i t i o n o f two r e s i d u e c l a s s e s and m u l t i p l i c a t i o n w i t h P o i n t
42 ( c u r v e .G∗u1 + p u b l i c k e y ∗u2 ) . x == r
Now that you understand the concept it’s feasible to treat the digital signa-
ture as a black-box and implement it in a terser way:
1 from f a s t e c d s a . c u r v e import s e c p 2 5 6 k 1 a s c u r v e
2 import f a s t e c d s a . k e y s a s k e y s
3 from h a s h l i b import sha256
4
5 p r i v a t e k e y = keys . g e n p r i v a t e k e y ( curve )
6 p u b l i c k e y = keys . g e t p u b l i c k e y ( private key , curve )
7
8 # We send t h e c l e a r message . . .
9 message = ” I l o v e t h i s l e c t u r e ”
10
2.4. A FIRST BLOCKCHAIN 29
11 # s t a n d a r d s i g n a t u r e , r e t u r n s two i n t e g e r s
12 r , s = e c d s a . s i g n ( message , p r i v a t e k e y , curve , h a s h f u n c=sha256 )
13
14 # s h o u l d r e t u r n True as t h e s i g n a t u r e we j u s t g e n e r a t e d i s v a l i d
.
15 v a l i d = e c d s a . v e r i f y ( ( r , s ) , message , p u b l i c k e y , curve ,
h a s h f u n c=sha256 )
16 assert valid
1 import j s o n
2 from h a s h l i b import sha256
3
4 c l a s s Block ( object ) :
5 def i n i t ( s e l f , message , time , r e f e r e n c e=None ) :
6 s e l f . message = message
7 s e l f . time = time
8 self . reference = reference
9
10 @property
11 def hash ( s e l f ) :
12 x = { ” message ” : s e l f . message , ” time ” : s e l f . time ,
13 ” reference ” : self . reference }
14 return sha256 ( j s o n . dumps ( x ) . encode ( ) ) . h e x d i g e s t ( )
15
16
17 c l a s s Chain ( object ) :
18 def init ( self ) :
19 s e l f . chain = [ ]
20
21 def append ( s e l f , message , time ) :
22 # append a b l o c k t o t h e c h a i n
23
24 # i f t h e r e i s a t l e a s t one b l o c k i n t h e c h a i n
25 i f len ( s e l f . c h a i n ) >= 1 :
26 # compute t h e hash d i g e s t o f t h e l a s t b l o c k
27 r e f e r e n c e = s e l f . c h a i n [ − 1 ] . hash
28 else :
29 r e f e r e n c e = None
30
31 # compute t h e B l o c k
32 b l o c k = Block ( message=message , time=time , r e f e r e n c e=
reference )
33
34 # append i t t o t h e c h a i n
35 s e l f . c h a i n . append ( b l o c k )
36
37 def g e t i t e m ( s e l f , item ) :
38 return s e l f . c h a i n [ item ]
39
40 @property
41 def v a l i d ( s e l f ) :
42 f o r a , b in zip ( s e l f . c h a i n [ : − 1 ] , s e l f . chain [ 1 : ] ) :
43 i f a . hash != b . r e f e r e n c e :
44 return F a l s e
2.5. SYMMETRIC CRYPTOGRAPHY 31
45
46 return True
47
48 c h a i n = Chain ( )
49 c h a i n . append ( message=”A” , time =1)
50 c h a i n . append ( message=”B” , time =2)
51 c h a i n . append ( message=”C” , time =3)
52 c h a i n . append ( message=”D” , time =4)
53
54 # t h e c h a i n i s v a l i d b e c a u s e t h e recomputed hash code
55 # f o r b l o c k n i s matching t h e r e f e r e n c e i n b l o c k n+1
56 a s s e r t chain . valid
57
58 # we c h a i n t h e message o f t h e 3 rd b l o c k
59 # and t h e r e f o r e t h e hash code f o r B l o c k 3
60 # i s not matching t h e r e f e r e n c e i n B l o c k 4
61 c h a i n [ 2 ] . message = ”Thomas was h e r e ”
62 a s s e r t not c h a i n . v a l i d
However, only Maud shall be able to read this message. Therefore Thomas
sends Maud a key 01112 and encrypts his message using the XOR operation
32 CHAPTER 2. CRYPTOGRAPHY
1001 11012
0111 01112
1110 10102
Hence Thomas sends Maud (obviously using two messages) the key 01112
and the encrypted message 1110 10102 Maud is decrypting the message of
Thomas using the same operation used by Thomas:
1110 10102
0111 01112
1001 11012
The problem here is that Thomas has to send the key to Maud. As soon as
an evil man in the middle has the key they can read (or even worse: alter the
message) sent from Thomas to Maud or vice versa. The idea of Diffie and
Hellman was to established a key between two parties without ever sending
the key.
kA kB × G = kB kA × G
This shared key can be used to perform more standard symmetric en-
cryption. The message m will be encrypted and decryption is only possible
for A or B.
1 from f a s t e c d s a . c u r v e import s e c p 2 5 6 k 1 a s c u r v e
2 import f a s t e c d s a . k e y s a s k e y s
3
4 c l a s s User ( object ) :
5 def init ( self ) :
6 # g e n e r a t e a p r i v a t e key i n [ 1 , N−1] where N i s
7 # t h e number o f p o i n t s on t h e e l l i p t i c c u r v e
8 s e l f . p r i v a t e k e y = k e y s . g e n p r i v a t e k e y ( c u r v e=c u r v e )
9
10 def dh ( s e l f , p u b l i c k e y ) :
11 # D i f f i e Hellman key−e x c h a n g e
12 # p u b l i c k e y i s h e r e t h e p u b l i c key o f t h e c o u n t e r p a r t y
13 return s e l f . p r i v a t e k e y ∗ p u b l i c k e y
14
15 @property
16 def p u b l i c k e y ( s e l f ) :
17 # t h e p u b l i c key i s not ( ! ) a random number
18 # t h e p u b l i c key i s t h e $ k $ t h p o i n t on t h e c u r v e
19 # where k i s t h e t h e p r i v a t e key
20 return s e l f . p r i v a t e k e y ∗ c u r v e .G
21
22 A=User ( )
23 B=User ( )
24
25 print (A. dh (B . p u b l i c k e y ) )
26 print (B . dh (A. p u b l i c k e y ) )
27
28 X: 0 xcb414a3d5 . . .
29 Y: 0 xb3d94d167 . . .
30 (On c u r v e <secp256k1 >)
31 X: 0 xcb414a3d5 . . .
32 Y: 0 xb3d94d167 . . .
33 (On c u r v e <secp256k1 >)
2.7 Summary
We have developed machinery to create valid transactions. Valid is a tech-
nical term here. It does not imply that the sender has actually the required
assets. Validity implies that the message m has indeed been sent by the user
with the public key K, e.g. nobody else has tampered with the message or
is pretending to be the user K.
At no stage the private key k should be revealed to a third party. If so,
the third party can indeed successfully pretend to be K.
The digital signature reflects the private key, the content of a message
and an ephemeral key i. It’s most important to never reveal the private key
(or lose it) or apply a weak random number generator (or none if you are
Sony).
Bitcoin is not applying any key-exchange ideas as no encrypted message
are sent around. Bitcoin is surprisingly transparent. Once a public address
of a particular user is known all his or her transactions can be searched for.
Privacy is certainly an issue here.
Key-exchange is useful when sending secret messages across a dirty chan-
nel. Only the receiver and the sender can decrypt the message. No private
keys have to be sent around.
2
Most of them were women
36 CHAPTER 2. CRYPTOGRAPHY
Exercise 7: Summary
• Given the private key 2254 + 264 − 1 compute the public key based
on the secp256k1 curve.
• Explain how using the same nonce twice for a digital signature
explain how the private key could be computed from public data.
In fact, the Sony Playstation 3 used a hard-coded ephemeral key
to avoid the hassle of creating secure random numbers.
• Thomas and Maud are sending each other secret messages. They
are using the elliptic curve from Fig. 1.1. Thomas is sending
Maud his public key (23, 1). Maud is sending Thomas her public
key (18, 20). What is their shared secret key? Hint: Determine
first by careful inspection of the figure the private keys both for
Thomas and Maud.
a
Better discuss this with my friend Eelco Fielo.
Chapter 3
Satoshi Nakamoto
37
38 CHAPTER 3. DISTRIBUTED LEDGER TECHNOLOGY
The root problem with conventional currency is all the trust thats
required to make it work. The central bank must be trusted not
to debase the currency, but the history of fiat currencies is full of
breaches of that trust. Banks must be trusted to hold our money
and transfer it electronically, but they lend it out in waves of
credit bubbles with barely a fraction in reserve. We have to trust
them with our privacy, trust them not to let identity thieves drain
our accounts.
1
The name used by the pseudonymous person or persons who developed bitcoin.
3.2. DISTRIBUTED LEDGERS 39
Bitcoin is opposing the idea of a centralized ledger. It’s relying on the idea
that every node maintains its own ledger — not just a copy of a centralized
ledger. It’s therefore most important that the ledgers are kept in synchro-
nization, e.g. the nodes need to find consensus. Finding consensus in a peer-
to-peer network was a problem that has been solved before but somewhat
Nakamoto managed to pull it all together and create not just a little gem of
a paper but also the first version of the software underlying all nodes.
Nakamoto published the paper in an obscure online forum but he/she/they
failed to give credit to all those academics that have worked on various of the
sub-problems before. The paper and the way it was given to the world was
certainly radical and new. Unlike many academics he/she/they didn’t care
about the publication within a prestigious journal and delivered the paper
with a first version of the product rather than just describing the idea.
Every node will accumulate transactions submitted by other nodes to the
network. A node will verify signatures and only forward valid transactions
to his peers. A node is starting to pile up transactions that do not contradict
each other or spend coins the submitting node wouldn’t have. A node is
trying to compile a block. Each node may compile a slightly different block.
In particular, the block will contain a link to the previous node as a reference.
This could easily result in mayhem. Assume thousands of nodes submit
their blocks in parallel. Here’s a hack to resolve this problem. Each block
contains a Nonce field i. The node creating a block can fill this field with
an arbitrary number! The network will only accept blocks where the hash
digest of the block stays below a threshold. Remember, a hash digest is just
a number. Hence every node will test numerous integer values for i until the
node has found a suitable i. Once the node has found such a nonce such that
the hash digest of the block is below the threshold the miner may or may
not share this block with the network. A miner may decide to hold back the
block, try to mine a second block following his/her block in order to attack
the latest block that just got added. For now we have a somewhat naive
trust in the honesty of actors and assume the miner is publishing the new
block instantaneously to secure his/her coins. Other nodes will then verify
this new block and the game starts again.
The nodes will continue to mine but obviously they have to start from
40 CHAPTER 3. DISTRIBUTED LEDGER TECHNOLOGY
e.g. Michael Rockinger who is not evil (yet). The core idea of the ideology
underlying Bitcoin is to refuse such central authorities. Satoshi Nakomoto
introduced a powerful idea to address this problem without such an authority.
Fulbert sends first 800 coins to Heloise. Maud spots the transaction
and can confirm (using its signature) it is valid. She could confirm the
transaction. A second later Fulbert sends 300 coins to Peter. Thomas detects
the transaction without having seen the transaction for Heloise. He could
confirm the transaction. The order of incoming transactions is somewhat
arbitrary as they do not propagate instantaneously. Speed on the network
depends on geography and the technology used. If both Maud and Thomas
confirm the transactions the situation will be a mess. The entire network
needs to reach consensus.
We have to first abolish the idea of an approach going transaction by
transaction. We go block by block and each block shall consist of hundreds
or thousands of transactions. On average a new block is added every 10
minutes.
We quickly address transaction fees. Fulbert sending 800 coins to Heloise
will actually send 801.5 coins away. The difference of 1.5 coins is a transaction
fee and it will go to the node releasing the block with Fulbert’s transaction.
If Fulbert is not sending any transaction fee, no other node would be keen
to include Fulbert’s transaction in a block. Each block can take only a very
limited number of transactions. Note that Fulbert can decide how much
transaction fee he is offering. There is no automatic rate.
Each node maintains a mempool of valid transactions. Typically all those
pools are slightly different. As indicated above Thomas has seen the trans-
action for Peter before the transaction for Heloise. He may miss certain
transactions Maud is aware of or vice versa. Also Thomas may consider only
transaction with a more healthy transaction fee.
Thomas may hold enough transactions for 3 blocks in his pool. Maud
could even fill 4 blocks. A block consists of
• a version number
• a reference to a previous block.
• a timestamp
• the threshold parameter
42 CHAPTER 3. DISTRIBUTED LEDGER TECHNOLOGY
The mining problem is simple. Each node is trying to find an integer such
that the Hash digest of the entire block is below the threshold. Over the
years the threshold got smaller and therefore the mining problem got a lot
harder.
Let’s assume the block k = 1211 has just been released by Maud. All the
other nodes need to erase transactions from their lists that are contained in
Maud’s block. In an ideal world they all start to work on block k = 1212.
In fact, they certainly couldn’t precompute the block k = 1213 as this block
will need a reference to the block k = 1212 which does not exist yet.
Thomas now takes the transactions that haven’t been covered by Maud
and are still in his list and computes a Hash Digest for them. For the next
few minutes Thomas is busy computing hash values until he manages to stay
below the threshold. All transactions that pop up while Thomas is computing
hash values are for now ignored but make it on his private list of pending
trades.
As we all know Fulbert is a somewhat evil character he will ignore Maud’s
recent block and will not try to compute block k = 1212. Indeed, he decides
to compute an alternative block k = 1211 which may not contain a huge
transaction he has made to poor Peter.
Let’s assume Fulbert succeeds and a few seconds after Maud publishes
his block k = 1211. Most other participants still try to compute k = 1212
based on Maud’s block but Fulbert is very powerful. He is now racing to
compute k = 1212 based on his k = 1211 block. Fulbert may release a valid
k = 1212 block before everybody else. He is attacking Maud’s 1211 block
by releasing two blocks. Since Fulbert is so much richer he has a lot more
hashpower and the network essentially becomes centralised.
Chapter 4
Money
Stephen Colbert
Drawbacks of cash?
Should transactions be transparent?
What is money? Is Bitcoin money?
What 3 properties define money Is US Dollar a good store of value
43