Blockchain 101

Blockchains are incredibly popular nowadays. As the name indicates, a Blockchain is a chain of blocks that contains information. This technique was 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 to tamper with them. Almost like a notary.

However, it went by mostly unused until it was adapted by Satoshi Nakamoto in 2009 to create the 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 becomes very difficult to change it. So how does that work? Well, let’s take a close 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 here, such as the sender, receiver, and amount of coins.

A block also has a hash. You can compare a hash to a Blockchain terminology called a Fingerprint. It identifies a block and all of its contents and it’s always unique, just as an actual 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 blocks.

If the Fingerprint of a block changes, it no longer is the same block. The third element inside each block is the hash of the previous block. This effectively creates 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 imagine, each block has a hash and the hash of the previous block. So, block number 3 points to block number 2 and number 2 points to number 1. Now the first block is a bit special, it cannot point to previous blocks because it’s the first one. We call this block the Genesis Block. Now let’s say that you tamper with the second block. This causes the hash of the block to change as well. In turn that will make block 3 and the following blocks invalid because they no longer store a valid hash of the previous block. So, changing a single block will make all the following blocks invalid.

But using hashes is not enough to prevent tampering. GPUs 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, Blockchains have something called Proof-of-Work (PoW). It’s a mechanism that slows down the creation of new blocks. In Bitcoin’s 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 1 block, you’ll need to recalculate the Proof-of-Work for all the following blocks.

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 themselves and that’s by being distributed. Instead of using a central entity to manage the chain, Blockchains use a Peer-to-Peer (P2P) network and anyone is allowed to join. When someone joins this network, he/she gets a 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. The 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. And if everything checks out, each node adds this block to its own Blockchain. All the nodes in this network create consensus. They agree about what 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 blocks on the chain, redo the Proof-of-Work for each block and take control of more than 50% of the Peer-to-Peer (P2P) network. Only then will your tampered block become accepted by everyone else. So, this is almost impossible to do!

Blockchains are also constantly evolving. One of the most recent developments in the creation of Smart Contracts. They are just like contracts in the real world. The only difference is that they are completely digital. In fact, a Smart contract is actually a tiny computer program that is stored inside a Blockchain.
 
 
So, let’s create a Smart Contract for this. We can program the Smart Contract so that it holds all the received funds until a certain goal is reached. The supporters of a project can now transfer their money to the Smart Contract. If the project gets fully funded, the contract automatically passes the money to the creator of the project. And if the project fails to meet the goal, the money automatically goes back to the supporters.
 
And because the Smart Contract is stored on a Blockchain, everything is completely distributed. With this technique, no one is in control of the money. Since Smart Contracts are stored on a Blockchain, they inherit some interesting properties. They’re immutable and they are distributed. Being immutable means that once a Smart Contract is created, it can never be changed again. So, no one can go behind your back and tamper with the code of your contract. And being distributed means that the output of your contract is validated by everyone on the network. So, a single person cannot force the contract to release the funds because other people on the network will spot this attempt and mark it as invalid. Tampering with Smart Contracts becomes almost impossible.
 
Smart Contracts can be applied to many different things, not just crowdfunding. Banks for example could use it to issue loans or to offer automatic payments. Insurance companies could use it to process certain claims and postal companies could use it for payment on delivery and so on. So, now you might wonder where and how you can use Smart Contracts. Right now, there are a handful of Blockchains that support Smart Contracts, but the biggest one is Ethereum. It was specifically created and designed to support Smart Contracts. They can be programmed in a special programming language called Solidity. This language was specifically created for Ethereum and uses a syntax that resembles JavaScript. It's worth noting that Bitcoin also has support for Smart Contracts although it’s a lot more limited compared to Ethereum.
The creation of Blockchain technology peaked a lot of people’s interest. Soon, others realized that the technology could be used for other things like storing Medical Records, detecting Deep Fakes, creating Digital Notary or even collecting taxes. So now you know what a Blockchain is, how it works on a basic level and what problems it solves.

Rate this FAQ

0 (0 Votes)

Related entries