Skip to main content

getrawmempool

Overview

The 'getrawmempool' retrieves all transaction IDs currently held in the memory pool utilizing the 'getrawmempool' RPC method. This method presents the data as a JSON array containing string transaction IDs.

Request

wget --no-check-certificate --quiet \
--method POST \
--timeout=0 \
--header 'Content-Type: application/json' \
--header 'accept: application/json' \
--header 'X-CoinAPI-Key: 73034021-THIS-IS-SAMPLE-KEY' \
--body-data '{"jsonrpc":"2.0","id":1,"method":"getrawmempool","params": [ ]}' \
'https://bitcoin-mainnet.node.coinapi.io'

Request Parameters

verbose (Boolean)

  • Default: 'false'
  • When set to 'true', it returns a JSON object. Conversely, when set to false, it returns an array of transaction IDs.

mempool_sequence (Boolean)

  • Default: 'false'
  • If true, the return will include a JSON object containing the transaction list along with an associated mempool sequence number.

Response

Response when verbose is true:

{
"transactionid": "12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef",
"vsize": 567,
"weight": 1234,
"time": 1677745678,
"height": 678901,
"descendantcount": 3,
"descendantsize": 789,
"ancestorcount": 2,
"ancestorsize": 456,
"wtxid": "abcdef12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef123",
"fees": {
"base": 0.00012345,
"modified": 0.00012356,
"ancestor": 0.00012367,
"descendant": 0.00012378
},
"depends": ["txid1", "txid2"],
"hex": "abcdef12345abcdef12345",
"spentby": ["txid3", "txid4"],
"hex": "abcdef12345abcdef12346",
"bip125-replaceable": true,
"unbroadcast": false,
"error": null
}

{
"txids": [
"abcdef12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef123",
"12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef12345abcdef"
],
"hex": "abcdef12345abcdef12346",
"mempool_sequence": 12345
}

When verbose is true:

  • transactionid: Identifies the transaction.
  • vsize: The virtual transaction size as detailed in BIP 141, different from the actual serialized size for witness transactions due to the discounted witness data.
  • weight: The transaction weight, as prescribed in BIP 141.
  • time: Records the local time the transaction entered the pool, denoted in seconds since January 1, 1970 (GMT).
  • height: Indicates the block height at the time the transaction entered the pool.
  • descendantcount: Counts the number of in-mempool descendant transactions (including the current transaction).
  • descendantsize: Calculates the virtual transaction size of the in-mempool descendants (including the current transaction).
  • ancestorcount: Counts the number of in-mempool ancestor transactions (including the current transaction).
  • ancestorsize: Calculates the virtual transaction size of the in-mempool ancestors (including the current transaction).
  • wtxid: Represents the hash of the serialized transaction, including witness data.
  • fees: A JSON object encapsulating details about the transaction fee paid by the transaction, including:
    • base: Transaction fee in BTC.
    • modified: Transaction fee with fee deltas used for mining priority, measured in BTC.
    • ancestor: Modified fees of in-mempool ancestors (inclusive) in BTC.
    • descendant: Modified fees of in-mempool descendants (inclusive) in BTC.
  • depends: Lists unconfirmed transactions used as inputs for the current transaction.
  • hex: Displays the parent transaction ID.
  • spentby: Notes unconfirmed transactions that are utilizing outputs from the current transaction.
  • hex: Exhibits the child transaction ID.
  • bip125-replaceable: Denotes whether the transaction can be replaced according to BIP125 (replace-by-fee).
  • unbroadcast: Marks if the transaction is currently unbroadcast (no initial broadcast acknowledgment from peers).
  • error: If applicable, displays an error message.

When verbose is false:

  • txids: A JSON array containing transaction IDs.
  • hex: Specifies the transaction ID.
  • mempool_sequence: Denotes the mempool sequence value.