close
close
LearnIntro to Web3
What is blockchain?

What is blockchain?

April 13, 2023
3
 min read

A blockchain is a linked list of transactions stored on a network of computers. Let's dive into how blockchains work.

By Peter

A blockchain is a linked list of transactions stored on a network of computers.

Blockchains are:

  1. Decentralized: Transactions are on a network of computers (nodes).
  2. Immutable: Transactions cannot be changed once committed.
  3. Open: Transactions can be viewed by anyone.

How blockchains work

Each block has:

  1. A list of transactions
  2. A hash (a long string of random characters) for the block
  3. The previous block’s hash (this is how the blocks are linked)

Let's take a look at how a transaction works on the blockchain.

Suppose Bob wants to send Mary 1 bitcoin.

First, both Bob and Mary need crypto wallets. These wallets don’t actually store crypto assets. Instead, they store two keys:

  • A public key links to an address that lets you send and receive transactions. Think of it as your email address.
  • A private key proves that you own the tokens associated with your public address. Think of it as your email password. Since a private key is hard to remember (it’s a long string of random numbers), wallets also give you a 12-24 word seed phrase. You shouldn't share your private key or seed phrase with anyone.

Bob can send Mary 1 bitcoin in three steps:

  1. Bob tells his wallet: "I want to send 1 bitcoin from my public address to Mary's public address." Bob signs this transaction based on his private key. This signature proves that Bob actually owns 1 bitcoin.
  2. Bob's wallet sends the transaction to nodes on the blockchain. These nodes then verify the transaction using Bob’s signature and public key.
  3. A node groups Bob’s transaction with other transactions into a block. It then works with other nodes to add the block to the blockchain.

Mary will see 1 bitcoin in her wallet only after all three steps are complete.

A block can be added to the blockchain only if other nodes agree. Let’s explore how nodes reach consensus next.

Consensus mechanisms

To process transactions without middlemen, nodes need to be able to reach consensus themselves. They do this through two popular methods:

Proof of work

  1. Nodes called miners compete to solve a math problem using brute force (e.g., rolling a dice thousands of times to get the right number).
  2. The first miner that solves the problem gets to create a block.
  3. Other nodes check if the block is valid. If it is, the miner is rewarded cryptocurrency. If it’s not, the miner wasted their time and energy.
  4. All nodes add the new block to their copy of the blockchain.

Proof of work uses energy because miners compete to solve math problems by building powerful machines that run 24/7.

Proof of stake

  1. Nodes called validators stake some cryptocurrency. A stake is like saying: “I’ll commit this amount of cryptocurrency to win the right to do this transaction.”
  2. Validators with more stake are more likely (but not guaranteed) to be selected to process the transaction and create a block.
  3. Other validators check if the block is valid. If it is, all participating validators earn a transaction fee. If it’s not, the validator that created the block might lose its stake.
  4. All nodes add the new block to their copy of the blockchain.

Proof of stake uses less energy than proof of work. Bitcoin uses proof of work, and Ethereum is currently transitioning from proof of work to proof of stake.

Blockchain trilemma

Blockchains usually have a trade-off between security, decentralization, and scalability:

  1. Security: Ability to defend from bugs and attacks.
  2. Decentralization: Ability to support many nodes.
  3. Scalability: Ability to support a large volume of transactions.

For example, consider Ethereum and Solana blockchains. As of December 2021:

  • Solana’s average transaction cost is $0.00025 with 1,000 validator nodes.
  • Ethereum’s average transaction cost is $5.2 with 10,000+ validator nodes.

The more nodes there are, the less likely it is for a chain to become compromised. This post isn’t about which chain is better - just remember that this trade-off exists.

Let's cover Bitcoin, the most popular cryptocurrency, next.

Up next: What is Bitcoin?

Learn more

Subscribe to our newsletter
Oops! Something went wrong.
On this page

How blockchains work

Consensus mechanisms

Blockchain trilemma

Learn more

Related articles

Browse all

Prev Article

🤷

There are no previous articles in this Pathway

Check out other Learning Paths!

Next Article

🤷

There are no more articles in this Pathway

Check out other Learning Paths!