<oembed><type>rich</type><version>1.0</version><author_name>npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_name><author_url>https://nostr.ae/npub1m230cem2yh3mtdzkg32qhj73uytgkyg5ylxsu083n3tpjnajxx4qqa2np2</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-02-22&#xA;📝 Original message:Reposting something that came up recently in a private discussion with some&#xA;academics:&#xA;&#xA;Concretely, let&#39;s define a prunable MMR with the following grammar. This&#xA;definition is an improvement on whats in the python-proofmarshal by committing&#xA;to the number of items in the tree implicitly; an obvious max-log2(n)-sized&#xA;proof-of-tree-size can be obtained by following the right-most nodes:&#xA;&#xA;    Maybe(T) := UNPRUNED &lt;T&gt; | PRUNED &lt;Commitment(T)&gt;&#xA;&#xA;    FullNode(0) := &lt;Value&gt;&#xA;    FullNode(n) := &lt;Maybe(FullNode(n-1)&gt; &lt;Maybe(FullNode(n-1))&gt;&#xA;&#xA;    PartialNode(0) := SOME &lt;FullNode(0)&gt; | NONE&#xA;    PartialNode(n) := &lt;Maybe(FullNode(n-1))&gt; &lt;Maybe(PartialNode(n-1))&gt;&#xA;&#xA;    MMR := FULL &lt;N&gt; &lt;FullNode(n)&gt; | PARTIAL &lt;N&gt; &lt;PartialNode(n)&gt;&#xA;&#xA;Basically we define it in four parts. First we define Maybe(T) to represent&#xA;pruned and unpruned (hash only) data. Secondly we define full nodes within 2^n&#xA;sized trees. Third we define partial nodes. And finally we define the MMR&#xA;itself as being either a full or partial node.&#xA;&#xA;First of all, with pruning we can define a rule that if any operation (other&#xA;than checking commitment hashes) attempts to access pruned data, it should&#xA;immediately fail. In particular, no operation should be able to determine if&#xA;data is or isn&#39;t pruned. Equally, note how an implementation can keep track of&#xA;what data was accessed during any given operation, and prune the rest, which&#xA;means a proof is just the parts of the data structure accessed during one or&#xA;more operations.&#xA;&#xA;With that, notice how proving the soundness of the proofs becomes trivial: if&#xA;validation is deterministic, it is obviously impossible to construct two&#xA;different proofs that prove contradictory statements, because a proof is simply&#xA;part of the data structure itself. Contradiction would imply that the two&#xA;proofs are different, but that&#39;s easily rejected by simply checking the hash of&#xA;the data.&#xA;&#xA;-- &#xA;https://petertodd.org &#39;peter&#39;[:-1]@petertodd.org&#xA;-------------- next part --------------&#xA;A non-text attachment was scrubbed...&#xA;Name: signature.asc&#xA;Type: application/pgp-signature&#xA;Size: 455 bytes&#xA;Desc: Digital signature&#xA;URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20170222/1412af52/attachment.sig&gt;</html></oembed>