Bitcoin – getrawmempool Behavior

When calling the getrawmempool RPC method, the number of transactions returned may vary significantly between requests. This is normal and reflects how nodes maintain mempool state.


What You May See

Typical responses may contain anywhere from hundreds to a few thousand transactions, but at times responses may include tens of thousands.

Example RPC request:

curl --location 'https://bitcoin-mainnet.blockchain.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
  "id":1,
  "jsonrpc":"2.0",
  "method":"getrawmempool",
  "params": [false]
}'
//Response_a:
{
  "result": [ ... 3,142 transaction hashes ... ],
  "id": "1",
  "jsonrpc": "2.0"
}
//Response_b:
{
  "result": [ ... 37,856 transaction hashes ... ],
  "id": "1",
  "jsonrpc": "2.0"
}

📘

Note

Both responses are valid. They reflect which node served the request and the state of its mempool at that moment.


Why The Response Difference

Several factors influence the size and content of mempool data:

  1. Node Uptime
    Nodes that have been running longer tend to accumulate more transactions, including low-fee or long-pending ones. Newly restarted nodes may show fewer.
  2. Mempool Size Configuration
    Nodes can have different maxmempool settings (for example, 300 MB vs. 4,000 MB). Larger limits allow the node to retain more transactions.
  3. Round-Robin Routing
    Tatum routes requests across multiple nodes. Depending on which node responds, the transaction count may vary.
  4. Bitcoin’s UTXO Model
    In a UTXO-based chain, like Bitcoin, mempool contents naturally differ between nodes due to transaction propagation, fee policies, and local conditions.

Good To Know

Variations in getrawmempool results are a natural part of interacting with nodes from UTXO chains, like Bitcoin, in a distributed environment. The mempool is not uniform across the network, and transaction counts will differ depending on node uptime, configuration, and routing.

This behavior is expected.