Chapter 1. Introduction to Blockchain
Blockchain is a shared, distributed ledger that records transactions across business networks with the aim of helping businesses remove inefficiencies from trade. It does this through the use of cryptographic proofs, which help engender trust by ensuring facts are reported consistently to all those with a need to see them.
That’s the elevator speech for blockchain. In the rest of this chapter, we’ll look in more detail into what blockchain is and why it is so important. To begin with, let’s explore the need for business networks.
Business Networks
Wealth is generated in market economies by the flow of goods and services over business networks. Business networks are necessary because of the huge advantages gained from specialization. The economist Adam Smith first wrote about these efficiency gains by referring to the example of pin production, in work that is currently immortalized on the back of an English £20 note. The economist Leonard Read, in his short paper “I, Pencil,” subsequently used the example of a pencil, and the fact that no one on earth knows how to create one completely from scratch, to demonstrate the importance of business networks to manufacturing.
Business networks are not only required to make manufacturing supply chains more efficient; they are also used in any type of business-to-business interaction. Business networks can span manufacturers, logistics companies, banks, insurers, consumers—any person or organization who is willing to trade one asset for another, whether that asset is tangible (e.g., houses, cars, cash, land) or intangible (e.g., services, intellectual property, patents, licenses).
Let’s use an example to illustrate the importance of the business network and how wealth is generated.
Ted the Businessman
Ted is a businessman who turns up in a small town to speak at a conference the following day. He was booked by the conference at the last minute, so when he arrives at the town he still needs a hotel to spend the night. He finds one, goes up to the owner, and reserves a room, placing $100 on the front desk. “I’ll be back shortly,” he says to the hotel owner. “I’m going to check out the conference venue first.” Ted wanders off.
A few moments later, the hotel owner takes the $100 to a local builder who did some minor repair work at the hotel the week before. “Here’s the $100 I owe you,” the hotel owner says to the builder. The owner returns to her hotel.
The builder, money in hand, had been interested in a nice vase that had been on display in the local antique shop. He takes the $100 to the antique shop, purchases the vase, and happily takes it back to his house.
The owners of the antique shop were an elderly couple who happened to be reaching their 40th wedding anniversary. To celebrate, they take the $100 they just received from the builder and decide to spend the night in a local hotel—the same hotel in which Ted had reserved a room earlier. The couple arrives at the front desk, pays $100 to the hotel owner, checks into their room, and has a lovely short break.
After checking out the conference venue, Ted returns to the hotel and delivers some bad news to the hotel owner. “I’m sorry,” says Ted. “It turns out my conference has been canceled. Please can I have my money back?”
The hotel owner agrees and hands the $100 back to Ted, who then returns home, disappointed to not have spoken at the conference but otherwise not out of pocket.
What happened in that story?
The story starts and ends with precisely the same quantity of assets in the town, but crucially the different participants of this business network have each gained utility due to the flow of capital (the $100) within it: the hotel owner has rented a room, the builder has a vase, and the antique shop owners have their vacation. Ted the businessman simply served as a stimulus to start the flow of transactions, providing the initial capital input and final capital output.
You can see this flow in Figure 1-1.
It’s a simplistic scenario, but the lesson here is that what’s most important for the generation of utility (and ultimately, wealth) is the flow of assets (goods, services, and cash) around a network. You can manufacture a plethora of assets but if no one is willing to exchange other goods and services (or cash) for them, true economic growth cannot occur. (There are other ways of artificially generating wealth, such as gains made from stock market speculation. It’s beyond the scope of this book, but we refer anyone interested to any good economics guide.)
In reality, business networks can be hugely complex. It can take many hundreds of suppliers and manufacturers to source and assemble the components for your car. The value of fund transfers between US financial institutions comes in at trillions of US dollars each day, and this requires a business network system that is highly available, efficient, and resilient.
So what’s this got to do with blockchain? Well, a blockchain is a system for logging the flow of assets around a business network; it allows the participants associated with transactions to record that they happened. Of course, we already have a system for doing this—it’s called the ledger. How is blockchain any different?
The Ledger
Depending on when you start counting, the concept of ledgering has been around for over 500 years. In 1494, a Franciscan monk and mathematician called Luca Pacioli published Summa de arithmetica, geometria; proportioni et proportionalita (Summary of arithmetic, geometry, proportions, and proportionality), which gave the first written description of the concept of double-entry bookkeeping, giving rise to ledgers as we know them today.
Ledgers are essentially transaction logs: ordered lists of the inputs and outputs of a business. Your bank statement is an example of a personal ledger; it shows every debit and credit to your account and details of the organization with whom you transacted.
Ledgers are particularly important for businesses because they describe what they own, and what the business would be worth if it was to be sold. A company could take its starting balance and for every transaction add up the value of the credits, and subtract the value of the debits, to derive its net worth. The net worth derived from company ledgers is known as a liquidity position, which among other things can be used to influence investment decisions, satisfy auditors, and manage risk.
Ledgers have moved on since the leather-bound books of Luca Pacioli’s day, and are now usually represented by a database of some kind. But the concepts—and the shortcomings—remain the same. But more on those later.
Transactions and Contracts
If a ledger is a log of transactions, what actually is a transaction? A transaction is usually taken to mean the change in ownership of an asset in exchange for something else. So if Matt buys Helen’s car from her, the logged transaction is the exchange of one car to Matt for the agreed price. Matt would record that transaction on his ledger and Helen would record the same transaction on hers (the debit becoming the credit and the credit becoming the debit, of course).
A transaction could be the exchange of two goods, one of which may be cash. More generally, a transaction could be taken to mean any change in state of an asset. If respraying a car from yellow to green increases its resale value, this might then have an effect on the net worth of the owner, so it could be useful to log in a ledger.
Transactions are underpinned by a set of terms and conditions, which are the prerequisites for that transaction to be valid. When buying Helen’s car, it might come with a warranty that says that if the car turns out to be faulty, Matt gets his money back. For many transactions, the terms of the transaction are agreed by the participants and represented in a contract.
Transactions and contracts are closely linked; a transaction can be thought of as being the invocation of the rules of a contract, and this is precisely how blockchains tend to execute their implementations of contracts (also known as smart contracts). Again, more on this later.
The Problems with Ledgers and Contracts
Both traditional ledgers and traditional contracts have problems. The problem with ledgers is that everyone in the business network has their own version. What if one participant has recorded a transaction on their ledger, but the other participant has recorded it differently, or even has no record of it? What if Matt records the fact that he’s bought Helen’s car, but Helen does not: whose ledger is correct, and who owns the car? Importantly for businesses, while transactions are in dispute, assets cannot be claimed as part of a company’s net worth. It is common for companies to have a number of transactions in dispute at any given time. For example, IBM’s Global Financing arm has a great deal of money tied up in disputes, up to $100 million in capital in dispute at a time, which is a significant liability with a dispute resolution process that can take many weeks to settle a transaction.
It’s a similar problem for contracts: these are ambiguous by their very nature. Contracts represent an abstract agreement between multiple participants; what is written down on paper or implemented in IT systems may not be the essence of what the participants thought they were signing up to. Contracts can often take teams of lawyers and judges to interpret.
The lack of a mutually agreed meaning for both ledgers and contracts leads to the lengthy and costly process of reconciliation, which ensures that transaction details and contract execution are correctly synchronized and agreed by all the relevant participants. Disputes lead to (often manual) dispute resolution processes, which in turn can lead to even lengthier and costlier legal processes. This may be great for lawyers, but not so much for the participants involved in those disputes.
Enter the Blockchain
Blockchain aims to solve the problems of ledgers and contracts by sharing them in an unambiguous form between the participants of the business network. Blockchain can be referred to as a shared, distributed ledger with smart contracts.
Let’s pick those terms apart. Firstly, blockchain is a ledger: a transaction log that can be used to describe the inputs and outputs of a business. Secondly, it’s shared between the participants of the network such that everyone sees the same set of facts. Finally, it avoids any single point of failure by ensuring that copies are distributed to everyone who needs to see it.
Smart contracts refer to computer code that is shared between participants of the business network, and these implement the business rules associated with each transaction. As the code is shared, it can be executed by all relevant participants and they can agree on the output.
Despite the name, smart contracts are not contracts. Smart contracts can be used to provide the shared execution of contract terms, in the same way that a single participant’s IT systems can execute contract terms today. You would not expect a judge to rule over the meaning of a smart contract, as they are not typically software engineers. They might, however, rule over the legal contract from which it derives.
A Car Example
To illustrate how shared ledgers and smart contracts work, imagine the scenario of a blockchain that tracks car ownership. The blockchain itself would be an ordered data structure that contains the details of every ownership change that has been agreed to. For example, one transaction could state that “the ownership of the car with identification number CXU7592875 has changed from Helen to Matt.” The smart contract associated with this transaction describes the computer logic that makes the transaction happen: for example, “check that the seller is equal to the current owner, and if it is, set the owner to be the buyer, decrement the cash balance of the buyer, and increment the cash balance of the seller.”
Each interested participant (e.g., Helen and Matt) would run that smart contract code and agree on the output, and if everything is acceptable, then update the ledger accordingly. The updated ledger might be made visible to Helen and Matt, but also to other interested parties, such as the vehicle regulator or insurers, depending on the agreed rules of the network.
Blockchains are useful because they help engender trust in business networks, which is something traditional business-to-business systems cannot provide. With a shared database for example, there is no guarantee that an administrator has not tampered with the transaction. Blockchain gives the participants of a transaction nonrepudiation, which is evidence that the transaction was agreed to.
Blockchain and Trust
The blockchain can engender trust by providing proof that the transactions were agreed to. To do this, the blockchain implements several related qualities of service including consensus, provenance, immutability, and finality.
-
Consensus is the process by which transactions are agreed upon by participants on the network. This means agreeing which transactions occurred, in what order, and what the result of running each transaction was. Participants who need to provide that agreement might just be those affected by it (in our example, just Matt and Helen), but might also include additional interested participants (such as a payments provider), or in the case of public blockchains like Bitcoin, a majority of the network.
-
Provenance means that it should be possible to review prior transactions to determine the history associated with assets. For example, as the current owner of the car, Matt should be able to see its manufacturing, ownership, and servicing history, right up to the point that he sells it. These rules of visibility are decided and governed by the network—more on this later.
-
Immutability is the fact that the shared transaction history cannot be tampered with. Once a transaction has been agreed to through consensus by the network and stored on the blockchain, it cannot then be edited, deleted, or have new transactions inserted before it. This makes the blockchain an append-only data structure, and is the reason why transaction provenance is possible.
-
Finality is the property that the transaction cannot be modified once it is agreed upon. Unintended transactions can only be backed out by the addition of a new transaction that reverses the earlier transaction, again with the agreement of the relevant participants.
Bear in mind that proof is not the same as trust. Blockchain provides cryptographic proof of the set of transactions, and it is up to participants to decide whether to trust that proof. In most business scenarios this is not a problem. But imagine, for example, that a blockchain were used to track voting in a national election. Such a system could provide secure once-only voting with a full audit trail, but would crucially need to be trusted by both the losers of the election and the electorate in general. Given many people’s distrust in computers, this is not a trivial problem to solve; blockchain can provide the technical component of a solution to a problem that requires more than just technology.
Blockchain and Bitcoin
Blockchain is not the same as Bitcoin, although many people’s first experience of blockchain is through Bitcoin. Bitcoin is a payment system that was first described in a 2008 whitepaper presented under the name of Satoshi Nakamoto.1 This whitepaper doesn’t actually mention blockchain by name, but describes a mechanism for securely sending payments between anonymous participants. Bitcoin uses what we now refer to as a blockchain to log the set of confirmed transactions.
Bitcoin introduced a class of asset called a “cryptocurrency,” which is like a normal currency in that it is a scarce resource that can be used (in theory) to pay for goods and services. Since the introduction of Bitcoin, cryptocurrencies have exploded in popularity. At the time of writing, the market capitalization of cryptocurrencies has fallen dramatically, but the number of cryptocurrencies still far outnumber the number of fiat currencies.
The cryptocurrency bitcoin doesn’t really exist outside of the Bitcoin network, in the same way that the balance you hold in a bank account probably doesn’t exist outside a number in a record in a bank database—until you go to an ATM, anyway. The bitcoin currency can be converted into fiat currency using exchanges. Given this ability to cash out and provide real-world capital, bitcoin has been treated like a commodity such as gold. However, unlike other commodities, Bitcoin is largely unregulated and widely misunderstood, which has led, among other things, to huge volatility in its market price.
The Bitcoin Network
The Bitcoin network is pseudonymous and the blockchain is fully public; you can view the entirety of the Bitcoin ledger. This pseudonymity means that unless you can perform heavyweight analysis of the network (for example, ChainAnalysis), such as tracking transactions at the exchanges, it is almost impossible to determine the identity of a Bitcoin user. This is why hackers often request payment in bitcoin if your computer has been compromised. Ransom payments cannot be easily traced back to individuals, as the participants associated with individual transactions are meaningless sequences of hexadecimal numbers.
Given this lack of identity on the Bitcoin network, Bitcoin has an innovative but costly technique for ensuring consensus. As an example, imagine you had $100 and you attempt to transfer $50 to three participants at the same time. How does the network agree which two transactions succeed and which one fails? This is known as the double-spending problem, and is an example of the type of processing that the Bitcoin network does.
It’s crucial that the network agrees on the order in which transactions are performed, and on the results of those transactions. Otherwise, the system could not reliably function. It uses a complex process of consensus called “Proof of Work” to do this, which relies on a network of collaborating computers.
What Is Proof of Work?
Proof of Work works by adding an artificial cost to transaction verification. If you want to convince the network that your set and order of transactions is correct, you have to prove to the network that you have incurred this cost. It does this by forcing the nodes of the network to solve cryptographic puzzles that are difficult to solve (i.e., require brute force techniques), but are trivially easy for other nodes to verify once the correct answer has been found. For each set of transactions (known as a block), the first node on the network to solve the cryptographic puzzle gets rewarded in Bitcoin. This is known as cryptographic mining, and is one of the ways the Bitcoin network is kept secure.
Proof of Work is like giving a room full of students a jumbled-up Rubik’s Cube each, and requiring them to solve it before they can ask a question. We know that the cube is difficult to solve, yet easy for the lecturer to verify if it’s been solved. This has the effect of removing the incentive to ask bad questions, because we know that a student must be serious about the question if they’re willing to go to the effort of solving a Rubik’s Cube in order to ask it.
The problem with Proof of Work is that it takes an extraordinary amount of electricity in order to function. Estimates vary, but Bitcoin’s implementation of Proof of Work is thought to use the equivalent of the power consumption of a country like Ireland.
Blockchain is not Bitcoin. Moreover, the typical requirements of Blockchain for business are totally different from the requirements of the Bitcoin blockchain. Specifically, the use of unregulated assets, anonymity, untraceability, and excessive power requirements lead many businesses to struggle to adopt Bitcoin for business-to-business transactions. This has led to the introduction of different blockchain implementations that more closely fit what businesses require, while still being able to achieve cryptographic proof of a set of transactions.
The Requirements of Blockchain for Business
The requirements of blockchain for business actually differ from Bitcoin in five distinct ways: (1) the assets that are tracked, (2) knowing each transaction’s participants, (3) the rules around privacy and confidentiality, (4) how transactions are endorsed, and (5) how the network is governed. We’ll discuss each of these in the next section.
The Assets That Are Tracked
Blockchain can be used for a much broader range of assets than just cryptocurrency. Tangible assets such as cars, real estate, and food products, as well as intangible assets such as intellectual property, licenses, and shared information sets, are all fair game, so long as they can be represented digitally. Part of the art of setting up a blockchain in a business environment is deciding what to share.
Knowing Each Transaction’s Participants
As we’ve seen, Bitcoin thrives due to anonymity: anyone can look at the Bitcoin ledger and see every transaction that ever happened, but participant information is untraceable. On the other hand, businesses have requirements such as KYC (know your customer) and AML (anti–money laundering). These are examples of compliance rules that require businesses to know exactly who they are dealing with.
The Rules Around Privacy and Confidentiality
Privacy and confidentiality are key requirements of a blockchain for business. Firstly, in the same way that markets can be public or private, it should be possible for a blockchain to be private, meaning that the network can decide exactly who joins. A public blockchain increases the risk of a business inadvertently making transaction or relationship information public knowledge, whether accidentally or through malicious means (e.g., by exploiting vulnerabilities). Furthermore, individual transactions require confidentiality to avoid giving other members an unfair advantage. We probably don’t want one supplier on the network knowing the discount level we’re giving another supplier, even if they are on the same blockchain. Of course, a regulator might require total visibility of all transactions.
Characteristics such as these give rise to the need for permissioning of the blockchain network, where different participants can do different things. It’s possible to have public and permissioned networks such as Stellar, as well as private permissioned networks such as IBM Food Trust built using Hyperledger Fabric.
Permissioned networks are totally different than Bitcoin, which is both public and unpermissioned. Bitcoin reveals to everybody all the transactions that occurred, but not who is involved with them. Businesses need the complete opposite: knowing who they are dealing with but not necessarily aware of the details of every transaction.
These privacy requirements also mean that it is probably infeasible to have a single blockchain instance that covers everything. Just like there are many ledgers in existence today (and there are many business-to-business networks), there will probably be many blockchains in the foreseeable future, albeit with the ability to transfer assets between instances: a network of networks, in other words.
How Transactions Are Endorsed
Consensus in a blockchain for business is not usually achieved through Proof of Work but often through a process of selective endorsement. This means being able to control exactly who receives and endorses transactions, much in the same way that business happens today. If we transfer money to a third party, then our bank, the recipient’s bank, and possibly a payments provider would endorse the transaction. These transactions are then validated by those on the network permissioned to receive them. This is different from Bitcoin, where miners compete to endorse transactions in exchange for a bitcoin reward and a network of users running full nodes (those that fully verify all of Bitcoin’s rules) collaborate to verify transactions.
How the Network Is Governed
Blockchain networks can be governed in one of two ways: either using a pre-agreed policy, or through a set of tokens. Policy-based approaches require a set of rules agreed upon up front by key stakeholders, such as a consortium of members, a regulator, or a market maker. The rules can be wide reaching and might, for example, describe how consensus is achieved, how future changes to membership are decided, or who is liable for bugs in smart contracts. Some blockchains use tokens in order to govern behavior. The public Ethereum blockchain is an example where your wealth (in terms of your balance of the Ethereum cryptocurrency known as Ether) is used to determine your smart contract processing capacity.
Token-based policy is considered to be on chain governance as the ability to govern is locked into the blockchain. Policy-based governance can be both on chain and off chain depending on the approach.
Both policy- and token-based governance approaches are reflective of established real-world systems. For example, a country’s laws are a policy-based governance system, yet your wealth can determine other things you can do within that framework. While early business blockchains have typically been governed through policy, there is an increasing number of business blockchains that have been augmented with token systems as a means to encourage behavior within the network.
Blockchain Technology
For any business blockchain to be successful, participants need to agree on the approach for sharing transactions and smart contracts. In the same way that HTTP(S) is an agreed approach for sharing information over the internet, there needs to be a common standard for blockchains (at least within each business network) for the network to grow and thrive.
There are lots of decisions that need to be made when setting up a network, including asset and transaction data formats, network topology, governance, and validation rules. One of the most important decisions is the choice of blockchain technology: the software that provides the implementation of the shared ledger and smart contract execution framework. Participants of the network need to adopt the same technology to share information; there is no universal interoperability standard for blockchain technologies yet, although work on standardization continues.
The selected blockchain technology must complement the vendor biases and diverse IT landscapes that are typically present in business networks. This means that openness of the blockchain technology is essential, not only in terms of the source but also such that the entire community has the opportunity to influence the direction of the project (known as open governance). It does not typically make sense to adopt a proprietary blockchain technology, as it would require all present and future participants on the business network to adopt the same vendor, which raises the risk of lock-in, cost increases, and a lack of scope for innovation.
The Hyperledger Project
In February 2016, the Linux Foundation formally announced Hyperledger, an open source, open governance effort to advance cross-industry blockchain. It serves as a greenhouse for multiple blockchain technologies, including frameworks that implement shared, replicated ledgers, and tools for developing and operating instances of them.
Like other Linux Foundation projects, Hyperledger is built around this spirit of openness, and this has helped contribute to its ongoing success. At the time of writing, more than 260 organizations have joined Hyperledger from a broad range of industries and disciplines, and there is a strong developer community that has been contributing to over 10 individual projects under the Hyperledger umbrella.
One of the most advanced Hyperledger projects is called Hyperledger Fabric. This provides an implementation of the shared ledger and smart contract execution framework, and is built around the principles of security (to reflect the needs of regulated businesses) and modularity (to allow for innovation). It is developed by a worldwide team representing dozens of unique organizations, and there are numerous instances in production. This book will focus primarily on Hyperledger Fabric.
IBM and Blockchain
IBM has been contributing code, intellectual property, and development resource to Hyperledger since its inception.
The IBM Blockchain Platform was the first commercially available platform to leverage technologies from Hyperledger. Platforms such as this provide a set of tools to assist with the development, governance, and operation of Hyperledger Fabric networks, and have been used to underpin many of the blockchain solutions in production today, including IBM Food Trust and TradeLens.
These networks along with those from other providers are discoverable in a public registry of networks called the Unbounded Network Registry.
Summary
In this section we’ve looked at what blockchain for business is: a shared, distributed, permissioned ledger with smart contracts. Blockchain is important because it helps engender trust in business networks by providing cryptographic proof over a set of transactions. This can remove friction from business networks, for example, by removing the need for costly dispute resolution processes.
Blockchain is not Bitcoin; the requirements of blockchain for business are completely different, and focus on characteristics such as confidentiality and real-world assets.
We have also looked at Hyperledger, hosted by the Linux Foundation, and how it aims to solve these requirements of blockchain for business. We concluded by looking at IBM’s contribution to blockchain and how it is helping customers on the path of this exciting technology.
In the next chapter we will look at what makes a good blockchain solution and evaluate some examples of how blockchain has been used to great effect.
1 Satoshi Nakamoto is the name used by the unknown person or group of people who developed Bitcoin.
Get Getting Started with Enterprise Blockchain now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.