A Better MMR Definition



Summary:

Bram Cohen, the creator of BitTorrent, discusses how transactions' prevouts are not specified by [block height, tx index, output index] or by TXO index and asks for help understanding how an insertion ordered TXO tree can result in efficient lookups. He also notes that using a [block height, tx index, output index] triple would result in a much more size-efficient transaction format, but would require at least keeping track of the number of TXOs in each block and probably doing a linear search starting from the location where the block's TXOs begin in the MMR. Peter Todd responds by stating that Bram's proposal is almost entirely reinventing his own proposal, and suggests that Bram's implementation is too difficult to review due to its lack of comments and the fact that it is written in Python. Bram argues that the reference implementation of his proposal is less than 300 lines and fairly straightforward, with comments at the top explaining both the proof format and the in-memory data structures precisely. Bram also notes that performance can only be accurately determined by porting to C and optimizing it, which mostly involves experimenting with different values for the two passed-in magic numbers. Ultimately, Bram argues that his proposal improves cache coherence and should offer greater improvements than those gained from insertion ordering.


Updated on: 2023-06-11T21:39:28.855667+00:00