Bitcoin Forum
October 08, 2024, 09:58:55 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: listreceivedbyaddress vs listaddressgroupings  (Read 163 times)
ayza_aa (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 14, 2021, 09:27:42 AM
Merited by ABCbits (1)
 #1

hi, i am an amateur in blockchain, So forgive me for the trivial questions

I want to know the difference between listreceivedbyaddress and listaddressgroupings method in the bitcoin-cli?

it is wired after call this: bitcoin-cli -regtest generatetoaddress 101 $(bitcoin-cli -regtest getnewaddress)

with listaddressgroupings i have 50 bitcoin, but with listreceivedbyaddress i have zero (by same address)
BitMaxz
Legendary
*
Offline Offline

Activity: 3402
Merit: 3143

Is the $100k BTC possible?


View Profile WWW
June 14, 2021, 11:35:20 AM
 #2

Have you read the bitcoin core documentation?

If not yet read them here
- https://developer.bitcoin.org/reference/rpc/index.html

About "listreceivedbyaddress" read this https://developer.bitcoin.org/reference/rpc/listreceivedbyaddress.html
According to documentation, it is "List balances by receiving address."


And for "listaddressgroupings" read them here https://developer.bitcoin.org/reference/rpc/listaddressgroupings.html
According to documentation about this command:
"Lists groups of addresses which have had their common ownership made public by common use as inputs or as the resulting change in past transactions"

Based on what I understand about listaddressgroupings the returning result must be the addresses with inputs or past transactions that exist on the mainnet blockchain meaning if you use this command and the target address doesn't have inputs or past transaction it won't show anything.

For listreceivedbyaddress I think it only shows the total amount received of the target address and shows the confirmations of the recent transaction.
I got this on "listreceivedbyaddress"


I don't know if it's a bug, but i tried same thing on regtest using Bitcoin Core 0.21.1. But command listreceivedbyaddress never shows correct amount even if i use different parameter

Code:
listreceivedbyaddress
listreceivedbyaddress 0
listreceivedbyaddress 0 true
listreceivedbyaddress 0 true "the_address"

Can you try this command below?

Code:
bitcoin-cli listreceivedbyaddress 0 true true '"replacethiswiththetargetaddress"'

Don't remove the quotes.

BTC Road to $80k...
NotATether
Legendary
*
Offline Offline

Activity: 1750
Merit: 7313

In memory of o_e_l_e_o


View Profile WWW
June 14, 2021, 05:48:56 PM
 #3

Based on what I understand about listaddressgroupings the returning result must be the addresses with inputs or past transactions that exist on the mainnet blockchain meaning if you use this command and the target address doesn't have inputs or past transaction it won't show anything.

listaddressgroupings calculates the total number of BTC received by each wallet address and returns a list of addresses alongside its total balance. This struct is wrapped inside another array that lists every wallet address that has ever been involved in transactions with that address.



That's all there is to it. There isn't much "common ownership made public" or correlation stuff involved in this RPC (or else it would be prohibitively expensive to run on large wallets since it would be stateless information calculated at runtime).

BitMaxz
Legendary
*
Offline Offline

Activity: 3402
Merit: 3143

Is the $100k BTC possible?


View Profile WWW
June 15, 2021, 05:34:44 PM
 #4

~snip~

Can you try it again but this time add this setting on the Bitcoin.conf file

Code:
server=1

Then use the command again but this time with bitcoind

Code:
bitcoind listreceivedbyaddress 0 true

Just reading their API calls here
https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

I found in the description to use the bitcoind.

Let see if it will work

BTC Road to $80k...
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!