LayerZeroFault
Solana & Bitcoin CODE: -25 Reviewed & Verified:

Bitcoin RPC Error -25: bad-txns-inputs-missingorspent Fix

Verified by Victor Vance • Lead Technical Analyst & Systems Researcher
Quick Diagnostic Answer (Executive Summary) GSC Snippet Verified

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 Resolution
01

Verify 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.

02

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.

03

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.

04

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-utxo-status.sh
# 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"
Zero-Secrets Client Sandbox

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.

Open Sandbox →
Comprehensive In-Depth Guide

Read Full Investigation & Recovery Workflow

Explore complete architectural diagrams, edge-case failure trees, and detailed post-mortem analysis in our verified deep guide.

Read Guide →

# Related Diagnostic Codes in Solana & Bitcoin

Related Hex Statuses

# Frequently Asked Questions

FAQ Schema

What 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.