Algorithm 2
The GHOST backbone protocol, parameterized by the input contribution function I(ยท) and the reading function R(ยท). xC is the vector of inputs of all block in chain C.
T GenesisBlock . T is a tree.
state <- ฮต
round <- 0
while True do
Tnew <- update(T , blocks found in Receive())
C <-ห GHOST(Tnew)
hstate, xi <- I(state, Cห, round, Input(), Receive())
Cnew <- pow(x, Cห)
if C 6 ห = Cnew or T 6= Tnew then
T <- update(Tnew, head(Cnew))
Broadcast(head(Cnew))
end if
round <- round + 1
if Input() contains Read then
write R(xC) to Output()
end if
end while
Algorithm 2 Explained:
For completeness' sake, we now go over the remaining steps in the GHOST backbone protocol. Function update (see Algorithm 4) refers to how the block tree is updated. Function pow (see Algorithm 3), which has to do with block mining, is the same as the one described in the Bitcoin Backbone.
Last updated