How Does a Blockchain Prevent Tampering?
- A blockchain is a data structure made of data blocks that are linked together.
- Each block is made up of multiple "transactions" or simply, "facts."
- When a block is created, the blockchain will calculate its checksum, which includes data about the included transactions, the block number, and the previous block's checksum.
- Every block’s state of validation depends on all the blocks before it. The longer the blockchain gets, the harder it is to change.
- If one block is tampered with, the checksum will be different, invalidating all the previous blocks.
- There is a small chance that one node could overwrite a couple of blocks at the tip of the chain. But nodes that play by the rules would quickly outpace the bad node since they can calculate valid nodes faster than the bad node.
Important note: Blockchains are only effective if they have many participants. If you only have a dozen or so nodes, a takeover by malicious parties would be incredibly easy.
3 Signs Blockchain is the Wrong Choice
- When you need to support CRUD commands. In a traditional database, you can perform four functions on data: create, read, update, and delete (CRUD). The blockchain is designed to be append-only — all previous data is permanently stored and can’t be altered.
If you’re building a product that requires the ability to update and delete data, blockchain is a bad fit.
- Applications where speed and performance are critical. Most blockchains today aren’t just slow because the technology is new — the amount of computing power required to process transactions is a core piece of blockchain technology.
When processing transactions, a blockchain has to do all the same things as a regular database, but it carries three additional burdens:
- Signature verification. Every blockchain transaction must be digitally signed using public-private cryptography. This is necessary because transactions propagate between nodes in a peer-to-peer fashion, so their source cannot otherwise be proven.
- Consensus mechanisms. In a distributed database such as a blockchain, effort must be expended to ensure that nodes reach consensus. Depending on the consensus mechanism used, this can involve significant back-and-forth communication. While centralized databases also contend with conflicting and aborted transactions, these are far less likely because transactions are queued and processed in a single location.
- Redundancy. Whereas centralized databases process transactions once (or twice), in a blockchain they must be processed independently by every node in the network. So a lot more work is being done for the same end result.
- Applications where confidentiality is crucial.
Every node in a blockchain independently verifies and processes every transaction. A node can do this because it has full visibility into the database’s current state, the addition requested by a transaction, and a digital signature which proves the transaction’s origin.
So What’s the Catch?
For many applications, full transparency is an absolute deal-killer. To be fair, there are strategies to mitigate this problem. Nonetheless, the more information you want to hide on a blockchain, the heavier a computational burden you pay to generate and verify transactions.
A simple rule of thumb: Ask yourself, “Could I do this with a regular database?” If the answer is, “yes,” then you don’t need blockchain.