<p>Perhaps you can look at the source code of full-mode bitcoin implementations in Java, such as <a href="https://github.com/bitsofproof/supernode" rel="nofollow">bitsofproof (BOF)</a>.</p>

<p>It seems <a href="http://code.google.com/p/bitcoinj/" rel="nofollow">bitcoinj</a> also has a <a href="http://code.google.com/p/bitcoinj/wiki/FullVerification" rel="nofollow">full-mode</a> but it is experimental only and not really suitable for prod.</p>

<p>Hope this helps...</p>

CC BY-SA 3.0
2013-12-03T05:49:56.710Z
2013-12-03T05:49:56.710Z
ktorn
<p>Using the <code>bitcoinj</code> Java library, you can retrieve your current balance very easily:</p>

<pre><code>// To create your wallet.
public static NetworkParameters params = TestNet3Params.get();
public static String filePrefix = "forwarding-service-testnet";
public static WalletAppKit kit = new WalletAppKit(params, new File("."), filePrefix);

// to retrieve your balance.
String balance = kit.wallet().getBalance().toFriendlyString();
System.out.println(balance);
</code></pre>

CC BY-SA 3.0
2018-01-31T00:15:34.850Z
Your example code uses the Bitcoin testnet, while the OP wants to know how to check the balance from his locally-downloaded blockchain. Can you update your answer accordingly?
Alin Tomescu
CC BY-SA 3.0
2018-01-20T15:52:03.110Z
2018-02-01T02:24:23.947Z
2018-02-01T02:24:23.947Z
BTCDude
<p>You can use this blockchain link to get the balance</p>

<p><a href="https://blockchain.info/q/getreceivedbyaddress/THEIRBITCOINADDRESS?confirmations=6" rel="nofollow noreferrer">https://blockchain.info/q/getreceivedbyaddress/THEIRBITCOINADDRESS?confirmations=6</a></p>

<p>while you request it from the java</p>

CC BY-SA 3.0
2018-01-21T03:47:56.647Z
2018-01-21T03:47:56.647Z
zhiyan114
<p>I am a merchant that accepts bitcoins, and I'm building my own desktop client for receiving them in Java.</p>

<p>When I receive a transaction, I would like to be able to see in my client how much bitcoin is stored in the address that I am receiving from.</p>

<p>I have the full blockchain downloaded on my computer.</p>

<p>How can I access the balance of an address from the blockchain? I would like to be able to do this offline by accessing the blockchain stored on my hard drive.</p>

<p>Thanks in advance</p>

<java>
Check Bitcoin address balance from blockchain
user2980492
# Check Bitcoin address balance from blockchain

(Asked by: username_0 on 2013-12-03)

I am a merchant that accepts bitcoins, and I'm building my own desktop client for receiving them in Java.

When I receive a transaction, I would like to be able to see in my client how much bitcoin is stored in the address that I am receiving from.

I have the full blockchain downloaded on my computer.

How can I access the balance of an address from the blockchain? I would like to be able to do this offline by accessing the blockchain stored on my hard drive.

Thanks in advance

**Tags:** java


---

## 3 answers

### Answer by username_1 on 2013-12-03. Score: 1

Perhaps you can look at the source code of full-mode bitcoin implementations in Java, such as [bitsofproof (BOF)](https://github.com/bitsofproof/supernode).

It seems [bitcoinj](http://code.google.com/p/bitcoinj/) also has a [full-mode](http://code.google.com/p/bitcoinj/wiki/FullVerification) but it is experimental only and not really suitable for prod.

Hope this helps...


---

### Answer by username_2 on 2018-01-20. Score: 0

Using the `bitcoinj` Java library, you can retrieve your current balance very easily:

```
// To create your wallet.
public static NetworkParameters params = TestNet3Params.get();
public static String filePrefix = "forwarding-service-testnet";
public static WalletAppKit kit = new WalletAppKit(params, new File("."), filePrefix);

// to retrieve your balance.
String balance = kit.wallet().getBalance().toFriendlyString();
System.out.println(balance);

```

> **Comments:**
> **username_3**: Your example code uses the Bitcoin testnet, while the OP wants to know how to check the balance from his locally-downloaded blockchain. Can you update your answer accordingly?  

---

### Answer by username_4 on 2018-01-21. Score: 0

You can use this blockchain link to get the balance

<https://blockchain.info/q/getreceivedbyaddress/THEIRBITCOINADDRESS?confirmations=6>

while you request it from the java


---

