How does Blockchain technology work? A beginners guide to Blockchain
Whether you’re a cryptocurrency investor, an enthusiast of new technologies, or just someone who likes to stay up-to-date with the current trends, you’ve probably heard about the blockchain technology. But do you understand how blockchain works? What exactly is blockchain and why is it such a big deal?
To make it easier to understand how this revolutionary technology works, we have compiled this simple guide explaining the fundamentals of blockchain.
What is blockchain technology used for?
The main idea behind blockchain is to allow value exchange between two parties without the need for a central authority overseeing the transaction.
Let’s imagine that Alice, who lives in the USA, wants to pay 5 dollars to Bob, who lives in France.
Traditionally, she would have to send the money through a bank or via another payment operator, such as PayPal. This means she has to entrust her money the bank or the operator and let them provide it to Bob. She will probably have to pay some additional fees for the transaction as well, and Bob might have to wait a week or two for the money to arrive. After all, international transfers tend to pass through many banks on their way.
In return, she gets the guarantee that Bob will not try to deceive her and say that he never got the 5 dollars. The financial institution has all the transaction data and can prove that 5 dollars were deducted from Alice’s account, and entered Bob’s account.
What if Alice and Bob wanted to remove the third party from the equation, but don’t trust each other very much? Maybe they even suspect that the other party might try to lie about sending or receiving money?
This is where blockchain comes in handy! So, how does it work, and how does it solve the problem of trust?
Blockchain – a chain of blocks
It’s all there in the name – blockchain can be visualised as a chain of blocks.
Each of those blocks, or records, contains the following elements:
- Cryptographic hash;
- Previous block’s hash
Let’s start with the data. The type of data stored in the block depends on the type of blockchain. In case of the Bitcoin blockchain (and blockchains behind other cryptocurrencies), the blocks contain data related to transactions – such as the identities of the sender and the the receiver, the value and date of the transaction and so on.
Next, what is a cryptographic hash? Essentially, it’s the block’s fingerprint. Each block is identified by a unique hash – a string of letters and numbers calculated based on the data stored in the block. If any of the data is tampered with – the hash automatically changes too, which means that the modified block is no longer treated as the same block.
Since each block contains the previous block’s hash, all the blocks in a blockchain are connected. If any of the blocks in the chain is tampered with – that is, data within it is modified – the hash of that block changes. That causes all the following blocks to be invalid, as they no longer connect to the modified block.
This means that once data (for example – regarding a transaction) is registered, you can not modify the data without modifying all the following blocks in the chain. Because of that, it is very easy to notice any alteration to data registered on the blockchain – or, in other words, notice any attempts at fraud or forgery.
Let’s get back to the example with Alice and Bob again. When Alice sends 5 dollars to Bob, that transaction is recorded into a block. Since there are other transactions going on at the same time, new blocks are added on top of it.
Imagine that Bob tries to change the data to make it seem like Alice had sent him 100 dollars instead of 5. The moment he does that, the block in which the transaction data is stored receives a new hash. Then, all the blocks created after it immediately become invalid, making it obvious, that the data has been tampered with and exposing the fraud attempt!
Proof of work
But what if you just change the hashes of every block in the chain? With computers getting faster and faster, the computational power required to calculate a new hash for each block, even in a very long chain, should not be a problem.
This is why blockchains come with an additional safety measure – proof of work. To put it simply – in order to be allowed to modify a block, the user first has to solve a puzzle – which requires both time and power. Modifying a whole chain requires large amounts of computational power, and is very time consuming. As such, a user would usually have to spend much more resources, than they would gain on the forgery.
So, if Bob tries to make it seem that Alice had sent him a 100 dollars instead of $5, it might in practice cost him thousands of dollars spent on electricity required to make all the necessary calculations!
A decentralised network
Let’s say that a user still finds it profitable to try and modify all the blocks in the blockchain to tamper with data contained in it.
Fortunately, there is another mechanism keeping them from just changing all the data.
You see, the blockchain database is not just stored in one place. Every single user in the network has their own copy of the entire chain on their computer, and those copies are regularly compared with each other. This happens automatically, with no action required from the users themselves.
The copy that is most prevalent is considered the valid one. So, even if someone tried to modify the data in their copy of the chain, it would automatically be marked as invalid. Therefore, the network would ignore the proposed changes.
Let’s say that the blockchain containing the data regarding Alice’s and Bob’s transaction is stored in a network of 100 computers. Even if Bob spends all the computational power required to alter his copy of the blockchain, his version of the chain will only exist on his own computer. The remaining 99 computers will still have the original version of the chain. Once the versions are compared, it will become obvious that Bob’s copy is not the real one, and it will be automatically removed and replaced by the untampered version.
So, that’s blockchain fundamentals for you!
So, now you know how blockchain works on the basic level. As you can see, the blockchain technology makes it virtually impossible to change the data stored in a blockchain. This is why blockchain has found its uses in trade – but that is not all. Many institutions are currently researching possibilities of using the technology for other purposes, such as smart contracts, election fraud prevention, or storing medical records.
With this knowledge, you can now continue your journey in the cryptocurrency world with full understanding of what makes blockchain – and the currencies using the technology – so special.