<p>Curious about building my own proof of solvency program. I understand how the Merkle sum tree works in theory but I am having issues understanding the practical ways of getting the information I need.</p>
<p>Let's say that my client, for example Newton, has 400,000 addresses for each of their 400,000 clients.</p>
<ol>
<li><p>How do I get the balance for those 400,000 addresses?</p>
</li>
<li><p>How do I create the tree in such way where a customer is able to go check the balance of their address?</p>
</li>
</ol>

CC BY-SA 4.0
2023-01-25T05:32:43.817Z
A Merkle sum tree is a way to *prove* to someone what the balances are in a verifiable way. You don't use it to look up balances. If you're the one constructing the Merkle tree, you put the account balances of all your customers im it. I don't understand why you'd want to learn them - you're the one who has the information and puts it in there.
Pieter Wuille
CC BY-SA 4.0
2023-01-25T08:15:53.297Z
I know what it is my question is how to get each account balance to construct it. For example, does Newton provide 400,000 different balances via an api or are the balances just on an excel spread sheet
madamepresident
CC BY-SA 4.0
2023-01-25T13:56:55.533Z
How the account provider keeps track of their account balances is up to them, and has nothing to do with Merkle trees or proofs of reserve. It could be a database, or Excel files, or something far more complex.
Pieter Wuille
<bitcoin-core><bitcoind><client><merkle-tree><proof-of-solvency>
How do I retrieve address balances to build a Merkle sum tree?
madamepresident
# How do I retrieve address balances to build a Merkle sum tree?

(Asked by: username_0 on 2023-01-24)

Curious about building my own proof of solvency program. I understand how the Merkle sum tree works in theory but I am having issues understanding the practical ways of getting the information I need.

Let's say that my client, for example Newton, has 400,000 addresses for each of their 400,000 clients.

1. How do I get the balance for those 400,000 addresses?
2. How do I create the tree in such way where a customer is able to go check the balance of their address?

**Tags:** bitcoin-core, bitcoind, client, merkle-tree, proof-of-solvency

> **Comments:**
> **username_1**: A Merkle sum tree is a way to *prove* to someone what the balances are in a verifiable way. You don't use it to look up balances. If you're the one constructing the Merkle tree, you put the account balances of all your customers im it. I don't understand why you'd want to learn them - you're the one who has the information and puts it in there.  
> **username_0**: I know what it is my question is how to get each account balance to construct it. For example, does Newton provide 400,000 different balances via an api or are the balances just on an excel spread sheet  
> **username_1**: How the account provider keeps track of their account balances is up to them, and has nothing to do with Merkle trees or proofs of reserve. It could be a database, or Excel files, or something far more complex.  

---

## 0 answers

