Bitcoin and Blockchain: Mechanisms for Anti-Counterfeiting, Double Spending Prevention, and Tamper Resistance
Hello everyone! In our previous discussion, we explored the basic principles of Bitcoin and blockchain, understanding that Bitcoin is essentially an electronic accounting system where all transaction records are public yet anonymous. However, this characteristic also raises several challenges: How do we prevent forged records, tampered records, and double spending? Today, we’ll dive into these issues and their solutions in detail.
1. Ensuring the Authenticity of Transaction Records—Digital Signatures
First, let’s look at how Bitcoin ensures the authenticity of its transaction records, or in other words, how it verifies identity. We need to ensure that every record comes from the actual Bitcoin holder and isn’t forged by someone else.
In traditional methods, identity verification might rely on facial recognition, signatures, or fingerprints. For example, when handling business at a bank, you might need to show up in person for a face scan, or sign and fingerprint a document to confirm your approval. However, these methods don’t work in an electronic payment system. Why? Because faces, signatures, and fingerprints can all be replicated in a computer system. For instance, I could copy your signature and attach it to a forged record, making authenticity impossible to guarantee.
To address this, Bitcoin introduces digital signatures, which are based on asymmetric encryption technology. We briefly mentioned this concept when discussing birthday collisions and hash functions earlier, but now let’s explain it specifically in the context of Bitcoin.
Generation of Private and Public Keys
When a user registers a Bitcoin account, the system generates a random number, which is used to create a private key (a string of characters). The private key then generates a corresponding public key through an algorithm, and the public key can further produce an address.
- Private Key: Must be kept strictly confidential and never lost. If you lose your private key, your Bitcoin is gone; if it’s leaked, someone else can steal your assets. That’s why some people store their private keys on offline computers or even memorize them.
- Public Key and Address: These can be shared publicly without issue. If you want to receive money, you give your address to the sender; if you want to send money, you share your public key and address together.
- One-Way Property: The private key can generate the public key, but the reverse is impossible (e.g., the SHA256 algorithm is one-way), providing cryptographic security.
The Digital Signature Process
Suppose A wants to pay B 10 Bitcoins. The process works as follows:
- A writes a record: “A pays B 10 Bitcoins.”
- This record is hashed (e.g., using SHA256) to produce a digest.
- A encrypts the digest with their private key, creating a ciphertext.
- A broadcasts three things to the network: the transaction record (“A pays B 10 Bitcoins”), A’s public key, and the encrypted ciphertext.
Verification Process
Others on the network verify its authenticity:
- They hash the transaction record to get Digest 1.
- They decrypt the ciphertext using A’s public key to get Digest 2.
- They compare Digest 1 and Digest 2:
- If they match, it proves the record came from A, because only A’s private key could have produced that ciphertext. This is the core of digital signatures.
- If they don’t match, the record is deemed forged, and the network rejects it.
This digital signature system, based on hashing and asymmetric encryption, is not only used in Bitcoin but also in many bank card transactions. It effectively prevents forgery and ensures transaction authenticity.
2. Preventing Double Spending
Having solved the forgery issue, another challenge remains: What if A doesn’t have enough Bitcoin or tries to spend the same Bitcoin twice (double spending)? For example, A has only 10 Bitcoins but sends messages saying “Give B 10” and “Give C 10” at the same time. How is this handled?
Balance Check
Bitcoin records all transaction history on the blockchain, and anyone can download the full ledger starting from the genesis block. If A broadcasts “Pay B 10 Bitcoins,” others will trace A’s funds:
- Suppose A earned 50 Bitcoins from mining, spent 20 previously, and has 30 left.
- If A pays 10 to B, the balance is sufficient, and the transaction is accepted and included in a new block.
- If A tries to pay 60 to B, the balance is insufficient, and the transaction is rejected.
By tracing the history, the balance check ensures transaction legitimacy.
Addressing Double Spending
What if A sends two messages almost simultaneously: “A pays 10 to B” and “A pays 10 to C”?
- Each node on the network checks A’s balance upon receiving the messages.
- If “A to B” arrives first and the balance is sufficient, it’s accepted; when “A to C” arrives, the balance is insufficient, so it’s rejected.
- If “A to C” arrives first, the reverse happens.
- However, these messages are only received, not confirmed. Confirmation occurs when a node solves a mathematical puzzle (mining), creates a new block, and broadcasts it. For example, if a node includes “A to B” in a block, that transaction is confirmed, and “A to C” is discarded—or vice versa.
Conclusion: Double spending cannot succeed simultaneously because only one transaction gets recorded on the main chain. Thus, when receiving payment, you shouldn’t assume the money has arrived immediately. You must wait until the transaction is included in the main chain (typically confirmed by a few blocks) to ensure safety. This is Bitcoin’s mechanism for preventing double spending.
3. Preventing Tampering—The Longest Chain Principle
Finally, let’s examine how Bitcoin prevents tampering with records. While digital signatures prevent forgery, someone might try to delete existing records. For example, after A pays B 10 Bitcoins, A might want to erase that record. How is this prevented?
The Longest Chain Principle
Bitcoin uses the longest chain principle: The blockchain may fork (when multiple miners create new blocks simultaneously), but the network always recognizes the longest chain as the main chain.
- Suppose two miners generate new blocks at the same time, causing a fork.
- Nodes continue mining based on the first block they receive.
- If one chain adds a new block first (becoming longer), the network switches to that chain, and the shorter chain is abandoned.
- A minority could stick to the shorter chain, but if it never surpasses the main chain’s length, it won’t be recognized.
Difficulty of Tampering
Suppose A wants to delete the “Pay B 10 Bitcoins” record:
- A would need to start from the block containing that record, recalculate all subsequent blocks, and create a new branch without that record.
- This branch must outgrow the main chain for the network to accept it.
- Globally, a new block is generated every 10 minutes. For A to outpace the entire network’s computing power alone is nearly impossible.
- Even if someone controls over 50% of the network’s computing power, tampering is theoretically possible, but such a person would likely profit more from mining than tampering.
Thus, tampering becomes harder as the chain grows. For large transactions, waiting for 6 block confirmations virtually eliminates the possibility of tampering.
4. Advantages and Disadvantages of Bitcoin
Bitcoin is a remarkably innovative technology:
- No central authority, immune to sovereign crises.
- Fixed supply, no risk of over-issuance.
- Anti-counterfeiting, traceable, low fees.
- Some even suggest Satoshi Nakamoto deserves a Nobel Prize in Economics.
However, its anonymity also poses problems: Criminals use Bitcoin for extortion, drug trafficking, and money laundering, attracting government crackdowns. Additionally, Bitcoin’s price fluctuates wildly, with speculators experiencing overnight riches or ruin. I recommend viewing it as a technological tool and, if investing, adopting a long-term perspective rather than a speculative mindset.
Conclusion
Through digital signatures, double-spending prevention, and the longest chain principle, Bitcoin ingeniously addresses the challenges of anti-counterfeiting, double spending, and tamper resistance.



Post Comment