A gentle introduction to Blockchain - from Bitcoin cryptocurrency to Ethereum Smart Contracts
Even if you have not heard about blockchain, chances are that you have seen people talking about Bitcoin cryptocurrency. Bitcoin is still a controversial asset and is in its very early stage. Yet its market cap briefly exceeded $1.1 trillion in April 2021 and it is by far the fastest of all assets to reach $1 trillion. An increasing number of institutions are entering the Bitcoin cryptocurrency asset space. Two of the notable public companies that topped the Bitcoin holding list are MicroStrategy and Tesla. In June 2021, the Central American country El Salvador becomes the first country to adopt Bitcoin as legal tender.
The timing for a change
It was around 2008 when the world was struggling with major financial turmoil following the subprime mortgage crisis. Fearing a collapse of the economy and a broader depression, the US government decided to bail out the distressed financial institutions after Lehman Brothers' bankruptcy. This action was heavily criticized by a lot of people. To many, the "greed" of Wallstreet institutions caused the crisis in the first place. Using taxpayer money to save them demonstrates that the financial system is broken. This brought up the question: is there a way to overhaul the financial status quo and prevent similar situations from occurring again?
Against this backdrop, Satoshi Nakamoto, a mysterious figure whose real identity remains unknown, published a paper in October 2008 titled "Bitcoin: A Peer-to-Peer Electronic Cash System". In early 2009, the first Bitcoin was created and the system officially went live. Bitcoin introduced an electronic payment system that substantially differs from how our traditional payment systems work.
The centralization problem with financial intermediaries
To understand how Bitcoin is different, let us first review how our traditional electronic payment system works using the example of credit card payments. When we buy something from a store using a credit card, the store charges a certain amount in our fiat currency (e.g. US$) from our card. Later, we pay back that amount to the credit card company. In this process, the credit card company acts as an intermediary for us and the store to allow this electronic payment transaction without exchanging physical bills. In fact, such intermediary services exist virtually everywhere in our financial system. In a mortgage loan, for example, the bank serves as the intermediary. It processes the mortgage for a borrower, while the actual money comes from another lender to the bank, enabling the loan transaction that is essentially between parties who do not deal with each other directly.
Why do we need these intermediaries like credit card companies and banks? This is because financial transactions involve the exchange of currency value, e.g., a certain amount of fiat currencies, between different parties. It is part of our human nature to make sure these transactions occur in a trusted and verifiable way because of the associated value at stake. The intermediaries fill this "trust" gap. In the credit card case, both the buyer and the store trust the credit card company. Both of them know that if either side disputes the payment or product, the credit company has the payment records and can step in to potentially protect their values based on whatever pre-defined policies about the transaction. In the mortgage case, both the borrower and lender trust the bank and are assured that the value they borrow or lend will be handled in the business terms that they agree upon. Therefore, serving as trusted intermediaries is the key function traditional financial institutions perform in our society.
Financial transactions involving the exchange of currency values are only one piece of value exchange. If we extend the definition of the transaction beyond the financial domain, every sector in the real economy involves creating and exchanging all types of valuable goods and services. For the same reason as in the financial system, intermediaries are prevalent in all parts of the economy in our society. For example, we can think of Amazon serving as a trusted intermediary for e-commerce, and Facebook serving as a trusted intermediary for social media publishing.
Because the role of trusted intermediaries in any type of value exchange is so important, these intermediaries tend to become very powerful over time. The largest ones among them grow even larger because of the network effect - the more people use them the more valuable they are, and therefore they attract even more people. This results in a concentrated few intermediaries controlling an excessive proportion of power over the public. Many people are increasingly questioning whether these "trusted" intermediaries are indeed "trustful". If the answer is no, then this "centralized" model with power concentrated in a few monopolies may not serve the best long-term interest of the public. To some extent, the bail-out of big financial institutions in 2008 is just a real-world manifestation reflecting this sentiment. Another much more recent instance is about the "cancel culture" and the growing tension between big social media companies and users about the control and publishing of user data.
Bitcoin - The first plausible alternative for de-centralization in finance
Bitcoin was released at a perfect time to challenge the centralized model in the financial industry, in the wake of the global financial crisis and the mega government bailout. Under the Bitcoin system, two parties without a trust relationship may confidently make Bitcoin payments directly to each other. This is remarkable because it offered, for the first time, a plausible alternative to solve the "trust" problem between payment parties without the need for an intermediary. While Bitcoin is originally intended for electronic payments, the underlying mechanism has the potential to be extended to a wide range of other financial transactions. That could mean eventually eliminating the roles played by all the different kinds of today's financial institutions, and at the extreme, even replacing the central bank-issued fiat currency altogether. That is why Bitcoin is seen as the starting point of a financial system revolution. Furthermore, the trend initiated by Bitcoin could spill over to a much broader spectrum of industries beyond the financial domain, and that is when society as a whole could experience a major transformative moment.
The Bitcoin system
The Bitcoin system consists of the Bitcoin itself, which is used as a currency, and a computer network system that processes all the Bitcoin exchange transactions. People often refer to it as a decentralized, peer-to-peer payment network. Both the terms "de-centralized" and "peer-to-peer" emphasize the fact that no third-party intermediary needs to be involved in the payment process. We call such a system "trustless" because people on the network do not have to trust each other or rely on a trusted third party to be able to conduct transactions.
Bitcoin currencies are created by the network of computers in the Bitcoin system following a set of computer cryptography-based rules and techniques. That is why Bitcoin is known as a cryptocurrency. Bitcoin is also a digital currency which means it does not have the physical form of our fiat currency like the dollar bills or penny coins. Instead, it exists only as a digital record. Bitcoin's digital record is stored in a ledger maintained by the network of computers in the Bitcoin system. If the ledger shows one bitcoin belongs to Alice, then Alice owns that one Bitcoin and can transfer that Bitcoin to other people as payments.
But how does the Bitcoin system creates a "trustless" environment for parties to conduct transactions directly? Let us go back to our earlier credit card example. Suppose Alice is the user and Bob is the store owner. Alice wants to buy goods from Bob. But now instead of paying via the trusted credit company, Alice will pay Bob directly in Bitcoin. The question for Alice is: if she paid Bob, how does she know Bob will not deny receiving payment despite actually having received it? The question for Bob is, how does he make sure that he has actually received valid payments from Alice?
The power of distributed ledger in the Bitcoin system
The core of Bitcoin's magic lies in a distributed ledger that records all the transactions that have ever taken place in the Bitcoin network since the genesis of Bitcoin. That includes the creation and transfer of all Bitcoins at all times. The system also makes sure that this ledger is shared and agreed upon by all the participating computers in the Bitcoin network. In other words, at any time there can be only one correct version of all confirmed Bitcoin transactions that ever happened in the entire Bitcoin's history. This way, every transaction is transparent and any tampering attempt could be detected by any computer in the network.
Now let's look at how the distributed ledger solves the problem Alice and Bob faced earlier. In the Bitcoin network, Alice and Bob both have cryptography-based digital wallets that store their Bitcoins. Each wallet has a secret key. Only Alice and Bob know the secret key to their own wallets, and that is the only proof that they own the respective wallet. Each wallet also has an address that is public and used to send or receive Bitcoins. If Alice wants to send one Bitcoin to Bob, she needs to first make sure she has at least one Bitcoin in her wallet (e.g., she likely bought it from an exchange or received it from someone else). Then she can initiate a transfer of one Bitcoin from her wallet address to Bob's wallet address. To the Bitcoin network, this transaction essentially means that the Bitcoin balance in Alice's wallet should be subtracted by one, and consequently, the Bitcoin balance in Bob's wallet should be incremented by one. That is what needs to be updated on Bitcoin's public ledger of transactions. This update needs to be propagated to enough computers in the network, at which point this transaction is considered confirmed by the system. From that time on, everyone in the network will know that one Bitcoin has been transferred from Alice's wallet to Bob's wallet. Therefore, Bob cannot claim he did not receive the Bitcoin - the distributed ledger at every computer can prove he has it in his wallet address. On the other hand, if Alice did not send the Bitcoin, Bob can easily prove it because the distributed ledger does not show that transaction to Bob's wallet address.
It should be noted that we made a number of simplifications on the above example. For instance, in reality, there is a small amount of network processing fees that need to be deducted during a transaction. Also, the distributed ledger only records Alice and Bob's wallet address, which typically contains a random list of numbers and characters. The public only sees a transaction that occurred between two wallet addresses, not the identities of people owning those addresses. Therefore the records on the blockchain are pseudo-anonymous although everyone can see them.
Blockchain - the secret weapon powering the Bitcoin magic
The distributed ledger is the key enabler for Bitcoin. But how to create and maintain such a ledger? The critical mechanism for that is called "Distributed consensus". It is a process that lets different computers on a network system work together to agree upon what transaction updates should be added to the ledger. Thus it helps keep a unified view of the transaction history.
But there is one big challenge. Bitcoin is an open system, meaning essentially anyone can join the Bitcoin network and try to submit transaction updates. There inevitably will be bad guys trying to exploit the system. How to prevent the bad guys from flooding the network with false transaction records during the consensus-building process? Bitcoin invented a distributed consensus mechanism called "proof of work" to solve this problem. It contains two main parts - staking and incentive.
Staking means anyone who wants to participate in the ledger record-keeping should put aside certain valuable resources as stakes. The stake used in the Bitcoin system is computing power. The participants have to perform resource-intensive cryptographic computations (which cost both computing power and electricity) in order to compete for the opportunity to be a recordkeeper of the distributed ledger. Since Bitcoin transactions are transparent and every participant can verify them, if a bad guy wins the slot for updating the ledger but submits fraudulent transaction records to the network, chances are that he will be detected by other people who conducted transaction verifications. In that case, this bad guy's transaction updates will not be accepted by the distributed consensus mechanism, and will not be added to the public ledger. The computing and electricity resources he spent to win the record-keeping slot are therefore lost without creating any value for him.
In addition to staking as a way to deter bad guys from misbehaving, Bitcoin uses incentives to encourage good behavior. For the network participants who spent the resource to win the ledger-keeping opportunity and submit honestly verified transaction records, the system rewards them with a certain amount of newly minted Bitcoins. This process is commonly known as mining Bitcoins.
With all we have known about Bitcoin so far, what exactly is blockchain? Well, in fact, we have already covered it! Blockchain is the name given to the technology that powers Bitcoin. Mechanisms we talked about such as distributed consensus formation are critical components of blockchain technologies. As we will see in the later sections, blockchain as a technology is not only for Bitcoin. It is a general-purpose technology that enables de-centralized platforms where parties can conduct transactions directly without the need for a trusted intermediary. Bitcoin is the first well-known use case of blockchain and remains its most prominent use case today.
It is interesting to note that the original Bitcoin paper Santoshi published does not use the word blockchain. However, it does describe storing all the payment transactions in the Bitcoin network as so-called "blocks" of records. These "blocks" are further linked to form a "chain" for processing by the computers in the network. That is why the term blockchain subsequently becomes a popular name for the technology.
Can Bitcoin go beyond finance?
We have discussed Bitcoin and its blockchain-based trustless, de-centralized payments platform. By removing payment intermediaries, this system also removes the cost associated with the intermediary, making the system more affordable, efficient, and accessible.
Now it is time to re-examine a question we alluded to earlier: what about other types of centralized financial transactions (e.g., lending and borrowing, insurance, currency exchange)? Would it be possible for the Bitcoin system to also de-centralize those transactions? Or even more aggressively, can Bitcoin be applied to de-centralize domains beyond the financial industry and to the real economy sectors?
The answer is both yes and no. This is because the logic of an electronic payment process supported by Bitcoin is fairly simple. Essentially it is about subtracting the amount from the payer's balance and adding it to the payee's balance. If we want to extend it further for more sophisticated scenarios in finance or even outside of finance, we will have to insert more complicated computer code into the Bitcoin system to support the new logic. Unfortunately, the Bitcoin blockchain only allows very limited programming capability, and for a good reason: as a system primarily designed for electronic payment, the inventors may not want to allow more than necessary programmable manipulations that could inevitably introduce additional security risks. In other words, even though Bitcoin well supports de-centralized payment transactions, it is not meant for general-purpose de-centralization use cases.
Ethereum and smart contracts - blockchain heading for the real economy beyond finance
The gap between the Bitcoin blockchain and a more general-purpose blockchain is eventually filled by a new blockchain called Ethereum, proposed by Vitalik Buterin in 2013. Ethereum is explicitly designed to enable blockchain use cases in all financial and non-financial domains. A crucial concept that helps us understand how Ethereum works is called "smart contract".
Let us start with what a normal contract is. A contract can be used for describing a use case we want a system to support. It defines a series of transactions among the participating parties and in which conditions each of these transactions should happen. For example, a simple payment use case could be supported by a contract that specifies a transaction transferring a certain amount of funds from Alice to Bob. A slightly more complicated use case could be borrowing and lending. Here the contract will also need to describe terms such as borrowing rate and lending rate, as well as the repayment schedule, etc. There will be multiple funds transfer transactions that fulfill the actual borrowing and lending process according to the agreements. Yet another use case can be an event prediction marketplace. For instance, a contract could let people buy tickets to bet on who will win the US presidential election. Those who turn out to be correct will get rewarded with funds. The transactions involved in such a prediction market contract include selling the betting tickets to people and sending rewards to the winners. Normally all these contracts are executed with intermediaries - Alice paying Bob through the credit card company, borrowing and lending via the bank, and betting on the election through the company operating the prediction marketplace.
So what is a "smart contract"? The term is coined by Nick Szabo back in 1994. It refers to a contract execution that can "minimize the need for trusted intermediaries". Coincidentally, removing intermediaries is exactly what blockchain technology promises to deliver. Therefore, the idea is that if we have described our desired use case in a contract, and furthermore, if we can turn that contract from a human language to a computer language that a blockchain could understand, then we should be able to execute the transactions defined by the contract on the blockchain. Since blockchain offers a de-centralized execution platform, this process realizes the goal of smart contracts. Using the examples we described above, that means Alice will pay Bob directly, the borrower and lender can conduct the borrowing and lending process without the bank, and participants of the prediction market can buy betting tickets and receive rewards without going through an intermediary company - all these are accomplished with smart contracts on the blockchain.
To support smart contracts, Ethereum provides its own computer language called "Solidity". It can be used to program any smart contracts for different types of use cases. Vatalik himself calls Ethereum the "World Computer" that anyone can access. Like the Bitcoin transactions, the smart contract and the transactions it conducts are all transparent and available for everyone to check. That is what makes trustless, de-centralized transaction execution possible.
One thing worth pointing out is that the Ethereum blockchain alone is actually not enough to fulfill the execution of the smart contract. Smart contracts contain both the transactions to be executed and the conditions on when to trigger those transactions. Ethereum provides the execution environment. But when the triggering conditions for the transactions involve events not occurring on its blockchain, it will have to rely on external sources called oracles to supply the necessary information. An example of such information could be who actually wins the US presidential election in the prediction market case we mentioned before. The Ethereum blockchain will not know the result unless the presidential voting is conducted right on its blockchain (which might be technically not impossible but certainly not the case today). Therefore, the oracle is itself an important topic under development.
Ethereum was officially launched in 2015. Since then it has reached near 300B market cap at its high in April 2021. While numerous blockchains have been created over the past decade, many also follow Ethereum to provide smart contract capability, Ethereum remains the indisputable leader in the blockchain space today besides Bitcoin.
Conclusion
Bitcoin is believed to be created in response to the 2008 financial crisis, in order to disrupt the massively centralized traditional financial system. During the process of our exchange of valuable assets, human nature necessitates a trusted intermediary to be involved. Blockchain is the technology behind Bitcoin. It offered, for the first time, a plausible solution to remove that intermediary, creating a decentralized, "trustless" environment for value exchanges. While Bitcoin primarily deals with the financial payment use case, newer blockchains represented by Ethereum developed support for smart contracts. Smart contracts are capable of extending "trustless" transaction executions to a potentially unlimited number of use cases both in the financial domain and all sectors of the real economy. That is a topic we will look at in more detail in our other articles.
Special note: rethinking decentralization - removing intermediary vs. replacing intermediary
When most of us talk about intermediaries, we usually default to those humans or human-led intermediaries, e.g., whether they are today's financial institutions or big social media companies. The call for decentralization and removing these intermediaries really comes from a lack of trust in them to make or continue to make decisions that are in the best interest of the people users serve. What users are looking for is an assurance that these intermediaries cannot arbitrarily and unilaterally change their mind and their services.
To that end, what blockchain really achieves is to replace the human-led intermediary with a network system dictated by computer code. That means it does not really remove the intermediary, but it becomes the intermediary itself. Furthermore, it is a non-traditional, non-human, emotionless machine intermediary - therefore, it assures the users that once deployed, it cannot change minds.
The consequence of this change is, by definition, a two-edged sword. On one side, it provides a way to relieve us from the troubles many are experiencing from human-led intermediaries in today's centralized model. On the other side, however, since computer code is ultimately created by humans, people deploying the computer programs will have to bear more responsibilities to make sure the non-human intermediary functions work as intended. Users of such systems will also have to pay extra attention to ensure the system does what it claims to do. A maliciously deployed de-centralized platform could be much harder to remedy and cause more harm to users than a system where wrongdoings of human intermediaries can be more explicitly prosecuted.