blog

explaining blockchain

doge I did some reading on blockchain, more specifically the btc whitepaper and a few other great videos online. I’m gonna structure content from the bitcoin whitepaper (bitcoin is the first blockchain).

Obviously, I'm a noob so never take this as financial advice. Also, rip to Kabosu the shiba. doge's goated.

What is blockchain?

To address what is blockchain, let’s first address what problems it solves. Traditionally, like gold or money in the bank, they work because

  • they are scarce
  • they are hard to produce
  • they are easy to verify
  • they are easy to transfer

However, in the digital world, it’s easy to copy and paste. So, how do we create digital scarcity? This is where blockchain comes in.


We start off with the idea of a ledger. Imagine a ledger that is shared among many people. This ledger is a list of transactions. Each transaction is a transfer of value from one person to another. So if Alice wants to send Bob 5 coins, she writes a transaction in the ledger that says “Alice sends Bob 5 coins”.

ledger We establish the ledger is

  • public
  • immutable
  • decentralized

Public

The ledger is public, so everyone can see it. This is important because it means that everyone can verify that the transaction is valid. If Alice tries to send 5 coins to Bob, but she doesn’t have 5 coins, then everyone can see that the transaction is invalid.

Immutable

The ledger is also immutable, which means that once a transaction is written in the ledger, it can’t be changed. This is important because it means that once a transaction is written in the ledger, it can’t be erased or altered. This is important because it means that once a transaction is written in the ledger, it can’t be erased or altered.

Decentralized

The ledger is also decentralized, which means that there is no central authority that controls it. Instead, it is maintained by a network of computers that are all connected to each other. This is important because it means that the ledger is secure and can’t be tampered with.


That’s great but how do we ensure that the ledger is secure and can’t be tampered with?

This is where the idea of blocks comes in. A block is a group of transactions that are written in the ledger at the same time. Each block contains a list of transactions, a reference to the previous block, and a special number called a nonce. The idea of there having a reference to the previous block is why it’s called blockCHAIN - because the blocks are chained together.

nonce The nonce is a number that is added to the block to make it difficult to create a new block. The idea is that the computers in the network have to solve a difficult mathematical problem in order to create a new block. This is called proof of work.

A timestamp server is also used to timestamp the blocks. This is important because it means that the blocks are written in the ledger in the correct order.


Proof of work

Let’s discuss more about proof of work and how it’s related to mining.

Proof of work is a way of making sure that the ledger is secure and can’t be tampered with. The idea is that the computers in the network have to solve a difficult mathematical problem to create a new block. This is usually achieved using a cryptographic hash function, where one has to generate a hash value with a variable set number of preceding zeros. Recall, hashes are one-way so trying to get a particular value requires a lot of bruteforcing with the CPU (the whitepaper suggests it takes around ~10+ minutes).

Mining

This entire process of trying to use computers to solve the mathematical problem is called mining. The computers that are trying to solve the problem are called miners. The first miner to solve the problem gets to create a new block and add it to the ledger. This is called the block reward.

doge

If you imagine a malicious actor trying to tamper with the ledger, they would have to solve the mathematical problem faster than ALL the other miners in the network. This is very difficult to do because the network is decentralized and there are many miners in the network.

Going back to the block reward incentive, this is how new coins are created in the network. There are around 21 million bitcoins that can be mined in total. The block reward is halved every 210,000 blocks. This is to ensure that the total number of bitcoins that can be mined is capped at 21 million. This incentive system also ensures that miners are incentivized to keep the network secure.


Merkel Tree

There’s a lot a lot of math discussed in the bitcoin whitepaper proving how the payment is ensured to be secure, but I’ll now zoom in on how Merkel Tree is used in the blockchain.

A Merkel Tree is a way of organizing data in a tree structure.

merkel Merkel trees are made by hashing pairs of nodes repeatedly until there is only one node left. This is called the root node. The root node is the hash of all the data in the tree. This is important because it means that if any data in the tree is changed, the hash of the root node will also change.

Merkel trees are used in efficient verification of data in the blockchain. For example, if you want to verify that a transaction is valid, you can use the Merkel tree to verify that the transaction is included in a block. This is important because it means that you don’t have to download the entire blockchain to verify a transaction.


Conclusion

I’ve mentioned some of theory behind blockchain, but remember what makes blockchain so special is it doesn’t rely on trust, unlike other traditional systems.

It instead relies on how the proof of work cryptographically secure so the block is so secure. Unlike banks, there is also no central authority that controls the ledger. Instead, it is maintained by a network of computers that are all connected to each other, being decentralised helps to ensure why it’s so secure.

Bitcoin is the first blockchain and it’s created by this mysterious “dude” Satoshi Nakomoto. And whitepaper is a really established document that explains how it works.

last I also would like to add that several platforms have both centralized and decentralized systems. Both serve different purposes, as seen from the table below.

Centralized Decentralized
Faster transactions Slower transactions
Lower fees Higher fees
Less secure More secure
More control Less control
Use case: trading in real time Use case: voting, secure transactions