How Blockchain Prevents Tampering?
3 min read
One of the benefits of blockchain over centralized monetary systems is security: accounts are anonymous, and there is no inflation caused by currency over-issuance. In the article ‘ How does Bitcoin Avoid the Double-spending Problem?’ we introduce the timestamps and the longest chain principle that can help eliminate double-spending, and in today's article, we'll look at why blockchain transactions are practically hard to tamper.
Simply put, the blockchain network itself, is a super large distributed ledger. In other words, it's a ledger that keeps track of all the transactions that happen across the entire blockchain network, and it's distributed to every node and updated in real-time. Let's look at how the blockchain achieves this distributed ledger from a technological standpoint, which leads us to the blockchain's special structure.
A blockchain is made up of blocks that are chronologically linked together. Each block is split into two sections: the block header and the block body. The block body is a simple ledger that records transactions that occurred within 10 minutes of the block being created. The block header, on the other hand, consists of the sections listed below.
1.Version number: identifies the transaction's version and the rule to which it corresponds.
2.Previous block hash: i.e., the value resulting from hashing the block header data of the previous block. Thus there is a logical order between any two connected blocks, except for the Genesis block which has no previous blocks, and tampering with the data of one block alone will cause it to be disconnected from the subsequent block, and the two blocks are disconnected from each other.
According to the longest chain principle (for a detailed explanation, see the article ‘ How does Bitcoin Avoid the Double-spending Problem? ’, the only way to tamper with the data of a particular block is to build a new, malicious block after the previous block of that block, and to ensure that the newly generated blocks all follow the malicious block in real-time until the chain is longer than the original and becomes the longest chain.
In actuality, you'll need at least 51 percent of the computing power to ensure that all subsequent blocks are generated after a block. Notice that this is mere "hope," not "100% success." Although the possibility of a 51 percent attack exists for some small minority coins, the market price of them has determined that there is no need to do so from the standpoint of the input-output ratio. And for a widely used digital currency like Bitcoin, achieving such a goal would come at a significant financial cost, causing fraudsters to lose more money than they gain.
3. Merkle root: Are all the transaction information within a block (10 minutes), arranged in a Merkle tree structure. The leaf nodes follow a 2x2 hash, generating the upper layer of nodes. The upper layer of nodes then hash, generating the upper layer until finally generate a tree root, called the Merkle tree root, this hash value is on the block head .
Any change in the block of any transaction will lead to a change in this Merkle root data in the block head, making this block not match with its next block data, and then back to the situation we mentioned in the previous paragraph.
4.Timestamp: records the time of block generation, as we described in our article ‘How does Bitcoin Avoid the Double-spending Problem?’ in which we describe that timestamps can effectively avoid the double spending problem.
5.Network difficulty: the difficulty target for mining the block. The difficulty of the data block operation is adjusted once for every 2016 blocks generated.
6.Random number: The "answer" that the miner is looking for during the mining process to get a random number for the right to add a new block.