If I have, let's say 1000 numbers or 10k numbers, and they all add up to 100 when combined, what would be the most efficient way to verify that in fact the sum of all of them is 100?
I was thinking on Open Zeppelin's Merkle Tree sol and js libraries, but I'm not really sure how to apply them in this case.
I could just do n + n1 + n2 + n3....+ n10k
, but that's not really scalable nor efficient.
Thanks!
EDIT:
When a new number comes into place, it's not added to the sum (which is always 100, never 101 or 99). It dilutes the participation of all other numbers, so the sum of all of them keeps resulting in 100.
So, for example, if I have 1+1+1=100
and a new "1" comes in, it's not going to be 1+1+1+1=101
. It'd be something like 0.7+0.7+0.7+0.7=100
. Long story short, the state of 100 + something
never occurs.
This is in fact what I'm trying to achieve, the verification that the diluting mechanism of 1+1+1=100
works, and that the algorithm is not broken like 1+1.1+1=100
.