Bitcoin Forum
May 09, 2024, 11:59:56 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What would be the best way to get the balance of an address?  (Read 1183 times)
Elwar (OP)
Legendary
*
Offline Offline

Activity: 3598
Merit: 2386


Viva Ut Vivas


View Profile WWW
August 10, 2012, 09:16:22 PM
 #1

I am looking to check an address to see if it is empty and if not empty, check to see how many bitcoins the address contains.

Would I be able to do this with a call from bitcoinj or would I need to add up transactions through the blockchain or what?

First seastead company actually selling sea homes: Ocean Builders https://ocean.builders  Of course we accept bitcoin.
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
Each block is stacked on top of the previous one. Adding another block to the top makes all lower blocks more difficult to remove: there is more "weight" above each block. A transaction in a block 6 blocks deep (6 confirmations) will be very difficult to remove.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
1715255996
Hero Member
*
Offline Offline

Posts: 1715255996

View Profile Personal Message (Offline)

Ignore
1715255996
Reply with quote  #2

1715255996
Report to moderator
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
August 10, 2012, 11:36:58 PM
 #2

Would I be able to do this with a call from bitcoinj or would I need to add up transactions through the blockchain or what?

There is a service that might help, if you weren't aware of it:

 - http://btcbalance.net


Also, via API:
 - https://blockexplorer.com/q/addressbalance/<address>
 - http://blockchain.info/q/addressbalance/<address>

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


Elwar (OP)
Legendary
*
Offline Offline

Activity: 3598
Merit: 2386


Viva Ut Vivas


View Profile WWW
August 11, 2012, 12:48:07 AM
 #3

Would I be able to do this with a call from bitcoinj or would I need to add up transactions through the blockchain or what?

There is a service that might help, if you weren't aware of it:

 - http://btcbalance.net


Also, via API:
 - https://blockexplorer.com/q/addressbalance/<address>
 - http://blockchain.info/q/addressbalance/<address>

So I assume that means that parsing the full blockchain is the way to go. I cannot rely on a third party.

First seastead company actually selling sea homes: Ocean Builders https://ocean.builders  Of course we accept bitcoin.
scintill
Sr. Member
****
Offline Offline

Activity: 448
Merit: 254


View Profile WWW
August 11, 2012, 01:04:50 AM
 #4

So I assume that means that parsing the full blockchain is the way to go. I cannot rely on a third party.

Check out blockparser.  The command would be something like blockparser tally <address>.  Requires synced blockchain from original client, Ubuntu x86-64.  There may be a way to query arbitrary addresses through the original client's RPC commands, too.

1SCiN5kqkAbxxwesKMsH9GvyWnWP5YK2W | donations
Stephen Gornick
Legendary
*
Offline Offline

Activity: 2506
Merit: 1010


View Profile
August 11, 2012, 08:07:19 AM
 #5

I assume that means that parsing the full blockchain is the way to go.

There are others;

 - libBitcoin
 - Armory (see Extras)
 - Bitcoin ABE
 - BitcoinJ
 - BitcoinJS

Unichange.me

            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █
            █


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!