#35813 wallet, rpc: Add listrawtransactions RPC

full analysis

https://github.com/bitcoin/bitcoin/pull/35813 · pablomartin4btc · +334/-27 in 6 files, 5 commits · labels: Wallet, Needs rebase

Goal

  • Allow wallet users and automated tools to view transactions that spend change back to the wallet
  • Provide a complete transaction history that includes consolidations and pure self-transfers

This PR adds a new `listrawtransactions` RPC method to the wallet. Unlike `listtransactions`, which categorizes transactions by output and hides change-only transfers, `listrawtransactions` lists each transaction known to the wallet exactly once with its net balance change, fee, and an optional decoded view. It also refactors shared transaction display logic between `gettransaction` and the new method.

Problem: Transactions where the wallet spends change back into its own change addresses (such as consolidations or pure self-transfers) do not match any logical external economic category and are omitted by `listtransactions`. Users and automated tools inspecting transaction history through the wallet RPC interface have no direct way to list these transactions.

Category: RPC / REST / ZMQ (#10 of 52)

P3 · new feature

  • P3 because it adds an RPC method giving raw wallet transaction history without output filtering
  • Resolves an omission where change-only transactions could not be inspected via RPC
  • Leaves existing RPC interfaces unchanged

Adds a new RPC method that provides raw wallet transaction history without output filtering. It resolves an existing limitation where change-only transactions could not be retrieved via RPC, while leaving existing interfaces intact.

Membership: Introduces the new listrawtransactions RPC endpoint and modifies RPC conversion arguments.

Factors: security/stability 0, bug 1, performance 0, user value 2, leverage 0

Category: Wallet (#31 of 84)

P3 · new feature

  • P3 because it allows wallet operators to inspect consolidation and self-transfer transactions
  • Fixes visibility of transactions that spend solely to wallet change addresses
  • Deferrable since it does not impact fund safety, consensus, or wallet storage

Addresses issue #34632 where consolidation and self-transfer transactions are invisible in listtransactions. It provides clear user value for wallet operators who need a complete log of wallet transactions, but is reasonably deferrable as it does not affect fund safety, consensus, or wallet storage.

Membership: Touches src/wallet/rpc/transactions.cpp and src/wallet/rpc/wallet.cpp to expose un-categorized wallet transactions.

Factors: security/stability 0, bug 1, performance 0, user value 2, leverage 0

Reviewability: Stale: Needs rebase

  • Needs rebase due to merge conflicts with the base branch

The PR has merge conflicts with the base branch and is marked with the 'Needs rebase' label.

Author status: Active; addressed all reviewer feedback across multiple iterations, now waiting to rebase.

Resolved concerns:

  • Whether to reuse code via a helper shared with listtransactions vs keep them distinct; reviewers and author agreed their semantics diverge too much to share pagination logic.
  • Handling of count=0 edge cases, addressed by making it return an empty list matching listtransactions behavior.
  • Duplicated fee and decoded logic between gettransaction and the new RPC, resolved by extracting static helpers into a preparatory commit.
  • Documentation inconsistency where parent_descs was documented but could never be produced by the raw transaction format, resolved by making the field optional in TransactionDescriptionString.

Agreement: Strong

  • Strong consensus on introducing a dedicated RPC method
  • Recommended dedicated RPC approach and approved implementation (achow101)
  • Verified and approved after testing pagination and verbosity (Bicaru20)
  • Verified by testing on regtest (BrandonOdiwuor, w0xlt)
  • Approved after reviewing documentation and helper refactoring (polespinasa)

Strong consensus on introducing a dedicated RPC with ACKs from polespinasa, Bicaru20, w0xlt, BrandonOdiwuor, and achow101

Reviewers and wallet maintainers strongly support the dedicated RPC approach suggested by achow101 after closing PR #35009, with multiple ACKs on the implementation.

  • achow101 suggested a separate RPC over modifying listtransactions and ACKed commit 7940906
  • polespinasa reviewed doc and helper refactoring and ACKed commit 0e539c5
  • Bicaru20 reACKed commit 0e539c5 after testing pagination and verbosity
  • BrandonOdiwuor and w0xlt tested on regtest and ACKed

Review verdicts (DrahtBot): 2 (+3)

Files

165 lines under test/bench/ci.

  • src/wallet/rpc/transactions.cpp +152/-27
  • test/functional/wallet_listrawtransactions.py +164/-0
  • doc/release-notes-35813.md +12/-0
  • src/rpc/client.cpp +3/-0
  • src/wallet/rpc/wallet.cpp +2/-0
  • test/functional/test_runner.py +1/-0

Card

This PR introduces the `listrawtransactions` wallet RPC, enabling users to inspect every wallet transaction (including consolidations and self-transfers) without category interpretation or change suppression. It closes issue #34632 by giving operators a reliable way to query transactions that were previously hidden in `listtransactions`. The approach was recommended by wallet maintainers after a previous attempt to modify `listtransactions` directly was closed. Review has been thorough with multiple ACKs across several iterations, though it currently requires a rebase against master.

Data

dossier JSON · extract JSON · model openrouter/google/gemini-3.8-flash, generated 2026-09-17T16:21, confidence high, input hash 7dfcb7a83d6666fa