Companies spend billions of dollars trying to ensure their various databases full of sensitive data are correct and hasn’t been tampered with. Meanwhile Bitcoin’s blockchain seems to have already solved this problem perfectly. So why is the Bitcoin blockchain immutable and could we bring this new technology to private company databases?
Contents
What Is A Blockchain?
To start with, a Blockchain is a distributed database, also referred to as a distributed ledger, that’s shared between many nodes on a network. They are most commonly used in cryptocurrency networks, but they have been used for other things too. The data stored in a blockchain is immutable, which means that it cannot be altered or changed.
In order to keep track of who owns what tokens or coins, cryptocurrencies use blockchain technology. This big database or file is constantly updated to show who owns what. For example it might say “Bill owns 1 bitcoin”.
Why Is Blockchain Immutable?
In order to properly explain why the Bitcoin blockchain is immutable we need to explain what a hash is and how blocks in the blockchain are structured.
Cryptography And The Hashing Process
Cryptographic Hashing or a hash function might sound complicated, but it’s just a special algorithm that takes in some data and outputs different data. In the case of bitcoin the specific algorithm that’s used is the Secure Hashing Algorithm 256 (SHA256).
For example the SHA256 hash of “hello” is:
“2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824”
This output serves as a digital signature for the original data.
While the math behind the hashing process is a little complex, the important thing to understand is that once you put any sort of data through a hashing process it’s virtually impossible to reverse.
The output is a seemingly random set of 64 numbers and characters regardless of how much input data you put in and even the slightest change in 1 bit of that original data will output a totally different and unique hash value.
A Chain Of Blocks
While they’re quite a bit more complicated than what’s shown below, to understand blockchain immutability just focus on the block header part.
Each block has a header section that’s made up of various bits of data like a timestamp, nonce, Merkle Root and more. This header data is then put through our hashing process and the output string is stored in the next block.
That next blocks header data is also hashed and the value stored in the next blocks header. Each new block being linked to the previous block in this unique way is what ensures bitcoins data integrity and immutability.
If for example an attacked tried to change some transaction data in Block 11 in our example above, the hash of that blocks header would also be changed. Any full Bitcoin Node would pick up that this new hash value was different to the one stored in the header during its auditing process of Block 12 and start throwing errors.
While traditional databases can have their data tampered with or erased entirely, Bitcoins immutable ledger and this blockchain hashing process ensures that if even 1 bit of data is changed or erased, the entire network knows about it. This is what makes blockchain ledger immutable.
Can Centralized Databases Be Immutable?
While having a single, centralized database is much quicker and cheaper to operate than a blockchain network, the central authority could change or erase whatever data they wanted to meaning it’s not immutable.
As the database is centralized it means it’s exposed to other problems too such as being damaged, accidentally/intentionally deleted or just lost for whatever reason. This is why companies will usually make backups of their databases and store them off site. Blockchains take this to a whole new level.
Instead of having one central copy of the data that’s backed up every now and then, a blockchain has thousands or tens of thousands of copies all spread out across the world. This decentralization of the Bitcoin blockchain is incredibly important and a core principle of why Bitcoin is structured the way it is.
This decentralization not only ensures that the data is safe and will never be lost, it also adds to its immutability. For example, if an attacker tried to change the blockchain on their own node, all the other nodes would instantly recognize it as incorrect and reject it.
What About A Private Blockchain?
Data that’s stored on a private or permissioned blockchain network can have the same design as Bitcoin, employing cryptographic hashing and chaining blocks together, but that doesn’t mean it will be automatically immutable.
This is because in order for data in a blockchain ledger to be edited you must alter the block in question, as well as the next subsequent block after it. Then the next, and the next until your reach the tip of the blockchain.
Due to the Proof of Work (PoW) process that bitcoin uses, this requires huge amounts of hash power which requires a lot of expensive ASIC miners and a lot of electrical energy. The more blocks that need editing, the more power is required. This is why the data security of the bitcoin network is the best in the world, because it has the highest hash rate.
The higher the hash rate of the specific blockchain network is, the more resistant it is to 51% attacks and the more certain everyone can be that all data in the blockchain remains immutable. With private blockchains, there usually isn’t a very large amount of hash rate protecting them. As such an attack can, and often has, lead to changes in the historical record.
Benefits Of Immutability In Blockchain Technology
- Tamper Resistant: As every block is cryptographically linked to the block before it, tampering with a blockchain database is impossible. By contrast, a centralized database could be secretly altered and there would be no way to know that it was changed or by whom
- Efficient Auditing: Validating and securing traditional databases takes work and as such, costs money. As blockchains perform this entirely automatically (via checking the block headers hashes) rather than via humans and multiple third party companies, thing are much more efficient and transaction fees costs much less
- Reduced Errors: As this processing of transactions and checking of hashes is done entirely by computers with tens of thousands of them checking every bit of data with each new block, there are no errors like there are with humans and trusted third parties or companies doing this
The primary benefit of immutability in blockchain is to ensure that all parties are being honest and not defrauding others. If no one can alter the blockchain, then no one can cheat anyone else.
Disadvantages Of Immutability
- 51% Attacks: If an entity amasses more than 51% of the Hashing Power (or Hash Rate) of the blockchain network then they can start to rewrite the data stored in blocks. This compromises the immutable records and allows them to block or reverse transactions for as long as they hold this power
- Decreased Speed: As transaction information must be shared with tens of thousands of nodes all throughout the world, this means that it takes longer to add new data to a blockchain. On average, each new block full of hundreds or thousands of transaction is added once every 10 minutes. By contrast, adding a new transaction to a centralized database happens essentially instantly
- Decreased Efficiency: When you make more and more copies of the same data then this obviously makes things less efficient than having two or three copies
- Increased Cost: As there are more copies of the data all being stored on more computers, this by its very nature means the data storage costs are higher for blockchains.
- Decreased Centralized Control: Blockchains are usually, but not always, open, transparent and paired with a decentralized network. This means that no one person, company or government controls it. This means that controlling “illegal activity” is not possible. This can be both a pro and con as while it allows access for the billions of unbanked people in the world, it also makes criminal transactions unstoppable. That being said, even criminals are slowly learning that having their crimes stored in a fully open, immutable database isn’t a very smart idea!
Immutability Doesn’t Mean Truthful Data
One final thing to mention about immutability is that it’s different from having accurate or truthful data. Complete data integrity only means that the data that’s put into the database remains the same and isn’t tampered with. It does not mean that the data was accurate in the first place.
For example, you could mine a new block that had the correct hash value of the previous block header in it, but had fraudulent transactions in it. The immutability of the blockchain network wouldn’t prevent this however other checks and balances in Bitcoin Core would.
You can also embed various types of other non-financial data in the bitcoin blockchain such as text in the OP_RETURN area. While you can be certain that this data isn’t altered, there’s no guarantee that it’s at all truthful or accurate.
FAQ
Is Blockchain Immutable And Tamper Proof?
Yes. The only way anyone can tamper with the Bitcoin blockchain is by launching a 51% attack. To gain control of 51% of the hashing power would require around 250 ExaHash worth of mining capacity or around 1.8 million Antminer S19 XP ASIC miners. This would cost around $5+ billion dollars, not to mention require huge, dedicated power plants to run them.
Are Blockchain Transactions Mutable?
No. The header in a block is hashed and embedded in the next block to ensure no one can alter or tamper with the data. All transaction data is also represented inside this header via the Merkle Root part.
Can A Blockchain Be Edited?
In order for data in blockchain networks to be edited you must alter the block in question, as well as all subsequent blocks after it. Due to the Proof of Work (PoW) process that bitcoin uses, this requires huge amounts of hash power. The more blocks that need editing, the more power is required. As such, the level of data security protecting the bitcoin network is the highest in the world.