I've found a constant-time algorithm for the number of hashes in a Merkle proof where the number of leaves in the tree (n) is not a power of 2:
popcnt(i) + popcnt(~(i-1)&(1<<(len(i-1^n-1))-1))
I doubt I'm the first to find this, since it applies to any binary tree, but still 
0 replies
1 retweet
3 likes
Loading seems to be taking a while.
Twitter may be over capacity or experiencing a momentary hiccup. Try again or visit Twitter Status for more information.