How to avoid conflicts in a peer-to-peer topology (Bitcoin)?


For example in Bitcoin, if I want a miner to verify whether other miners store a transaction, before deleting it from his mempool.

How can I handle the case more than one miner doing the verification at the same time?

Is it possible to use backoff algorithm?


Posted 2019-03-05T10:50:49.360

Reputation: 35

2It's impossible to answer this as its based on a misunderstanding of the system. – Anonymous – 2019-03-05T15:17:47.653



The mempool is just a temporary store of unconfirmed transactions. Each node's mempool is not synchronized, and in fact a node could choose to not keep a mempool at all. So no node needs to verify whether anyone else has a transaction, before deleting it from their memory. Miners will choose transactions from their mempool, to build new block templates that they will mine on.

What matters is the blockchain. Each new valid block will (likely) include some transactions, so when a node hears about that block, it will update its mempool accordingly (removing transactions that have been confirmed in the block).

Thus, miners can all be attempting to mine a block that includes the same (or different) transactions, and it is simply the first miner to find a valid block that will 'win', with their block being appended to the blockchain. All other miners will see this new block, and start to mine on top of it, adjusting their mempool (and thus the transactions they include in their new attempts to find a block) accordingly.


Posted 2019-03-05T10:50:49.360

Reputation: 13 841

So all miners will work on what they see as a full block of transactions, when a miner found a valid block it will broadcast it on the network to everyone. At that point will all other other miners stop mining and verify the new valid block? After that the miner will collect see what transactions where now verified and assemble a for a new block I assume. In the bitcoin blockchain there the miners will stop collecting transactions every 10 minutes (on average). Other parameters is the priority (fee) and congestion in the network (to many transaction). Are these assumptions correct? – Damian – 2019-03-06T01:56:47.153

I now understand that the difficulty is adjusted my looking at the average time between verification over the last 2 weeks. The goal is to get this to about 10 minutes in bitcoin. – Damian – 2019-03-06T02:09:04.177

2Miners never stop mining. They are continuously trying to find a successor block, with a contents drawn from the mempool of that time. Whenever a new block is found, their mempool changes, and thus their next future attempts will be on top of that. – Pieter Wuille – 2019-03-06T02:17:08.627

So when the first miner solves the hashing solution and broadcasts it, will the other miners verify that block? I assume the transactions are sealed in the block that we are trying to reach consensus on, but what if a the different blocks the miners are checking have different transactions in them? – Damian – 2019-03-07T08:54:14.897