Bitcoin RPC Error -25: bad-txns-inputs-missingorspent Fix
Bitcoin RPC error -25 "bad-txns-inputs-missingorspent" occurs when a transaction submitted via sendrawtransaction references an unspent transaction output (UTXO) that does not exist in the node's UTXO database or has already been spent. This happens when a previous transaction spent the same input, when an unconfirmed parent transaction was evicted from the mempool, or when a wallet indexer is desynchronized. Query gettxout to verify UTXO validity.
# Root Cause & Technical Architecture
Bitcoin Core validates every transaction input `COutPoint(txid, vout)` against the active chain state (`CCoinsViewCache`). If any referenced input cannot be found in the current UTXO set, or if another transaction in the node mempool has already claimed that outpoint, `AcceptToMemoryPool()` returns `TxValidationResult::TX_MISSING_INPUTS` with RPC error code `-25: bad-txns-inputs-missingorspent`. Double-spends and failed RBF attempts are the most frequent triggers.
# 4-Step Actionable Diagnostic Protocol
Step-by-Step ResolutionVerify Input UTXO Existence via gettxout
Run bitcoin-cli gettxout <txid> <vout> on your node. If the result is null, the output does not exist or has already been spent.
Check for Conflicting Pending Transactions in Mempool
Query mempool.space for the sender address to check if an unconfirmed transaction already consumed the target UTXO.
Rescan Wallet Transaction History in Electrum / Sparrow
In your Bitcoin wallet (Sparrow, Electrum, or Bitcoin Core), trigger a blockchain rescan from the account creation height to rebuild UTXO caches.
Implement Replace-By-Fee (BIP-125 RBF) Properly
If attempting to replace a stuck transaction, ensure you bump the fee rate without removing the original inputs unless intentionally double-spending.
# Diagnostic Verification Code / Command
bash# Verify whether a UTXO is unspent using Bitcoin Core CLI
TXID="4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b"
VOUT=0
# If output is null, input is SPENT or INVALID (Triggers Error -25):
bitcoin-cli gettxout "$TXID" $VOUT
# Check if parent transaction is present in local mempool:
bitcoin-cli getmempoolentry "$TXID" Launch Derivation Path Inspector
Execute client-side cryptographic simulation and parameter checks safely in your browser via native WebCrypto without sending private keys or mnemonics over the wire.
Read Full Investigation & Recovery Workflow
Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.
# Related Diagnostic Codes in Solana & Bitcoin
Related Hex StatusesSolana Error 0x1771 (6001): Slippage Tolerance Exceeded Fix
Fix Solana error 0x1771 (decimal 6001) Slippage Tolerance Exceeded. Troubleshoot Jupiter and Raydium swap reverts, priority fees, and price volatility.
Solana Error 0x1: Insufficient Lamports for Rent Exemption Fix
Fix Solana Custom Program Error 0x1 Insufficient Funds. Troubleshoot missing lamports for account rent exemption, token transfers, and fee payer balances.
Solana Anchor Error 0xbc4 (3012): AccountNotInitialized Fix
Fix Anchor error 0xbc4 (decimal 3012) AccountNotInitialized. Resolve missing Associated Token Accounts (ATA), program state creation, and pre-instructions.
# Frequently Asked Questions
FAQ SchemaWhat does "missingorspent" mean in Bitcoin Core?
It means the node could not find the referenced output. In Bitcoin's UTXO model, an output is either unspent in the set or completely deleted once spent.
Why did my transaction fail with -25 after an RBF bump?
If the original transaction was mined into a block while your wallet was constructing the replacement, the inputs became spent on-chain.
Can reorgs trigger error -25?
Yes. If a chain reorganization disbands a block containing parent transactions, descendant transactions in the mempool lose valid inputs and fail with -25.