Hybrid Blockchain

On the one hand, public blockchains are considered slow and expensive, and they require high computational power. On the other hand, private blockchains have a limited number of participants, with limited privileges, while also having a more centralized nature, which leaves them prone to manipulation by malicious actors. However, both types also have efficient characteristics. This has led researchers to invent a mixture of public and private blockchain, known as a hybrid blockchain. This type of blockchain combines the efficient qualities of both types of blockchains, while attempting to reduce their flaws. Thus, state institutions, enterprises, and stakeholders can use such a technology to limit access privileges to trusted authorities, for example, to perform modifications and maintenance on some information or data within the private/concealed section, while exposing unconcealed information and transactions to the public, to read and verify it, in terms of transparency. XinFin is a real-world example of a hybrid blockchain [28].

Classification Scheme

In this section, we propose a scheme of private and public infrastructures classified by access, speed, security, identity, asset, cost, energy consumption, and approval frequency, as illustrated in Table 6.1.

Blockchain Mechanism

This section dives deeper into the blockchain's architecture and operational mechanism, to show how it works and how it could enhance data security.

Cryptography

Blockchain is composed of interconnected blocks concatenated cryptographically to each other in sequence. As illustrated in Figure 6.3, each block consists of two parts: (1) a block header and (2) block contents:

1. Block header

a. Version

b. Timestamp

TABLE 6.1

Permissionless and Permissioned Blockchains: Comparison

Characteristic

Public

Private

Access

Does not require ReadAVrite privilege to participate (public/permissionless)

Requires permission to ReadAVrite (permissioned/restricted)

Speed

Slower

Faster

Security

Proof of Work. Proof of Stake, etc.

Preapproved participants

Identity

Anonymous/Pseudonymous

Known/identified identities

Asset

Native asset

Any asset

Cost

High cost

Lower cost

Energy consumption

Large energy consumption

Lower energy consumption

Approval time

Long transaction-approval time

Long transaction-approval time

A single block of a blockchain

FIGURE 6.3 A single block of a blockchain.

c. Previous block hash, which is the link that connects a block to the previous one in the chain, as shown in Figure 6.3.

d. Nonce, a term for a “number only used once,” which is a number added to a block incrementally, until a challenge is found that gives the block’s specified hash zero bits [ 1 ].

e. Difficulty

f. Merkle tree root, which is a hash of the selected transactions to be part of the block, combined computationally in a Merkle root tree.).

2. Block contents, i.e., a list of transactions.

A blockchain’s structure provides assurance of the integrity of the stored transactions and the entire chain to the very first block (the “genesis block”). A genesis block (block 0) is the first block of a blockchain, which is almost hardcoded into every application that employs the blockchain.

A block’s contents of header and body are encrypted, to aggregate a unique hash value, “block hash,” for that block, to achieve block integrity, as well as being stored in the next block, as shown in Figure 6.4.

The adoption of the SHA256 encryption algorithm provides an excellent advantage, where the length of the hash is constant and unique regardless of the input, any miner change leads to an alteration in the hash value. Besides, any change in the hash values of the blocks leads to the collapse of the chain. This remarkable structure, one of the masterpieces of this technology, is also one of the most important protection features that have been contributed to the cybersecurity world.

Blockchain hashing

FIGURE 6.4 Blockchain hashing.

Peer-to-Peer Distributed Network

The term peer-to-peer (P2P) refers to the exchange of values between peers via a distributed network. A P2P platform enables network participants to execute trades directly between each other, without requiring intermediaries. P2P network architecture is an important quality of distributed ledger technology. A peer, also known as a node, is any device connected voluntarily to the network (i.e., computer, mobile, etc.), which is responsible for verifying transactions and can create blocks. Once a device participates in the network, it receives a synchronized replica of the block- chain. Each node is an administrator that performs the same work, like all the other nodes. Each node has an incentive for joining the network; for example, considering cryptocurrencies, it will have an equal opportunity to mine Bitcoins or Ethereum, according to the protocol of the competition.

In P2P networks, distributing transactions initiates by defining consensus protocol [25]. There are many types of competition protocols used in permissionless and per- missioned blockchains, such as PoW (Proof of Work), PoS (Proof of Stake), DPoS (Delegated Proof of Stake), PBFT (Practical Byzantine Fault Tolerance), and so on [25]. Proof of Work and Proof of Stake are the protocols best known today for mining cryptocurrencies in the financial industry.

Proof of Work [29]: PoW is a mining algorithm used to validate/confirm transactions in the original blockchain, to produce new blocks into the chain. The concept of PoW has existed since the mid-1990s. It was submitted in 1996 by Adam Back under the name of "Hashcash" [30]. This mechanism enables the anonymous peers of a network to reach an agreement, while ensuring security. In this mechanism, a miner has to find a block hash result that starts with a number of zeros, which reflects the number of miners on the network. The greater the number of zeros, the more difficult it is for the miner to find the result. This mechanism is also applied in Bitcoin’s blockchain, to force miners to compete against each other to decide who wins the competition, according to the mining process speed. The winner, i.e., the first to create the block, is rewarded for achieving the distributed consensus to extend the blockchain.

The term consensus refers to the process of gaining approval votes from network participants to decide whether the newly created block is valid, to accept the new (extended) blockchain as the longest version. In permissionless blockchain, anyone can create a block, whether is it valid or not, regardless of its legitimacy. Thus, this protocol serves to warrant the integrity and validity of the chain, by verifying the legitimacy of the new block, along with the transactions included in it, at the same time preventing double-spending attempts. This algorithm is currently being used by many cryptocurrencies, starting with Bitcoin, Ethereum, and others. However, the disadvantage of this protocol is that it requires tremendous computational time and high-power computing hardware.

Proof of Stake [31]: The PoS algorithm achieves the same objective as the PoW distributed consensus; however, the mechanism of the miners’ competition is different from that of PoW. This algorithm also forces miners to compete against each other by betting a certain amount of coins as their stake in the network. The more a miner bets, the greater his chances of winning the competition to create blocks and receive rewards. In order to prevent the wealthiest node or miner in the network from always winning, the process implements "Randomized Block Selection” and “Coin Age Selection” methods.

This peer-to-peer network is based on strong synchronization, i.e., any change occurring in one node notifies the neighboring nodes, and hence 51 percent of network nodes must agree that the update is valid, using a consensus algorithm. Then, every node within the network overwrites its replica with the latest copy of the updated blockchain. In case the update is manipulated or incorrect (i.e., the chain is broken), the network will exclude the corrupted node or destroy the modified version, to overwrite it with the distributed confirmed version of the blockchain.

Smart Contracts

The smart contract (also known as a crypto-contract) was first introduced by Nick Szabo in 1994 [32]. In his paper, he defined smart contracts as computerized transaction protocols self-executing the terms of a contract. Later on, in 2008, Nakamoto introduced smart contracts also as computer code, but running on top of a block- chain, directly controlling the transfer of digital assets and enforcing an agreed-upon performance between the two parties under the terms of the contract [33]. This is the simplest form of decentralized automation. Smart contracts are very complex electronic contracts, where the functionality extends beyond the transfer of assets, to carry out transactions in a wide range of domains, such as premiums, property, legal processes, collective financing agreements, and so on [34]. Smart contracts enable efficient characteristics for the executed transactions, such as traceability, transparency, and irreversibility. In addition, this type of contract is executed directly by the contracting parties themselves, which facilitates the need to run a lot of routine

Smart contract, example

FIGURE 6.5 Smart contract, example.

processes and saves the expense of arranging for third-party services, such as those provided by lawyers or banks, or incurring large fees, as shown in Figure 6.5.

 
Source