2 Blockchain Architecture: 2.1 Block
2 Blockchain Architecture: 2.1 Block
a technical report about blockchain (NRI, 2015). In contrast to (NRI, 2015), our paper
focuses on state-of-art blockchain studies including recent advances and future trends.
This paper is an extended version of the work published in Zheng et al. (2017) with the
substantial extensions on blockchain technical details, consensus algorithms, applications
of blockchains, research challenges and future directions.
The rest of this paper is organised as follows. Section 2 introduces blockchain
architecture. Section 3 shows typical consensus algorithms used in the blockchain. Section 4
introduces several typical blockchain applications. Section 5 summarises the technical
challenges and the recent advances in this area. Section 6 discusses some possible future
directions and Section 7 concludes the paper.
2 Blockchain architecture
The blockchain is a sequence of blocks, which holds a complete list of transaction records
like conventional public ledger (Lee Kuo Chuen, 2015). Figure 1 illustrates an example of
a blockchain. Each block points to the immediately previous block via a reference that is
essentially a hash value of the previous block called parent block. It is worth noting that
uncle blocks (children of the block’s ancestors) hashes would also be stored in ethereum
blockchain (Buterin, 2014). The first block of a blockchain is called genesis block which
has no parent block. We then introduce the block structure in Section 2.1, a digital signature
mechanism in Section 2.2. We also summarise blockchain key characteristics in Section 2.3.
Blockchain taxonomy is showed in Section 2.4.
Figure 1 An example of blockchain which consists of a continuous sequence of blocks (see online
version for colours)
2.1 Block
A block consists of the block header and the block body as shown in Figure 2. In particular,
the block header includes:
Each user owns a pair of private key and public key. The private key is used to sign the
transactions. The digital signed transactions are spread throughout the whole network and
then are accessed by public keys, which are visible to everyone in the network. Figure 3
shows an example of digital signature used in blockchain. The typical digital signature is
involved with two phases: the signing phase and the verification phase. Take Figure 3 as
an example again. When a user Alice wants to sign a transaction, she first generates a hash
value derived from the transaction. She then encrypts this hash value by using her private
key and sends to another user Bob the encrypted hash with the original data. Bob verifies the
received transaction through the comparison between the decrypted hash (by using Alice’s
public key) and the hash value derived from the received data by the same hash function as
Alice’s. The typical digital signature algorithms used in blockchains include elliptic curve
digital signature algorithm (ECDSA) (Johnson et al., 2001).
Figure 3 Digital signature used in blockchain (see online version for colours)
Blockchain challenges and opportunities: a survey 357
2.3 Key characteristics of blockchain
Since public blockchain is open to the world, it can attract many users. Communities are also
very active. Many public blockchains emerge day by day. As for consortium blockchain, it
could be applied to many business applications. Currently, Hyperledger (hyperledger, 2015)
is developing business consortium blockchain frameworks. Ethereum also has provided
tools for building consortium blockchains (ethereum, n.d.). As for private blockchain, there
are still many companies implementing it for efficiency and auditability.
Table 1 Comparisons among public blockchain, consortium blockchain and private blockchain
3 Consensus algorithms
Proof of work (PoW) is a consensus strategy used in Bitcoin network (Nakamoto, 2008).
POW requires a complicated computational process in the authentication. In POW, each
node of the network is calculating a hash value of the constantly changing block header.
The consensus requires that the calculated value must be equal to or smaller than a certain
given value. In the decentralised network, all participants have to calculate the hash value
continuously by using different nonces until the target is reached. When one node obtains
the relevant value, all other nodes must mutually confirm the correctness of the value. After
that, transactions in the new block would be validated in case of frauds. Then, the collection
of transactions used for the calculations is approved to be the authenticated result, which
is denoted by a new block in the blockchain. The nodes that calculate the hashes are called
miners and the POW procedure is called mining. Since the calculation of the authentication
is a time-consuming process, an incentive mechanism (e.g., granting a small portion of
Bitcoins to the miner) is also proposed (Nakamoto, 2008).
In the decentralised network, valid blocks might be generated simultaneously when
multiple nodes find the suitable nonce nearly at the same time. As a result, branches (or forks)
may be generated as shown in Figure 4. However, it is unlikely that two competing forks will
generate next block simultaneously. In POW protocol, a chain that becomes longer thereafter
is judged as the authentic one. Take Figure 4 as an example again. Consider two forks
created by simultaneously validated blocks B11 and G11. Miners work on both the forks
and add the newly generated block to one of them. When a new block (say B12) is added to
block B11, the miners working on fork G11-G12 will switch to B12. Block G12 in the fork
G11-G12 becomes an orphan block since it is no longer increased. Generally, after a certain
number of new blocks are appended to the blockchain, it is nearly impossible to reverse
the blockchain to tamper the transactions. In Bitcoin blockchain, when approximately six
blocks are generated, the relevant blockchain is considered to be the authentic one (e.g., the
chain of blocks B11, B12, B13, B14, B15 and B16 in Figure 4). Block interval depends on
different parameter setting. Bitcoin block is generated about every 10 min while Ethereum
block is generated about every 17 s.
Figure 4 An scenario of blockchain branches (the longer branch would be admitted as the main
chain while the shorter one would be deserted) (see online version for colours)
!"#$%&'(")#$*+*,-.%"-/$01'/"-2"1,'"*$(('*1"$%'
*## *#%
Miners have to do a lot of computer calculations in PoW, yet these works waste too much
resources. To mitigate the loss, some PoW protocols in which works could have some side-
applications have been designed. For example, Primecoin (King, 2013) searches for special
prime number chains which can be used for mathematical research. Instead of burning
electricity for mining the POW block, proof of burn (P4Titan, 2014) asks miners to send
360 Z. Zheng et al.
their coins to addresses where they cannot be redeemed. By burning coins, miners get
chances for mining blocks and they do not need powerful hardwares as POW.
Proof of stake (PoS) is an energy-saving alternative to POW. Instead of demanding users
to find a nonce in an unlimited space, POS requires people to prove the ownership of the
amount of currency because it is believed that people with more currencies would be less
likely to attack the network. Since the selection based on account balance is quite unfair
because the single richest person is bound to be dominant in the network. As a result, many
solutions are proposed with the combination of the stake size to decide which one to forge
the next block. In particular, Blackcoin (Vasin, 2014) uses randomisation to predict the next
generator. It uses a formula that looks for the lowest hash value in combination with the
size of the stake. Peercoin (King and Nadal, 2012) favours coin age-based selection. In
Peercoin, older and larger sets of coins have a greater probability of mining the next block.
Compared with PoW, PoS saves more energy and is more effective. Unfortunately, as the
mining cost is nearly zero, attacks might come as a consequence. Many blockchains adopt
PoW at the beginning and transform to PoS gradually. For instance, Ethereum is planning
to move from Ethash (a kind of PoW) (Wood, 2014) to Casper (a kind of PoS) (Zamfir,
2015). To combine the benefits of POW and POS, proof of activity (Bentov et al., 2014) is
proposed. In proof of activity, a mined block needs to be signed by N miners to be valid.
In that way, if some owner of 50% of all coins exists, he/she cannot control the creation of
new blocks on his/her own. Sometimes stake could be other things, for example, in proof of
capacity (burstcoin, 2014), miners have to allocate large hard drive space to mine the block.
Practical byzantine fault tolerance (PBFT) is a replication algorithm to tolerate byzantine
faults (Miguel and Barbara, 1999). Hyperledger Fabric (hyperledger, 2015) utilises the
PBFT as its consensus algorithm since PBFT could handle up to 1/3 malicious byzantine
replicas. A new block is determined in a round. In each round, a primary would be selected
according to some rules. And it is responsible for ordering the transaction. The whole process
could be divided into three phase: pre-prepared, prepared and commit. In each phase, a node
would enter next phase if it has received votes from over 2/3 of all nodes. So PBFT requires
that every node is known to the network. Like PBFT, Stellar consensus protocol (SCP)
(Mazieres, 2015) is also a Byzantine agreement protocol. There is no hashing procedure in
PBFT. In PBFT, each node has to query other nodes while SCP gives participants the right
to choose which set of other participants to believe. Based on PBFT, Antshares (antshares,
2016) has implemented their delegated byzantine fault tolerance (dBFT). In dBFT, some
professional nodes are voted to record the transactions instead of all nodes.
Delegated proof of stake (DPOS). Similar to POS, miners get their priority to generate
the blocks according to their stake. The major difference between POS and DPOS is that
POS is a direct democratic while DPOS is representative democratic. Stakeholders elect
their delegates to generate and validate a block. With significantly fewer nodes to validate
the block, the block could be confirmed quickly, making the transactions confirmed quickly.
Meanwhile, the parameters of the network such as block size and block intervals could
be tuned. Additionally, users do not need to worry about the dishonest delegates because
the delegates could be voted out easily. DPOS has already been implemented, and is the
backbone of Bitshares (bitshares, n.d.).
Ripple (Schwartz et al., 2014) is a consensus algorithm that utilises collectively-trusted
subnetworks within the larger network. In the network, nodes are divided into two types: a
server for participating consensus process and client for only transferring funds. In contrast
to that PBFT nodes have to ask every node in the network, each Ripple server has a Unique
Node List (UNL) to query. UNL is important to the server. When determining whether to
Blockchain challenges and opportunities: a survey 361
put a transaction into the ledger, the server would query the nodes in UNL. If the received
agreements have reached 80%, the transaction would be packed into the ledger. For a node,
the ledger will remain correct as long as the percentage of faulty nodes in UNL is less than
20%.
Tendermint (Kwon, 2014) is a byzantine consensus algorithm. A new block is
determined in a round. A proposer would be selected to broadcast an unconfirmed block in
this round. So all nodes need to be known for proposer selection. It could be divided into
three steps:
• Prevote step. Validators choose whether to broadcast a prevote for the proposed
block.
• Precommit step. If the node has received more than 2/3 of prevotes on the proposed
block, it broadcasts a precommit for that block. If the node has received over 2/3 of
precommits, it enters the commit step.
• Commit step. The node validates the block and broadcasts a commit for that block. if
the node has received 2/3 of the commits, it accepts the block.
The process is quite similar to PBFT, but Tendermint nodes have to lock their coins to
become validators. Once a validator is found to be dishonest, it would be punished.
Different consensus algorithms have different advantages and disadvantages. Table 2 gives
a comparison between different consensus algorithms and we use the properties given by
(Vukolić, 2015).
• Node identity management. PBFT needs to know the identity of each miner in order
to select a primary in every round while Tendermint needs to know the validators in
order to select a proposer in each round. For PoW, PoS, DPOS and Ripple, nodes
could join the network freely.
• Energy saving. In PoW, miners hash the block header continuously to reach the target
value. As a result, the amount of electricity required to process has reached an
immense scale. As for PoS and DPOS, miners still have to hash the block header to
search the target value but the work has been largely reduced as the search space is
designed to be limited. As for PBFT, Ripple and Tendermint, there is no mining in
the consensus process. So it saves energy greatly.
• Tolerated power of the adversary. Generally 51% of hash power is regarded as the
threshold for one to gain control of the network. But selfish mining strategy (Eyal
and Sirer, 2014) in PoW systems could help miners to gain more revenue by only
25% of the hashing power. PBFT and Tendermint are designed to handle up to 1/3
faulty nodes. Ripple is proved to maintain correctness if the faulty nodes in a UNL is
less than 20%.
• Example. Bitcoin is based on PoW while Peercoin is a new peer-to-peer PoS
cryptocurrency. Further, Hyperledger Fabric utilises PBFT to reach consensus.
Bitshares, a smart contract platform, adopts DPOS as their consensus algorithm.
Ripple implements the Ripple protocol while Tendermint devises the Tendermint
protocol.
362 Z. Zheng et al.
PBFT and Tendermint are permissioned protocols. Node identities are expected to be known
to the whole network, so they might be used in commercial mode rather than public. PoW
and PoS are suitable for public blockchain. Consortium or private blockchain might have
preference for PBFT, Tendermint, DPOS and Ripple.
A good consensus algorithm means efficiency, safety and convenience. Current common
consensus algorithms still have many shortages. New consensus algorithms are devised
aiming to solve some specific problems of the blockchain. The main idea of PeerCensus
(Decker et al., 2016) is to decouple block creation and transaction confirmation so that
the consensus speed can be significantly increased. Besides, Kraft (Kraft, 2016) proposed
a new consensus method to ensure that a block is generated in a relatively stable speed.
It is known that high blocks generation rate compromise Bitcoin’s security. So the
Greedy Heaviest-Observed Sub-Tree (GHOST) chain selection rule (Sompolinsky and
Zohar, 2013) is proposed to solve this problem. Instead of the longest branch scheme,
GHOST weights the branches and miners could choose the better one to follow. Chepurnoy et
al. (Chepurnoy et al., 2016) proposed a new consensus algorithm for peer-to-peer blockchain
systems where anyone who provides non-interactive proofs of retrievability for the past
state snapshots is agreed to generate the block. In such a protocol, miners only have to store
old block headers instead of full blocks.
4 Applications of blockchain
xFinancial Services
xSecurity Enhancement xEnterprise Transformation
xPrivacy Protection Finance xP2P Financial Market
x... xRisk Management
xĊ
xE-business
Security xSafety and Privacy
and IoT x...
Privacy Blockchain
(Applications)
Public and
Reputation Social xLand Registration
System xEnergy Saving
Service
xAcademics xEducation
xWeb Community xFree-Speech Right
x... x...
4.1 Finance
• E-business. Zhang and Wen (2015) propose a new IoT E-business model and realise
the transaction of smart property based on blockchain and smart contract. In this
model, distributed autonomous corporations (DAC) is adopted as a decentralised
transaction entity. People trade with DACs to obtain coins and exchange sensor data
without any third party.
• Safety and privacy. Safety and privacy preservation is another important concern for
IoT industry. Blockchain can also help in improving privacy in IoT applications. In
particular, Hardjono and Smith (2016) proposed a privacy-preserving method for
commissioning an IoT device into a cloud ecosystem. More specifically, a new
architecture was proposed in Hardjono and Smith (2016) to help the device to prove
its manufacturing provenance without the authentication of the third party and it is
allowed to register anonymously. Besides, in IBM (2015), IBM unveiled its proof of
concept for Autonomous Decentralised Peer-to-Peer Telemetry (ADEPT), which is a
system using blockchain technologies to build a distributed network of devices. In
ADEPT, appliances in the home would be able to identify operational problems and
retrieve software updates on their own.
Blockchains can also be used for other public services such as marriage registration, patent
management and income taxation systems (Akins et al., 2013). In the new public services
integrated with blockchains, mobile devices with digital signature embedded may replace
seals to be affixed on documents, which are submitted to administrative departments. In this
way, extensive paperwork can be greatly saved.
Reputation is an important measure on how much the community trusts you. The greater
your reputation, the more trustworthy you are regarded by others. The reputation of a person
can be evaluated on his or her previous transactions and interactions with the community.
There is a rising number of cases of personal reputation records falsification. For example,
in e-commerce, many service-providers enroll a huge number of fake customers to achieve
a high reputation. Blockchain can potentially solve this problem.