I have a Merkle tree that contains the balances of users in each leaf. Periodically, users are paid more, and their corresponding Merkle leaves are updated, which results in a new Merkle root.

Is it possible to use a zero-knowledge proof to verify that between two Merkle roots:

a) No individual leaf (user balance) was decreased

b) The sum of all leaves increased by a known amount

The goal is to prevent a scenario where I can pay an arbitrarily large amount to myself. If I can't reduce the balance of any leaf, the only way to pay myself would be to add to my own leaf. And if the sum can only increase by a known amount, that becomes the maximum I can allocate to myself without detection.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.