What is Blockchain?

Killua
4 min readJun 12, 2022

--

Blockchain is incredibly popular nowadays. But What is Blockchain? How does it work? What problems they do solve and how can they be used?

Like the name indicates, a blockchain is a chain of blocks that contain information. This technique is originally described in 1991 by a group of researchers and was originally intended to timestamp digital documents so that it’s not possible to backdate them or tamper with them. Almost like a notary. However, it went mostly unused until it was adapted by Satoshi Nakamoto to create a digital cryptocurrency Bitcoin. A blockchain is a distributed ledger that is completely open to anyone. They have an interesting property. Once some data has been recorded inside a blockchain, it became very difficult to change it.

So, how does that works? Well, let’s take a closer look at a block-

Each block contains some data, the hash of the block, and the hash of the previous block. The data that is stored inside a block depends on the type of blockchain. The Bitcoin blockchain for example stores the details about a transaction in here, such as the sender, receiver, and the amount of coins. A block also has a hash. You can compare a hash to a fingerprint. It identifies a block and all of it is contents and it’s always unique, just like a fingerprint.

Once a block is created, its hash is being calculated changing something inside the block will cause the hash to change. So, in other words, hashes are very useful when you want to detect changes to the blocks. If the fingerprint(hash) of the block changes, it is no longer the same block. The third element inside each block is the hash of the previous block. These effectively create a chain of blocks and it’s this technique that makes a blockchain so secure.

Let’s take an example,

here we have a chain of 3 blocks. As you can see, each block has a hash and the hash of the previous block. So, block number 3 points to block number 2 and block number 2 points to block number 1. Now the first block is a bit special, it cannot point to previous blacks because it is the first one. We called this the genesis block. Now, let’s say you tamper with the second block. This causes the hash of the block as well. In turn that will make blocks and all the following blocks invalid because they no longer store a valid hash of the previous block So, changing a single block will make all following blocks invalid. But using hashes is not enough to prevent tampering.

Computers these days are very fast and can calculate hundreds of thousands of hashes per second. You could effectively tamper with a block and recalculate all the hashes of other blocks to make your blockchain valid again. So, to mitigate this, blockchain has something called proof-of-work. It’s a mechanism that slows down the creation of new blocks. In the Bitcoin case, it takes about 10 minutes to calculate the required proof-of-work and add a new block to the chain. This mechanism makes it very hard to tamper with the blocks because if you tamper with one block you’ll need to recalculate the proof-of-work for all the following blocks as well.

So, the security of a blockchain comes from its creative use of hashing and the proof-of-work mechanism. But there is one more way that blockchains secure themself and that’s by being distributed. Instead of using a central entity to manage the chain, blockchain uses a peer-to-peer network and anyone is allowed to join. When someone joins this network he gets the full copy of the blockchain. The node can use this to verify that everything is still in order.

Now let’s see what happens when someone creates a new block. That new block is sent to everyone on the network. Each node then verifies the block to make sure that it hasn’t been tampered with. If everything checks out, each node adds these blocks are valid and which aren’t. Blocks that are tampered with will be rejected by other nodes in the network. So, to successfully tamper with a blockchain you’ll need to tamper with all the blocks on the chain, redo the proof-of-work for each block and take control of more than 50% of the peer-to-peer network. Only then does your tampered block become accepted by everyone else. This is almost impossible to do!

Blockchain is also constantly evolving. One of the more fascinating development is the creation of smart contracts. These contracts are simple programs that are stored on the blockchain and can be used to automatically exchange coins based on certain conditions. The creation of blockchain technology peaked a lot of people’s interests. Soon, others will realize the technology Can be used for various purposes.

Learn more about Blockchain from Investopedia.

--

--

Killua
Killua

Written by Killua

Independent Security Research Engineer, I share my insights as I traverse the field of Blockchain Security, @0xHriday across all platforms.

No responses yet