0

There is already a good almost complete answer here (but missing the cryptography explanation): How is a wallet's 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?

1 Answer 1

0

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 and Mastering Bitcoin, Chapter 4

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

2
  • 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. Commented Apr 3, 2021 at 0:15
  • See newly added final paragraph Commented Apr 3, 2021 at 15:08

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.