Bitcoin Mempool Acceptance: testmempoolaccept, Rejection Reasons, and Relay Diagnostics
A signed Bitcoin transaction is not necessarily ready to propagate. Before a node relays an unconfirmed transaction, it checks the transaction against consensus-related conditions and its local mempool acceptance policy. Developers can diagnose many failures with Bitcoin Core's testmempoolaccept RPC rather than repeatedly broadcasting modified transactions.
The admission pipeline
A node first needs enough context to evaluate the transaction: referenced inputs must be known and available, and the transaction must satisfy applicable validity and finality checks. It also enforces local policy concerning fees, standardness, resource usage, conflicts, and unconfirmed ancestors.
A rejection can therefore mean different things. An invalid signature is fundamentally different from a transaction paying less than a node's current minimum acceptable fee rate. Both can produce an unsuccessful submission, but only the former is necessarily a consensus-level defect.
Use testmempoolaccept before broadcast
Bitcoin Core exposes testmempoolaccept for evaluating one or more raw transactions against local admission conditions without adding them to the mempool. A basic example is:
bitcoin-cli testmempoolaccept '["<raw-transaction-hex>"]'
Replace the placeholder with an actual serialized transaction in hexadecimal. Consult the documentation for the installed Bitcoin Core version: response fields and package-testing capabilities can vary by release. A result reporting acceptance means the transaction meets the tested local conditions at that moment; it is not a guarantee of future admission, propagation, or mining.
Common reasons for rejection
An insufficient fee rate may prevent relay during congestion. A missing input can indicate that a parent transaction is unknown, that an output was already spent, or that the submitted transaction depends on an unconfirmed ancestor absent from the node. Conflicting transactions may be subject to replacement rules and local mempool policy.
Non-final transactions can fail due to nLockTime or relative sequence locks. Dust outputs and nonstandard scripts can also trigger policy rejection. Mempool limits may reject otherwise acceptable transactions if they create excessive unconfirmed ancestor or descendant relationships.
Package context matters
A child transaction may rely on an unconfirmed parent, and a fee-bumping strategy may depend on evaluating the package together. Whether a particular package can be tested or relayed depends on the node version and supported package policy. Do not assume that individually rejected transactions can always be made acceptable merely by bundling them.
Reliable application states
An application should record separate statuses for constructed, signed, locally accepted, seen by peers, confirmed, and replaced or conflicted. These are distinct observations. In particular, testmempoolaccept does not broadcast, and a mempool sighting is not a confirmation.
Store the exact RPC rejection details alongside the node software version and current chain tip. This makes debugging reproducible without misrepresenting a local policy failure as a permanent Bitcoin rule.
Primary references
Bitcoin Core RPC documentation: https://bitcoincore.org/en/doc/
Bitcoin Core mempool acceptance source: https://github.com/bitcoin/bitcoin/blob/master/src/validation.cpp
Bitcoin developer guide: https://developer.bitcoin.org/devguide/transactions.html
