Bitcoin Forum
May 04, 2024, 05:21:46 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: In Bitcoin Core cli, how can I list *all* transactions of an address?  (Read 122 times)
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6727


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 08, 2023, 05:43:45 PM
Merited by ABCbits (1)
 #1

Not just the ones that the Bitcoin Core client made. listtransactions won't work if I've just imported a few addresses and did a rescan, because no transactions have been made with the wallet and it returns an empty list. gettransaction works if txindex option is set, but I need to get the transaction IDs first, ideally only with Core. So how can I get a list of all txids for a wallet or address inside a wallet?

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
1714800106
Hero Member
*
Offline Offline

Posts: 1714800106

View Profile Personal Message (Offline)

Ignore
1714800106
Reply with quote  #2

1714800106
Report to moderator
1714800106
Hero Member
*
Offline Offline

Posts: 1714800106

View Profile Personal Message (Offline)

Ignore
1714800106
Reply with quote  #2

1714800106
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1714800106
Hero Member
*
Offline Offline

Posts: 1714800106

View Profile Personal Message (Offline)

Ignore
1714800106
Reply with quote  #2

1714800106
Report to moderator
1714800106
Hero Member
*
Offline Offline

Posts: 1714800106

View Profile Personal Message (Offline)

Ignore
1714800106
Reply with quote  #2

1714800106
Report to moderator
1714800106
Hero Member
*
Offline Offline

Posts: 1714800106

View Profile Personal Message (Offline)

Ignore
1714800106
Reply with quote  #2

1714800106
Report to moderator
RickDeckard
Legendary
*
Offline Offline

Activity: 1008
Merit: 3006



View Profile
June 09, 2023, 12:12:51 PM
 #2

Have you tried using listunspent instead of listtransacttions? The code would be something like this:
Code:
bitcoin-cli listunspent 1 9999999 '["add1", "add2", ...]'
According to ChainQuery[1] that command will give you a list of all unspent transaction outputs for the addresses that you want. The result will be a list that will include the transaction ID (txid) for each UTXO. I've set the minconf and maxconf to their default values, but you are free to play around with those numbers.

[1]https://www.chainquery.com/bitcoin-cli/listunspent

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5583


Self-proclaimed Genius


View Profile
June 09, 2023, 12:38:35 PM
Merited by ABCbits (1)
 #3

So how can I get a list of all txids for a wallet or address inside a wallet?
For imported address within your wallet., you can use listreceivedbyaddress but with the address arg to filter it.
Otherwise it'll list the whole wallet's receiving addresses' TXID list. (excluding change for HD wallet)

Example command:
Code:
bitcoin-cli listreceivedbyaddress 0 false true "address"
(works with imported addresses via importaddress)

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6727


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 11, 2023, 09:11:35 AM
 #4

Thanks guys, but I just realized that listtransactions can take a parameter argument: "include_watchonly" that toggles the display of transactions from imported addresses. Not sure why this is defaulting to false as it would be really useful behavior to have on. But anyway, the listreceivedbyaddress RPC also works as well.

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
nc50lc
Legendary
*
Offline Offline

Activity: 2408
Merit: 5583


Self-proclaimed Genius


View Profile
June 11, 2023, 10:34:03 AM
 #5

-snip- Not sure why this is defaulting to false as it would be really useful behavior to have on. But anyway, the listreceivedbyaddress RPC also works as well.
You must be using a legacy wallet (non-descriptor).
The wallet where you execute the command should have the "disable_private_keys" argument set to "true" when it's created.
In the GUI, the check box with the same name "Disabled Private Keys" should be ticked.

In Descriptor wallets, it's not possible to import plain address descriptors to a non-watching-only wallet so this wouldn't have happened.

.
.HUGE.
▄██████████▄▄
▄█████████████████▄
▄█████████████████████▄
▄███████████████████████▄
▄█████████████████████████▄
███████▌██▌▐██▐██▐████▄███
████▐██▐████▌██▌██▌██▌██
█████▀███▀███▀▐██▐██▐█████

▀█████████████████████████▀

▀███████████████████████▀

▀█████████████████████▀

▀█████████████████▀

▀██████████▀▀
█▀▀▀▀











█▄▄▄▄
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
.
CASINSPORTSBOOK
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀▀█











▄▄▄▄█
NotATether (OP)
Legendary
*
Offline Offline

Activity: 1596
Merit: 6727


bitcoincleanup.com / bitmixlist.org


View Profile WWW
June 12, 2023, 12:45:54 PM
 #6

-snip- Not sure why this is defaulting to false as it would be really useful behavior to have on. But anyway, the listreceivedbyaddress RPC also works as well.
You must be using a legacy wallet (non-descriptor).
The wallet where you execute the command should have the "disable_private_keys" argument set to "true" when it's created.
In the GUI, the check box with the same name "Disabled Private Keys" should be ticked.

In Descriptor wallets, it's not possible to import plain address descriptors to a non-watching-only wallet so this wouldn't have happened.

Yes, I explicitly created a legacy wallet for the purposes of testing some Python core that uses the RPC, so that I don't have to spin up a bunch of altcoin nodes as well (except for maybe DOGE, which has seemingly removed any way of selecting wallet files via createwallet and -rpcwallet).

.
.BLACKJACK ♠ FUN.
█████████
██████████████
████████████
█████████████████
████████████████▄▄
░█████████████▀░▀▀
██████████████████
░██████████████
████████████████
░██████████████
████████████
███████████████░██
██████████
CRYPTO CASINO &
SPORTS BETTING
▄▄███████▄▄
▄███████████████▄
███████████████████
█████████████████████
███████████████████████
█████████████████████████
█████████████████████████
█████████████████████████
███████████████████████
█████████████████████
███████████████████
▀███████████████▀
█████████
.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!