Bitcoin Forum
May 08, 2024, 06:03:43 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoind - Getbalance command  (Read 142 times)
MadGamer (OP)
Legendary
*
Offline Offline

Activity: 1568
Merit: 1031


View Profile
February 06, 2018, 03:58:39 PM
Merited by ABCbits (1)
 #1

I searched a lot and apparently, this command is only able to retrieve the balance If you control the address. I want to know how the blockexplorer etc. do it then? I don't necessarily need the code behind it, just want to know what's the trick here?
1715148223
Hero Member
*
Offline Offline

Posts: 1715148223

View Profile Personal Message (Offline)

Ignore
1715148223
Reply with quote  #2

1715148223
Report to moderator
"In a nutshell, the network works like a distributed timestamp server, stamping the first transaction to spend a coin. It takes advantage of the nature of information being easy to spread but hard to stifle." -- Satoshi
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715148223
Hero Member
*
Offline Offline

Posts: 1715148223

View Profile Personal Message (Offline)

Ignore
1715148223
Reply with quote  #2

1715148223
Report to moderator
achow101
Moderator
Legendary
*
expert
Offline Offline

Activity: 3388
Merit: 6631


Just writing some code


View Profile WWW
February 06, 2018, 04:02:00 PM
Merited by ABCbits (1)
 #2

You can't do it with bitcoind/Bitcoin Core. In order to find the balance of an address, an address index is required. But maintaining an address index is expensive and not that useful since the node does not need it to operate, so one is not maintained. There is no code in Bitcoin Core to build such an address index.

It is important to note that addresses and balances do not exist on a technical level. It requires significant computation to produce balances for all addresses, and requires a lot of additional storage space to store that data.

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!