Introduction to Blockchain
![](https://miro.medium.com/v2/resize:fit:700/1*F3T8ma83HFZPaphpem3NDQ.jpeg)
Introduction
Technology experts and economists have deemed blockchain as the world’s most influential innovation since the Internet. Blockchain is changing the way businesses perform transactions and governments interact with their constituents. It can be used to secure payments, create digital identification cards, and electronically administer elections. Bitcoin, the world’s most well-known cryptocurrency, is powered by blockchain technology. In 2020, LinkedIn announced that blockchain was the world’s most in demand job skill.
Despite its growing impact on our economy, blockchain is often misunderstood. A plethora of resources with varying levels of technical detail make it intimidating to learn about the basics of blockchain. If you have little to no understanding of blockchain, you are in the right place.
![](https://miro.medium.com/v2/resize:fit:700/1*MnyG-5g0KDyGPQN1H7_whA.gif)
The Problem
Let’s begin this journey by analyzing the problem blockchain seeks to solve.
Consider Roberta and Carol.
Next week is Carol’s birthday and she wants to visit Brazil to celebrate. Her friend Roberta wants to contribute to the flight as a birthday gift but doesn’t have cash on hand. Roberta calls the bank and asks them to transfer $1,000 to Carol. A week later, Carol is on her way to Brazil.
How did this money transfer happen? Roberta and Carol both trusted the bank to manage their money. First, the bank verified that Roberta had $1,000 in her account. Second, the bank made an entry in its collection of account transactions, known as a ledger, reflecting the withdrawal from Roberta’s account and the deposit into Carol’s account.
There was no physical movement of cash; instead there was an update to the bank’s ledger, which is owned by neither Roberta nor Carol.
Roberta and Carol trusted in a third party to manage a transaction among themselves. Blockchain seeks to eliminate this reliance on a third party.
The Solution
In our example above, Roberta and Carol relied on a centralized ledger controlled by the bank. Remember, a ledger is a collection of transactions between accounts. In contrast to a bank controlled ledger, the blockchain is a distributed ledger, meaning it is publicly available and shared across a network of participants.
Let’s take it back to Roberta, Carol, and their new friend Manuel. They have chosen to opt out of traditional financial institutions with a centralized ledger. Instead, they have come up with a new system where they each have a copy of the ledger which they update themselves.
To begin with, they initially write down how much cash they all have. Now, when Roberta wants to send some money to Carol, she announces it to all participants in this new system. They each verify that Roberta has sufficient funds and if so, they write down the subtraction from Roberta’s balance and addition to Carol’s balance, marking that the transaction took place. At the end of the month, they settle up their cash according to the latest balances on the copies of the ledger they each have.
Sound straightforward so far? Basically Carol, Roberta, and Manuel have set up a distributed ledger as an alternative to depending on a third party such as their bank. Blockchain is a type of distributed ledger with enhanced security thanks to asymmetric cryptography, hash functions, and consensus mechanisms.
Asymmetric Cryptography
What’s to prevent Manuel from dishonestly telling Roberta that Carol sent him some money?
Here’s where a concept known as asymmetric cryptography comes into play. Imagine you have a pen with some magic ink in it. When you write a message and hold it under a special light, the message will glow green. If you use any other pen to write that message, that same message will glow red instead. This is how asymmetric cryptography works. Your computer runs a special program to generate a public key and a private key.
![](https://miro.medium.com/v2/resize:fit:700/1*ks2njzqUWglMJWC2YtckLA.gif)
The private key is like the magic pen and the public key is like the special light.
You use the private key to sign messages that can be verified with the public key. You’ve got many of these special lights and freely give them out to whomever but you’ve only got one magic pen. When Carol wants to send Manuel some money, she uses her private key to sign that message and broadcast it to all participants in the network. She also gives her public key to everyone too.
Later, when someone is looking at the record of transactions and sees that Carol sent Manuel some money, they would use Carol’s public key to verify that she’s the one who signed off on that transaction. In other words, they would use the special lamp to see if the message glows green. If Manuel attempted to forge Carol’s signature to sign this transaction, Carol’s public key would fail to verify it. Manuel’s forged signature would glow red under the lamp.
Roberta, Carol, and Manuel now have a system in place to keep track of their various transactions. As more and more people join their system, the volume of transactions will grow too. The transactions can be batched together into blocks and a new mechanism needs to be introduced to validate the authenticity of these blocks.
Hash Functions
In order to understand how the blocks are validated, we need to first understand hash functions. A hash function takes an input of arbitrary length and produces a deterministic output of fixed length. This means that you can tell a hash function anything, such as “Roberta paid Carol $1,000” or “Carol deposited $200 to her balance”, and the hash function will produce a seemingly random string of letters and numbers as output. Let’s say the output will be 5 characters long. This output is called a hash.
![](https://miro.medium.com/v2/resize:fit:640/1*i4Zd3Lm7RBtz2zRldCFPSQ.gif)
To illustrate, we told our hash function “Roberta paid Carol $1,000” and it produced the output “d7a1e”. Every time you tell the hash function “Roberta paid Carol $1,000”, it will always tell you “d7a1e”. If you modify the input, even slightly, it will produce a completely different output. For example, if we changed “Roberta paid Carol $1,000” to “Roberta paid Carol $1,001” then the output could change from “d7a1e” to “ef3c2”. It’s completely different.
Another important property is that if you are given a hash, it is near impossible to determine the input. Given the hash “a54fb”, you’d have no way to know what was passed to the hash function to produce that hash other than trying every possible input you can think of until you get the output you’re seeking.
There are a variety of different hash functions out there. Our example hash function produced an output that was 5 characters long but the hash function used by Bitcoin produces an output that is 64 characters long.
Consensus Mechanisms
A consensus mechanism helps prevent a malicious party from modifying a blockchain. When we run our blocks, our batch of transactions, through a hash function, we receive these hashes that are completely arbitrary. What if we specifically wanted the hash to start with five zeros? We know there’s no way to figure this out except to try all possible input combinations we can think of. What we could do is take our batch of transactions and tack on a number at the end.
As an example, consider our transactions and the number “1” to produce a hash that begins with “f81b0…”. If we change that “1” to a “2”, we get the hash “d8354…”. As we continue to increase this number, we continue to get different hashes until eventually one begins with “00000…”. Maybe that number ends up being “”94,916,832”. Those were a lot of attempts we had to go through.
This number is called a nonce and this process is an example of proof of work . Remember, the reason we go through this process is so that a malicious party can’t easily modify our blocks. If they tweak any data within the block, it means they’d have to take a lot of effort to calculate a new nonce to keep that block valid.
Proof of work is one example of a consensus mechanism. Consensus mechanisms are important because in a distributed system as we’ve been using, we need a way to come to an agreement as to which copy of the ledgers among our participants are valid. Other consensus mechanisms exist out there but proof of work is what Bitcoin uses.
Chaining it All Together
Let’s recap where we are. We’ve got transactions that are cryptographically signed to maintain their integrity. These transactions, in addition to a nonce, are batched into blocks that produce a hash beginning with some zeros. All that remains now is to keep our blocks in order. We do this by taking the hash produced by a block and adding it to the start of the next block. To hash that next block, in addition to the batch of transactions and the nonce, we now also include the previous block’s hash as input to our hash function for this block. By taking the hash of the previous block and starting our next block off with that hash, we’ve now chained these blocks together. Hence, blockchain.
In our distributed system, everyone has a copy of this blockchain. They’re all listening for new transactions to add to a block and to eventually calculate the nonce for that block. Bad actors out there can tamper with data on their copies of the blockchain which they then broadcast out to others but as long as the majority of participants in the system are good actors, there will be a consensus among them as to which the true blockchain is.
Summary
Blockchains seek to solve the third-party trust problem identified above. They can be applied to enable smart contract platforms such as Ethereum, secure and track food supply chains, or develop non-fungible tokens, more commonly known as NFTs. Public sector applications can range from blockchain based land registry systems to blockchain based voting in local elections. In 2018, the global blockchain market was valued at 1.57 billion U.S. dollars and it is forecasted to grow more than a hundred times to 163 billion U.S. dollars by 2027.
Blockchain is rapidly growing its footprint but it also presents many challenges for policy makers and software engineers. For example, Bitcoin mining presents a significant environmental challenge due to the energy intensive process required to mine cryptocurrency and NFTs present significant challenges related to fraud and cybersecurity. More broadly, different types of blockchains are trying to tackle the “blockchain trilemma”, a term that defines the challenge software engineers face when creating a blockchain that is scalable, decentralized, and secure. It is technically complex to do all three, hence the trilemma.
If you found our blockchain brief helpful, please share.
We look forward to engaging with you through Blockchain For Social Impact, an initiative at the Institute for Technology & Society (ITS) to improve access to blockchain education and to discuss the socio-economic potential of blockchain technology.
If you would like to collaborate with Blockchain For Social Impact, please send an email to: mzia@jd21.law.harvard.edu.
References:
A special thank you to Waj S., a software engineer who helped draft the technical components of this brief. For more detailed information on hash functions, blockchain security issues, and blockchain’s underlying technology, check out the articles below:
https://www.getastra.com/blog/knowledge-base/blockchain-security-issues
Did you enjoy reading and would you like to receive more content like this in your inbox? Sign up through the link and receive exclusive content: https://bit.ly/3grTWPc
![](https://miro.medium.com/v2/resize:fit:332/0*eSYCCtr-qEzH3C9h.png)
*Mohammad is an International Fellow focusing on governance and financial inclusion in the blockchain, digital currency, and fintech sector. It will also support urban use of emerging technologies initiatives. Mohammad completed his JD from Harvard Law School, his MPP from the Oxford University and his degree from the University of Maryland. Mohammad is passionate about technology-based solutions to economic and legal challenges in emerging markets. He speaks seven languages and has traveled to nearly fifty countries.