MultiversX Tracker is Live!

How does Bitcoin prevent double-spending without penalizing miners?

Bitcoin Stack Exchange

Bitcoin News / Bitcoin Stack Exchange 148 Views

I'm going to offer a frame challenge. Your scenario makes no sense to me, because you seem to have a wrong perception of how the blockchain works and is propagated on the network.

First problem: at 6:02 Node-5 has already heard about transaction A->B. Transactions are only propagated at best effort but transactions that are candidates for the next block should get to most nodes within 30 seconds. No biggie: we can fix that by making the attacker send at 6:00 in parallel A->B to Node-8 and A->C to Node-5. So Node-5 and Node-8 do have different views on the unconfirmed transactions now and each considers their payment valid. If they see the other transaction, they will reject it because it's in conflict with the one they have already.

Now at 6:08 Node-8 finds a new block which includes A->C. Block propagation has the highest priority and the propagation of blocks is guaranteed. Some nodes might not hear about an unconfirmed transaction, but every node hears about a new block within seconds. If the block is valid and the new best chain-tip, everyone extends their blockchain with that new block. At this point Node-8 realizes that A->C has spent the funds and the transaction A->B is now invalid. Node-8 drops A->B from their mempool. Every miner, including Node-8, switches to trying to find a new block that follows the block that was published by Node-5. The doublespend has been resolved, because only one of the transactions has survived.

Nodes validate transactions before they add them to their mempool. At that point they can only assess whether a transaction would be eligible to be included in a block, and they only keep the first (or best) conflicting transaction they see. Once a block is published the content of the block always supersedes the content of their mempool. Blocks are the shared ground truth of the network and the blockchain has only one block at every height. When the chaintip progresses, everyone starts working on the new height.

If Node-5 and Node-8 had found their blocks at the same time (within a couple seconds of each other), they would have each broadcast theirs to their peers. Every node would stick to whatever block they had seen first until another block were found. Then everyone would converge on the new best chaintip and the other block would become an extinct chaintip, not part of the best chain.


Get BONUS $200 for FREE!

You can get bonuses upto $100 FREE BONUS when you:
πŸ’° Install these recommended apps:
πŸ’² SocialGood - 100% Crypto Back on Everyday Shopping
πŸ’² xPortal - The DeFi For The Next Billion
πŸ’² CryptoTab Browser - Lightweight, fast, and ready to mine!
πŸ’° Register on these recommended exchanges:
🟑 Binance🟑 Bitfinex🟑 Bitmart🟑 Bittrex🟑 Bitget
🟑 CoinEx🟑 Crypto.com🟑 Gate.io🟑 Huobi🟑 Kucoin.



Comments