This article discusses the blockchain and Hyperledger Fabric, and how the two can be used to build and operate an efficient software solution on IBM Cloud.
According to the blockchain statistics released by FinancesOnline, by February 2021, around 620.37 million blockchain transactions had been recorded globally, with North America accounting for 46 per cent of these. Banking topped the list of global top blockchain investors with a 29.7 per cent share, followed by process manufacturing and discrete manufacturing with 11.4 and 10.9 per cent, respectively. According to current market trends, the United States and Western Europe will invest around US$ 4.2 billion and 2.9 billion in blockchain technologies, respectively, by the year 2022.
As per the 2020 Blockchain Global Patent Authorization report, 3924 blockchain technology patents have been filed, with the US leading at 39 per cent, Korea at 21 per cent and China at 19 per cent. Alibaba leads with 212 blockchain patents, followed by IBM’s 136.
IBM has been an initiator in so many ways – hiring the first disabled employee way back in 1914, building the IBM baseball team in 1929, hiring women systems service professionals in 1935, developing the commercial electronic multiplier in 1946, setting up its first office in India in 1951, and so on. Inspired by the success of blockchain and just a decade and a half into the 21st century, IBM has contributed to Hyperledger Fabric.
Blockchain and Hyperledger
As we work our way through the maze of technology, we’ll start with the basics: blockchain and ledger. Storage of data was previously restricted mostly to traditional databases. Blockchain evolved as an information recording system. The data in a blockchain is updated and synchronised in real time. Its inherent characteristic is its robustness against hacking and fraud.
The blockchain is neither supervised nor managed by a person, thus making it a decentralised entity. Everyone can access it; thereby, it is permissionless. Every transaction is a timestamped record, and complete proprietorship of records is maintained in a fully confidential manner. A novel way of writing data into blockchain involves encoding the data as an address and later directing a transaction to that receiver address instead of using the payload. Advanced cryptographic algorithms ensure complete safety of the data inside the blockchain. It is due to this encryption and verification that blockchains are comparatively slower than databases. Blockchain is lauded in the financial and business worlds, where decentralisation, monetary transactions, and trusted data verification are top priorities. It provides a platform to verify and audit transactions through multiple supply chain partners. Every new day brings advancements in blockchain technology (BCT).
As per Deloitte’s Global Blockchain Survey (2020), the penetration of blockchain technologies in production has jumped from 23 per cent in 2019 to 39 per cent in 2020. Sixty-four per cent of the respondents opted for enterprise controlled digital assets, 59 per cent for decentralised cryptocurrencies, and 54 per cent for algorithm driven stablecoins. According to the same survey, respondents from China, Brazil and the United Arab Emirates expect digital assets will replace fiat currencies by almost 90 per cent in the next 5 to 10 years. Respondents from Singapore, Ireland, and Israel say the replacement will be 80 per cent. Apart from tax and regulatory concerns about digital asset usage, 66 per cent of respondents say that cybersecurity issues are preventing widespread implementation.
Based on their inherent characteristics, blockchains are classified as public, private and consortium (hybrid) blockchains (Table 1).
Features | Public | Private | Consortium |
Participation | Without permission | By permission | |
Centralisation | None | Partial | |
Member | Anyone | By invitation | Membership with partial access |
Ledger | Open | Selective openness | |
Security | Weak | Controlled by administrator | |
Consensus | Proof of work | Proof of work | |
Legal ownership | None | Owner | Selected nodes |
Tampering | None | Members can collaborate to alter ledger | None |
Computation | High | Medium | Medium |
Network dimension | Large | Small | Medium |
Examples | Bitcoin, Litecoin, Ethereum | Corda, Hyperledger Fabric, Quorum | Ripple, IBM Food Trust |
Table 1: Classification of blockchain
In the crypto industry, the public blockchain is the most well-known and Ethereum the most popular. Solidity is Ethereum’s own coin and programming language. It is commonly employed in the fields of business, finance, and entertainment. Quorum is an open source technology that is used in private blockchain networks, where a single node is held by a single member of the network. Quorum is a revised version of Ethereum where the Geth client is modified. Corda is a permission based blockchain platform which uses DLT applications. Its transactions are strictly private and it provides multi-party transparency. Corda, Quorum and Hyperledger Fabric are referred to as enterprise blockchains with data privacy as their topmost priority. Ethereum enjoys an independent role for specific applications. Hyperledger Fabric is well known for its modular and extendable architecture in various companies and Corda has wide acceptance in the financial services industry.
Distributed ledger technology (DLT) provides a backup to facilitate replication of data. The ledger, an integral distributed branch, is shared and synchronised across multiple platforms with simultaneous access for multiple users. However, once a piece of data gets logged to a ledger it can neither be edited (immutability) nor be removed from the database. This is how the system design is executed. Properties of DLT that enable the blockchain to operate in a modular manner are listed in Table 2.
Properties | Description |
Anonymous | Identity of participants is kept pseudonymous |
Distributed | Every participant of a network has a copy of a ledger to ensure transparency |
Immutable | Validated records are irreversible and cannot be changed |
Programmable | A blockchain is programmable (such as smart contracts) |
Secure | Encryption of all records is made individually |
Timestamped | A transaction timestamp is recorded on a block |
Unanimous | Every participant of a network agrees to the validity of each of the records |
Table 2: Properties of DLT
Programming languages for smart contracts in distributed ledger technology are listed in Table 3. Each has at least one unique characteristic.
Distributed ledger technology | Programming languages |
Ethereum network | Solidity |
Quorum | Solidity |
Corda | Kotlin, Java |
Hyperledger Fabric | Go, Java, JavaScript |
Table 3: Programming languages used for DLT
Hyperledger Fabric
A modular blockchain framework known as Hyperledger Fabric acts as a base for developing blockchain products and applications through plug-and-play components mainly meant to target private enterprises.
Hyperledger Fabric is an open source distributed ledger framework launched by the Linux Foundation that provides a versatile client utility based on consensus, privacy and membership services. The speed of a transaction is high when there are a smaller number of nodes.
Consider, for example, a seller who wishes to sell products at different rates to various clients using the same platform. It is imperative that the rates be kept discreet (private) among the several buyers. This is possible using the ‘channels’ feature of Hyperledger Fabric. For complete isolation of transactions, the ‘private data’ feature can be explored, where hashes are shared on the ledger as proof of transaction (‘private data’ is allowed to be shared amongst ‘collection members’). Hyperledger supports membership of specified chains with permission from peers.
As evident from Figure 4, Hyperledger Fabric segregates the transaction process into three parts – smart contracts, transaction ordering, and transaction validation and commitment. This permits scalability across the network and also in the trust and verification levels, thereby increasing the performance efficiency manifold. The plug-and-play concept permits the reusability of existing features to integrate readymade modules in it. Endorsers (simulate, sign or reject transactions), consenters (complete PBFT or practical byzantine fault tolerance protocol on the transactions) and committers (receive the batch of transactions and write to the ledger) ensure the robustness of the system. This is something identical to using design architectures like VGG 16 in deep learning, using transfer learning techniques for our desired applications.
A permissioned system is linked to a strong identity management system, with users and validators assigned to different roles. New strings of codes (chain codes) are deployed and invoked during transactions that are processed by validators through consensus. Whenever a new transaction request is initiated according to the endorsement policy, a block of data gets transferred to the committer who validates the data and checks for conflicting interests. The transaction is then committed to the ledger once it is approved by both sides. The ledger indicates the net total transactions and the hash — the global state.
Blockchain-as-a-service (BaaS) provides a platform for enterprise blockchain such as Hyperledger. Thus, a customer with access can easily create, deploy and manage an enterprise blockchain on IBM Cloud. The application will create a block and store it in the blockchain by generating a chaincode. The block is then updated and stored in a ledger.
The following features – pluggable consensus, permissioned architecture, high modularity, open source, flexibility towards implementation, low latency of confirmation, queryable data (key-based queries and JSON queries), and support for EVM and Solidity further empower Hyperledger Fabric. To add to this, the community of world class technology providers, individual collaborators and researchers all over the globe contribute to the diverse ecosystem by providing additional support for multiple languages like Go, Java and JavaScript.
IBM Bluemix is the IBM open cloud platform that offers platform-as-a-service (PaaS) access to Web developers and mobile developers through Cloud Foundry open technology on SoftLayer infrastructure. The cloud architecture is scalable on demand subject to workloads, and the storage could be public, private or hybrid. Bluemix supports Java, Node.js, Go, PHP, Swift, Python, Ruby on Rails, and can be extended as a support language through Buildpack (compile your app for launch) usage. Figure 5 illustrates the flow of IBM Bluemix.
Using software-as-a-service, deploying a blockchain via Bluemix provides benefits in terms of building, operating, governing and growing a solution on a multi cloud, hybrid cloud or on-premise environment. Single node deployment gives better granular control. Users have access to their private keys and Visual Studio IDE supports the development of smart contracts.