5

According to https://github.com/bitcoin/bitcoin/blob/master/src/net_processing.cpp#L3775-L3801, it seems like the mempool message is only responded to in certain cases. Can someone help understand how this works and why a full node would not always respond to this message? Is it being deprecated?

I'm looking for ways to estimate fees through the p2p layer, and getting the mempool content seems like the best option so far, if nodes reliably reply to the message.

1 Answer 1

7

Full nodes have absolutely no use for the mempool message, it is vestigial from bip35 and has had a history of causing privacy leaks due to its poor implementation. It has previously been used to bypass transaction trickling, or just cause an enormous amount of waste data transfer. Modern versions of Bitcoin Core do not ship with bip37 enabled, which means they will not respond to the message without configuration changes.

It would not be a good solution for attempting to estimate fees regardless, as you would cause potentially gigabytes of transfer of transactions you have absolutely no way of verifying. Estimating fees, by and large, needs to be delegated and there are many APIs for doing so.

3
  • 3
    The mempool message was actually introduced in BIP35, which predates the BIP37 Bloom filtering. However, later it was changed to only be permitted when combined with BIP37 filtering, to prevent the worst problems with it. Even later, BIP37 was made optional and defaulting to off, so in general, no, most modern Bitcoin Core nodes will not respond to it anymore, unless specifically configured to allow it. Commented Aug 22, 2021 at 16:24
  • @PieterWuille Corrected, my memory of where it came from was wrong. Thank you.
    – Claris
    Commented Aug 22, 2021 at 16:26
  • 1
    I believe there are several ways to configure bitcoind to support mempool requests: (1) the "-peerbloomfilters" config option - this allows BIP37 bloom filters for all peers, and by extension also adds support for mempool requests. (2) the "-whitebind=bloomfilter" setting to allow BIP37 bloom filters and mempool requests on all inbound connections to a specified local IP address. (3) the "-whitelist=bloomfilter" setting to allow BIP37 bloom filters and mempool requests for a specified remote IP address (4) the "-whitebind=mempool" or "-whitelist=mempool" for just mempool permissions
    – jnewbery
    Commented Aug 25, 2021 at 11:02

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.