<blockquote>
<p><strong>Is a bitcoin wallets balance calculated on the client computer app? eg. Leger Live</strong></p>
</blockquote>
<p>yes.</p>
<blockquote>
<p><strong>How is bitcoin wallet balance calculated cryptographically?</strong></p>
</blockquote>
<p>There's no cryptography involved, certainly no encryption.</p>
<p>You add the credits and subtract the debits.</p>
<blockquote>
<p><strong>Does Ledger Live app check/compare each transaction+hash &amp; transaction+signature hash like mempool nodes do?</strong></p>
</blockquote>
<p>All nodes verify the data they receive, so far as they are able to. This involves computing hashes and verifying digital signatures. see <a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm" rel="nofollow noreferrer">Wikipedia article</a> and <a href="https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch04.html" rel="nofollow noreferrer">Mastering Bitcoin, Chapter 4</a></p>
<blockquote>
<p><strong>Or does it only look at the unspent output addresses and check if they are children of wallet public key?</strong></p>
</blockquote>
<p>Yes.</p>
<blockquote>
<p><strong>If so how does it do this in cryptography terms?</strong></p>
</blockquote>
<p>Since wallets derive these keys and addresses, they just keep a list of them.</p>
<p>The original derivation involves hashes. The hashing algorithms come from the world of cryptography but are not encryption.</p>
<p>The method for deriving many addresses from a single seed is described in <a href="https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki" rel="nofollow noreferrer">BIP32</a></p>

CC BY-SA 4.0
2021-04-03T00:15:29.977Z
Thanks but can you advise my second question? I clarified it below:

I create 5 bitcoin wallet public addresses & receive bitcoin on them.

I reset&restore my hardware wallet from recovery recovery.

I open my wallet app. example Ledger live.

How does the wallet app calculate WHICH bitcoin public addresses are children of hardware wallets recovery seed private key?
It has no cache at this point so how does it calculate this.

There has to be some hashing to do this and I'm wondering what it hashes to do it.
pablorenato
CC BY-SA 4.0
2021-04-03T15:08:24.307Z
See newly added final paragraph
RedGrittyBrick
CC BY-SA 4.0
2021-04-01T12:58:51.510Z
2021-04-03T15:07:55.073Z
2021-04-03T15:07:55.073Z
RedGrittyBrick
<p>There is already a good almost complete answer here (but missing the cryptography explanation):
<a href="https://bitcoin.stackexchange.com/questions/22997/how-is-a-wallets-balance-computed">How is a wallet&#39;s balance computed?</a></p>
<ol>
<li><p>Is a bitcoin wallets balance calculated on the client computer app? eg. Leger Live</p>
</li>
<li><p>How is bitcoin wallet balance calculated cryptographically?</p>
</li>
</ol>
<ul>
<li><p>Does Ledger Live app check/compare each transaction+hash &amp; transaction+signature hash like mempool nodes do?</p>
</li>
<li><p>Or does it only look at the unspent output addresses and check if they are children of wallet public key? If so how does it do this in cryptography terms?</p>
</li>
</ul>

<wallet><cryptography><balance>
How is wallet balance from unspent transactions in cryptography terms?
pablorenato
# How is wallet balance from unspent transactions in cryptography terms?

(Asked by: username_0 on 2021-04-01)

There is already a good almost complete answer here (but missing the cryptography explanation):
[How is a wallet's balance computed?](https://bitcoin.stackexchange.com/questions/22997/how-is-a-wallets-balance-computed)

1. Is a bitcoin wallets balance calculated on the client computer app? eg. Leger Live
2. How is bitcoin wallet balance calculated cryptographically?

* Does Ledger Live app check/compare each transaction+hash & transaction+signature hash like mempool nodes do?
* Or does it only look at the unspent output addresses and check if they are children of wallet public key? If so how does it do this in cryptography terms?

**Tags:** wallet, cryptography, balance


---

## 1 answers

### Answer by username_1 on 2021-04-01. Score: 0 | Accepted answer

> **Is a bitcoin wallets balance calculated on the client computer app? eg. Leger Live**

yes.

> **How is bitcoin wallet balance calculated cryptographically?**

There's no cryptography involved, certainly no encryption.

You add the credits and subtract the debits.

> **Does Ledger Live app check/compare each transaction+hash & transaction+signature hash like mempool nodes do?**

All nodes verify the data they receive, so far as they are able to. This involves computing hashes and verifying digital signatures. see [Wikipedia article](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm) and [Mastering Bitcoin, Chapter 4](https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch04.html)

> **Or does it only look at the unspent output addresses and check if they are children of wallet public key?**

Yes.

> **If so how does it do this in cryptography terms?**

Since wallets derive these keys and addresses, they just keep a list of them.

The original derivation involves hashes. The hashing algorithms come from the world of cryptography but are not encryption.

The method for deriving many addresses from a single seed is described in [BIP32](https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki)

> **Comments:**
> **username_0**: Thanks but can you advise my second question? I clarified it below:  I create 5 bitcoin wallet public addresses & receive bitcoin on them.  I reset&restore my hardware wallet from recovery recovery.  I open my wallet app. example Ledger live.  How does the wallet app calculate WHICH bitcoin public addresses are children of hardware wallets recovery seed private key? It has no cache at this point so how does it calculate this.  There has to be some hashing to do this and I'm wondering what it hashes to do it.  
> **username_1**: See newly added final paragraph  

---

