THAMER
Sovereign Bitcoin Wallet

WALLET AI BITCOIN

Your Bitcoin Wallet. Your Keys. Your Engine.

Self-hosted Bitcoin software built for developers, applications, and AI agents.

CREATE WALLET

Bitcoin Core gettransaction: Wallet Amounts, Fees, and Transaction Conflicts

permalink THAMER
#bitcoin#bitcoin-core#gettransaction#transaction-accounting

Bitcoin Core gettransaction describes a transaction known to a loaded wallet. Unlike a general raw transaction lookup, it includes wallet-specific accounting and status. The same transaction can have different accounting meanings for different wallets.

Querying a wallet transaction

bitcoin-cli -rpcwallet=example gettransaction "$TXID"

The response can include amount, fee, confirmations, transaction details and serialized transaction data. Optional fields depend on transaction status, ownership and RPC version. An arbitrary transaction ID is not guaranteed to be available through this wallet RPC simply because it exists on the blockchain.

Signed amounts and fees

The amount field expresses the wallet's net transaction amount according to its accounting rules, excluding the separately reported fee where applicable. Outgoing amounts are generally negative, while incoming amounts are positive. The fee field, when present, is normally negative because it represents a wallet debit. Do not interpret the absolute value of amount as the total value of all outputs. A transaction may contain multiple recipients and change, and a self-transfer can have little or no net transfer amount while still consuming a fee.

For example, a simple outgoing payment of 10000 satoshis with a 500-satoshi fee and wallet-owned change may report an amount of -0.00010000 BTC and a fee of -0.00000500 BTC. This is an illustrative accounting example, not a universal response for every transaction structure. The details array provides additional wallet-specific entries. Do not sum both the top-level amount and its component details as independent debits.

Confirmation and conflict status

Positive confirmations indicate inclusion in the active chain at the observed depth. Zero confirmations do not guarantee mempool presence. Negative confirmations indicate a confirmed conflict. Inspect conflict information and relevant replacement metadata where available. An abandoned wallet transaction is a local accounting state, not a network-wide cancellation.

Building a transaction ledger

Store transaction IDs and output indices for individual receipts. Maintain a separate record of wallet-level net amounts and fees. Reconcile changes in confirmation depth and conflict state without creating a second receipt for the same output. A replacement transaction can have a different transaction ID and must be evaluated against the intended payment rather than assumed equivalent.

For independent transaction inspection, getrawtransaction can expose raw inputs and outputs when the node has the required data. It does not automatically supply wallet ownership or net accounting. Combine the appropriate RPCs according to the application's purpose.

Primary references

https://bitcoincore.org/en/doc/28.0.0/rpc/wallet/gettransaction/

https://bitcoincore.org/en/doc/28.0.0/rpc/rawtransactions/getrawtransaction/

https://bitcoincore.org/en/doc/28.0.0/rpc/wallet/abandontransaction/

Questions & Answers

Explore all questions →

Latest from the Lab

THAMER illustrated developer portrait and signature

ABOUT THE DEVELOPER

Independent Software Developer specializing in Bitcoin Script, Golang, and AI Agents.

Software engineering · Independent research · Open-source projects