This guide explains Bitcoin Core getmempoolancestors RPC in plain English. It shows what the command does, what its result means and what it cannot prove.
TL;DR
- What it is: Bitcoin Core 0.16.0 getmempoolancestors accepted the transaction ID of a transaction currently in the local mempool and returned every in-mempool ancestor. Default output was an array of transaction IDs; verbose output mapped each ancestor to size, fee, modified fee, entry time and height, ancestor and descendant aggregates, witness transaction ID and direct dependencies.
- Why it matters: getmempoolancestors exposes the dependency context needed for package analysis, but every result is a transient local-policy snapshot. Safe use preserves units, fee meaning and explicit race handling.
- Current position: Bitcoin Core 0.16.0 getmempoolancestors accepted the transaction ID of a transaction currently in the local mempool and returned every in-mempool ancestor.
Bitcoin Core getmempoolancestors RPC in simple English
Bitcoin Core getmempoolancestors RPC: Ancestors are unconfirmed transactions whose outputs are spent directly or indirectly by the target. The default array excludes the target and supplies identities without ordering guarantees for application logic.
Simple example
A miner is checking Bitcoin Core getmempoolancestors RPC. Build a graph from explicit depends fields when order matters. The size is BIP 141 virtual size, not raw serialised bytes.
Key terms in plain English
- BIP:
- Bitcoin Improvement Proposal: a document describing a proposed rule, standard or process. Its status must be checked separately.
- Bitcoin Core:
- Widely used software that validates Bitcoin and can provide wallet, network and operator tools.
- RPC:
- A command that software sends to a node to request information or a local action.
- Mempool:
- A node’s changing local collection of valid, unconfirmed transactions.
- Node:
- A computer running Bitcoin software that checks data and communicates with other peers.
Required mempool membership
The target txid must be present in the queried node’s mempool. Confirmation, eviction, replacement or restart can make the request fail between discovery and query. Handle not-found as a state transition and recheck chain or replacement evidence rather than retrying indefinitely.
Ancestor meaning
Ancestors are unconfirmed transactions whose outputs are spent directly or indirectly by the target. The default array excludes the target and supplies identities without ordering guarantees for application logic. Build a graph from explicit depends fields when order matters.
Verbose result
Verbose mode returns per-transaction virtual size, base and modified fees, entry time and height, package aggregates, wtxid and direct dependencies. The size is BIP 141 virtual size, not raw serialised bytes. Preserve BTC and byte units explicitly and pin the historical schema.
Modified fees
modifiedfee and aggregate fee fields include mining-priority deltas applied locally. They may differ from actual transaction fees and from another node’s policy view. Billing or customer reporting should use decoded transaction values, while mining simulation should record the exact local policy and deltas.
Package policy use
Ancestor count, size and fees help explain why a child is accepted, evicted or selected with its parents. They do not guarantee inclusion, because templates also depend on conflicts, limits, feerates and current block construction. Evaluate the complete package at one consistent snapshot.
Race and privacy boundaries
Mempool contents change during the call and differ by node. Avoid exposing arbitrary public queries that reveal local transaction inventory or permit expensive graph traversal. Authenticate RPC, cap request rates and retain only necessary operational identifiers.
How specialists test it
Operators test the command on a non-production node first. They check a normal reply, an invalid request, a timeout and a restart. This shows what the response means and prevents one local result from being mistaken for a network-wide outcome.
Frequently asked questions
What is the main point of Bitcoin Core getmempoolancestors RPC?
Bitcoin Core getmempoolancestors RPC: Ancestors are unconfirmed transactions whose outputs are spent directly or indirectly by the target.
For Bitcoin Core getmempoolancestors RPC, what should a beginner know about required mempool membership?
The target txid must be present in the queried node’s mempool. Confirmation, eviction, replacement or restart can make the request fail between discovery and query.
For Bitcoin Core getmempoolancestors RPC, what should a beginner know about ancestor meaning?
Ancestors are unconfirmed transactions whose outputs are spent directly or indirectly by the target.
For Bitcoin Core getmempoolancestors RPC, what should a beginner know about verbose result?
Verbose mode returns per-transaction virtual size, base and modified fees, entry time and height, package aggregates, wtxid and direct dependencies.
Conclusion
getmempoolancestors exposes the dependency context needed for package analysis, but every result is a transient local-policy snapshot. Safe use preserves units, fee meaning and explicit race handling.
Primary sources
Check the current specification status and the documentation for the exact implementation you operate before moving production funds or changing a mining node.
Join the ASIC Mining Discussion
Members can read and join the discussion
Log in to read comments from other miners. Create a free account if you would like to ask a question or share your experience.
Membership helps us protect the discussion from spam and keep answers useful.