2

My understanding is that nodes maintain a mempool of unexecuted transactions. They use a bloom filter to query other nodes for transactions they do not currently have in their own mempool... thus synchronizing the state of the mempool for each node in the network.

I don't understand why this is necessary -- can't all the nodes just be sent the winning block (along with the transactions inside of it) once it is received by one of the nodes? They can then just verify the transactions within that block. What am I missing here?

0

3 Answers 3

6

There's no bloom filters involved, or any actual attempt at synchronization. Nodes relay transactions they hear about to one another, so there's probably some level of consistency in mempool contents but no guarantee. If there was no mempool, there would be no way for miners to learn about unconfirmed transactions to include in blocks to begin with.

3

As usual with Bitcoin, it's important to think about each party's incentives.

Miners earn a fixed reward for each block they find, but they also get additional rewards based on the transaction fees in that block. Each block takes a lot of work to find, and has a limited maximum size. If a miner is working on constructing a potential new block, it can improve its expected outcome by looking for as many transactions as possible to fill it with -- either to fill space that was previously unused, or to replace transactions with others that have higher fees.


You might be tempted to conclude that it's also in a miner's interest to keep juicy, high-value transactions to itself, instead of broadcasting them. After all, if you can reduce the expected rewards that other miners earn, you make them less willing to compete for blocks, and therefore increase your own average share.

But users also have an interest in having their transactions incorporated into the blockchain as quickly as reasonably possible. If a miner can't be relied on to relay transactions to the entire network, those transactions will not be reliably executed, and users won't want to send them to that miner in the first place.


In a sense, individual miners are free to do whatever they want. But participating in the mempool synchronization protocol is much more lucrative than not doing so.

2

The Bitcoin network is scale-free, all participating nodes have the same privileges. Even nodes that are not currently participating in mining should be able to mine a block at any point in time. Since miners need to learn about unconfirmed transactions in order to include them in blocks, all nodes should.

The relay of transactions is not a waste even if a node is not mining. Learning about unconfirmed transactions makes recipients aware that they may be expecting a payment (allowing them to interact with the unconfirmed outputs), allows them to validate transactions before they are announced in blocks, enables estimating feerates on basis of which transactions are getting included in blocks, and spreads out bandwidth usage for relay.

Transaction data by itself does not have propagation guarantees, they're just forwarded per best-effort. While mempools of different nodes have large overlap, they are not synchronized. Synchronization only happens for the best chain of blocks: blocks and the transaction included in blocks have propagation guarantees.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.