Bitcoin – getrawmempool Behavior

getrawmempool results vary because each Bitcoin node keeps its own mempool, shaped by uptime and the 4 GB maxmempool, and requests are routed across nodes.

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.gateway.tatum.io' \
--header 'Content-Type: application/json' \
--header 'x-api-key: {YOUR_API_KEY}' \
--data '{
  "id":1,
  "jsonrpc":"2.0",
  "method":"getrawmempool",
  "params": [false]
}'

Example response (shortened):

{
  "result": [
    "{TXID_1}",
    "{TXID_2}"
  ],
  "id": 1,
  "jsonrpc": "2.0"
}

For example, one call may return 3,142 transaction IDs in result and the next one 37,856.

📘

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. Shorter-lived or newly deployed nodes may show fewer.
  2. Mempool Size Configuration
    Tatum Bitcoin nodes are configured with a maxmempool of 4 GB. Transactions are only evicted once this limit is reached.
    ⚠️ The mempool is not automatically flushed on node restart, it persists unless explicitly evicted by hitting the size limit.
  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
  • Differences in node uptime, configuration, and routing will always create variations.
  • Mempool Eviction only occurs in Tatum nodes once maxmempool is reached.

Did this page help you?