Blockchain technology is expected to revolutionalize how our industries and enterprises operate. Experts estimate that it will business process flows and enable organizations to build products and services that are more secure, transparent, fraud-resistant, and cost-efficient. Banking and financial enterprises and start-ups have been the first to experiment with and adopt this disruptive technology. Reports and surveys suggest that, within the next decade, these organizations will go through rapid stages of innovation to establish blockchain as the Backbone for their day-to-day operations and the services they offer to their customers. In this book, we'll be looking at some prominent applications of this technology for the banking and finance industry through projects. Each project is implemented using a popular distributed ledger platform.
By the end of the book, you will have a better understanding of how to leverage blockchain technology to build applications for financial use cases. You will also have sufficient knowledge of building blockchain solutions using the Ethereum, Hyperledger Fabric, and Stellar distributed ledger platforms.
In this chapter, we'll be looking at the current state of financial systems and how blockchain can make a difference. We'll also try to understand how to approach implementing such a solution and some of the popular blockchain platforms we can consider for developing a financial application. The topics covered are as follows:
The global banking and financial system plays a huge role in the life of the modern human being. It moves more than a trillion dollars around the world in a day, and more than a billion people are directly or indirectly served by it every day. It is the backbone of global trade finance and it enables enterprises, from start-ups to conglomerates, to run their businesses smoothly in any part of the world. The technology that makes this ecosystem tick has evolved in leaps and bounds in the last two decades, especially with the advent of the internet.
However, owing to compliance restrictions, reliance on legacy systems, and a conservative outlook on technology, most banking IT systems today are yet to adapt to advancements in technology and are unable to keep up with the nefarious means employed by malicious individuals. As a results close to half of banking customers have been expose to frauds and cyber crimes while dealing with payment gateways, stock exchanges, money transfer agencies, and so on.
Add to this the fact that the system has added layer after layer of middlemen and intermediaries owing to the limitations of conventional IT systems. This, in turn, has resulted in high fees and delays for the customers, not to mention a massive amount of paperwork arising from complex workflows. It also exposes the customer to the possibility of financial fraud and corruption. Lastly, the system in many cases is highly exclusive and denies basic access to financial products and services to a number of people around the world.
Generally, bankers have resisted sweeping changes to the current way the underlying technology works as they do not want to upset the apple cart and want to ensure that businesses that rely on them are able to continue working smoothly without any change in their user experience. However, the inefficiencies and faults in the system mean that such changes are the need of the hour. Disruptive innovation that can make the customer's experience even better is required to ensure that the system keeps chugging along and customers are able to operate their businesses without being slowed down or stopped by the technology on which their businesses are built. Enter blockchain.
Blockchain technology has numerous features and advantages that enable us to re think and re-engineer how modern financial services operate and serve the end customer. It enables us to design modern workflows minimizing middlemen, maximizing security, enabling transparency, and promoting high levels of interoperability between different players of the financial ecosystem.
Blockchain technology was invented to be the backbone for Bitcoin, the popular cryptocurrency. It is a distributed ledger spread across a permissioned or permissionless network. The participants of this network are referred to as nodes. Each node contains a copy of the ledger. To update the ledger, the participants in the network will propose a transaction or a set of transactions that should be added next to the ledger. Once the participants in the network come to an agreement on the next set of transactions, they will add the transactions to their local copy of the ledger. This way, the sanctity and uniformity of the ledger across the nodes are maintained.
Data is added in "blocks" of transactions. Each block contains the hash value of the header of the previous block. (A hash function generates a unique output of fixed length for an input data of any length.) This ensures that the sequential order of the blocks is maintained in the ledger. Each block header has a set of parameters, including a Merkle root hash of the transactions in the block. If any transaction data is tampered, it results in the Merkle root of the block being altered. This causes a mismatch in the hash of the header of the block and the hash of the header of the block stored in the following block, effectively 'breaking the chain'. This will result in the local copy of the ledger being broken and the node being thrown out of sync with the other copies of the distributed ledger disabling it from adding any further transactions to the ledger.
Transactions submitted to the network are signed using a private key or a secret key that is held by the network participant and the public key is included in the transaction as part of the transaction. This means that the other participants on the network can validate the identity of the transaction submitter.
The multiple copies of the ledger and the hash-chain ensure that any data written to the ledger is immutable. If there is a mismatch between the local copy of the ledger held by a node and the copy of the ledger held by the other network participants (nodes), the node is disengaged from the network and cannot broadcast new transactions. This ensures that the sanctity of the ledger is maintained. To further maintain the uniformity of the ledger, blockchain allows network participants only to append new data to the ledger and does not allow participants to remove or modify existing data in the ledger. As such, any transaction data written to the blockchain is preserved and cannot be modified.
Since the ledger is universal, there needs to exist a mechanism to ensure that transactions are added in the same order across all copies of the ledger. This is typically achieved through a consensus mechanism. A consensus mechanism is basically a set of steps that ensures that transactions are written in the same order across the nodes. Additionally, it ensures that the transactions in all the copies of the ledger are the same.
Consensus can be achieved through various means. Traditional public permissionless blockchains, such as those running cryptocurrencies such as Bitcoin or Ethereum 1.0, rely on the solving of a cryptographic puzzle to pick the network participant who gets to write the next set of transactions to the ledger. This network participant is called a miner. After successfully solving the cryptographic puzzle, the miner will create a "block" of what they believe the next transactions in the ledger should be. They then add this block with the transactions and their solution to the puzzle to their local copy of the ledger and broadcast this block to all the other nodes in the network. The other nodes will validate the authenticity of this block before updating it to their local ledger. The difficulty of the cryptographic puzzle is set such that only one network participant can solve the puzzle in a fixed window of time. After the puzzle is solved, a new cryptographic puzzle is generated and the next miner needs to solve this puzzle.
Permissioned blockchains follow a slightly different approach. Permissioned blockchains are blockchains where we know all the network participants and the participants cannot connect to the network without prior permission of the participants. Since the identity of all the network participants is known, these blockchains follow a slightly more relaxed approach to consensus. They might use a simple queuing mechanism to order the transactions. Some may also follow a round-robin approach. A round-robin approach is one where each network participant is allowed to submit and write its own block to the ledger. This continues until every participant has had a chance to submit a block, and then the process is repeated.
In recent times, the term Distributed Ledger Technology (DLT) has been interchangeably used with the term blockchain. All Blockchains are DLTs but not all DLTs are Blockchains. In common parlance, the term DLT is generally used to refer to a platform that does not use 'blocks' or 'chains'. Instead they add data in singular transactions. These platforms are being actively used to build financial applications. Most of these platforms use a variation of the Practical Byzantine Fault Tolerance (PBFT) mechanism to achieve a transactional-level consensus between the various copies of the ledger. As they are PBFT-based, several of them suffer from the same limitations as PBFT. They are able to solve this problem using intelligent network design or by making modifications to the traditional PBFT algorithm. A good example is the Stellar platform, which follows the Federated Byzantine Agreement (FBA) consensus model and restricts the Validation Nodes on its public network. DLT platforms are preferred over blockchains in certain use cases because they often permit higher transactions per second. This makes them suitable for payment networks, trading exchanges, and so on.
Lastly, let's look at the concept of smart contracts. Smart contracts are computer protocols that enable the execution of condition-based business flows. The authenticity of conditions and the execution of the terms of the contract can be satisfactorily verified by all the parties who are affected by the execution of the contract without trusting a third party.
This is possible by writing and deploying such business flows to a distributed ledger and by leveraging blockchain technology. Let's say Alice wants to sell a car and Bob wants to buy it. But Alice wants to ensure that Bob gets possession of the car only when she gets paid. In such a case, Alice and Bob can write a smart contract. Bob can transfer the funds he needs to pay Alice to the smart contract's account. Alice can transfer a secret password that will unlock a digital copy of the documents of the car to the smart contract. The smart contract will ensure that Bob gets access to the password and Alice gets her payment without them depending on a third-party middleman. If the deal does not go through, the contract can also return the assets to the original owners.
This is better than traditional means because a human intermediary can be influenced by Alice or Bob. They might also have to pay some fees to the intermediary. Additionally, there might be a delay in executing the deal owing to a backlog of...