<oembed><type>rich</type><version>1.0</version><author_name>npub1nf4hx3yuahf4awyzsdfzh6gelr8ef4d8yqeker5y8sku64k48c7qcgkps5</author_name><author_url>https://nostr.ae/npub1nf4hx3yuahf4awyzsdfzh6gelr8ef4d8yqeker5y8sku64k48c7qcgkps5</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2017-02-24&#xA;📝 Original message:If the 20 byte SHA1 is now considered insecure (with good reason), what about RIPEMD-160 which is the foundation of Bitcoin addresses?&#xA;&#xA;Is that also susceptible to such an attack vector?&#xA;&#xA;What does that mean for old addresses?&#xA;&#xA;etc&#xA;&#xA;/s&#xA;&#xA;&#xA;&gt; Date: Fri, 24 Feb 2017 11:04:54 +0100&#xA;&gt; From: Tim Ruffing &lt;tim.ruffing at mmci.uni-saarland.de&gt;&#xA;&gt; To: bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; Subject: Re: [bitcoin-dev] SHA1 collisions make Git vulnerable to&#xA;&gt; &#x9;attakcs by third-parties, not just repo maintainers&#xA;&gt; Message-ID: &lt;1487930694.1528.1.camel at mmci.uni-saarland.de&gt;&#xA;&gt; Content-Type: text/plain; charset=&#34;UTF-8&#34;&#xA;&gt; &#xA;&gt; On Fri, 2017-02-24 at 00:57 +0100, Aymeric Vitte via bitcoin-dev wrote:&#xA;&gt;&gt; &#xA;&gt;&gt; I have not worked on this since some time, so that&#39;s just thoughts,&#xA;&gt;&gt; but maybe it can render things much more difficult&#xA;&gt;&gt; than???????computing two files until the same hash is found&#xA;&gt;&gt; &#xA;&gt; &#xA;&gt; You basically rely on the idea that specific collisions are more&#xA;&gt; difficult to find.?This trick or similar tricks will not help.?(And&#xA;&gt; actually, the more files you add to the hash, the more freedom you give&#xA;&gt; the attacker.)&#xA;&gt; &#xA;&gt; Even if certain collisions are more difficult to find today (which is&#xA;&gt; certainly true), the general rule is that someone will prove you wrong&#xA;&gt; in a year.&#xA;&gt; &#xA;&gt; Even if ignore security entirely, switching to new hash function is&#xA;&gt; much simpler trying to fix the usage of a broken hash function.&#xA;&gt; &#xA;&gt; Relying on SHA1 is hopeless. We have to get rid of it.&#xA;&gt; &#xA;&gt; Best,&#xA;&gt; Tim&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; ------------------------------&#xA;&gt; &#xA;&gt; Message: 2&#xA;&gt; Date: Fri, 24 Feb 2017 16:18:43 +0100&#xA;&gt; From: Aymeric Vitte &lt;vitteaymeric at gmail.com&gt;&#xA;&gt; To: bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; Subject: Re: [bitcoin-dev] SHA1 collisions make Git vulnerable to&#xA;&gt; &#x9;attakcs by third-parties, not just repo maintainers&#xA;&gt; Message-ID: &lt;15848c1b-2873-35e8-0588-c636126257df at gmail.com&gt;&#xA;&gt; Content-Type: text/plain; charset=utf-8&#xA;&gt; &#xA;&gt; Not sure that you really read deeply what I sent, because stating that&#xA;&gt; hashing files continuously instead of hashing the intermediate steps&#xA;&gt; just gives more latitude to the attacker can&#39;t be true when the attacker&#xA;&gt; has absolutely no control over the past files&#xA;&gt; &#xA;&gt; I did not write this as a workaround to fix SHA1, which will be dead&#xA;&gt; soon or later but as maybe some general concept that could possibly help&#xA;&gt; whatever hash function you are using for objects that are not frozen but&#xA;&gt; extending (ie the original email stating that trees might be some kind&#xA;&gt; of worse candidates for collisions reminded me this), indeed it makes no&#xA;&gt; sense to patch SHA1 or play around, but this kind of proposal could&#xA;&gt; accompany the defunct&#xA;&gt; &#xA;&gt; The drawback is that you have to keep the hash state when you close the&#xA;&gt; latest hash computation in order to start the next one&#xA;&gt; &#xA;&gt; Then the question is: knowing the hash state, is it as easy to find a&#xA;&gt; collision between two files that will be computed in the next round than&#xA;&gt; finding a collision between two files only?&#xA;&gt; &#xA;&gt; Knowing that you can probably modify the hash state with some&#xA;&gt; unpredictable patterns&#xA;&gt; &#xA;&gt; Most likely the answer is: no, it&#39;s (astronomically?) more difficult&#xA;&gt; &#xA;&gt; Please take it as a suggestion that might be explored (ps: I have the&#xA;&gt; code for this if needed) rather than an affirmation, still amazed as&#xA;&gt; shown in the few links provided (among others) that each time I raise&#xA;&gt; this subject nobody really pays attention (what&#39;s the use case?, etc)&#xA;&gt; and by the fact that it&#39;s apparently used by only one project in the&#xA;&gt; world and not supported by any library&#xA;&gt; &#xA;&gt; &#xA;&gt; Le 24/02/2017 ? 11:04, Tim Ruffing via bitcoin-dev a ?crit :&#xA;&gt;&gt; On Fri, 2017-02-24 at 00:57 +0100, Aymeric Vitte via bitcoin-dev wrote:&#xA;&gt;&gt;&gt; I have not worked on this since some time, so that&#39;s just thoughts,&#xA;&gt;&gt;&gt; but maybe it can render things much more difficult&#xA;&gt;&gt;&gt; than       computing two files until the same hash is found&#xA;&gt;&gt;&gt; &#xA;&gt;&gt; You basically rely on the idea that specific collisions are more&#xA;&gt;&gt; difficult to find. This trick or similar tricks will not help. (And&#xA;&gt;&gt; actually, the more files you add to the hash, the more freedom you give&#xA;&gt;&gt; the attacker.)&#xA;&gt;&gt; &#xA;&gt;&gt; Even if certain collisions are more difficult to find today (which is&#xA;&gt;&gt; certainly true), the general rule is that someone will prove you wrong&#xA;&gt;&gt; in a year.&#xA;&gt;&gt; &#xA;&gt;&gt; Even if ignore security entirely, switching to new hash function is&#xA;&gt;&gt; much simpler trying to fix the usage of a broken hash function.&#xA;&gt;&gt; &#xA;&gt;&gt; Relying on SHA1 is hopeless. We have to get rid of it.&#xA;&gt;&gt; &#xA;&gt;&gt; Best,&#xA;&gt;&gt; Tim&#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt; &#xA;&gt; -- &#xA;&gt; Zcash wallets made simple: https://github.com/Ayms/zcash-wallets&#xA;&gt; Bitcoin wallets made simple: https://github.com/Ayms/bitcoin-wallets&#xA;&gt; Get the torrent dynamic blocklist: http://peersm.com/getblocklist&#xA;&gt; Check the 10 M passwords list: http://peersm.com/findmyass&#xA;&gt; Anti-spies and private torrents, dynamic blocklist: http://torrent-live.org&#xA;&gt; Peersm : http://www.peersm.com&#xA;&gt; torrent-live: https://github.com/Ayms/torrent-live&#xA;&gt; node-Tor : https://www.github.com/Ayms/node-Tor&#xA;&gt; GitHub : https://www.github.com/Ayms&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; ------------------------------&#xA;&gt; &#xA;&gt; Message: 3&#xA;&gt; Date: Fri, 24 Feb 2017 17:30:49 +0100&#xA;&gt; From: Tim Ruffing &lt;tim.ruffing at mmci.uni-saarland.de&gt;&#xA;&gt; To: bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; Subject: Re: [bitcoin-dev] SHA1 collisions make Git vulnerable to&#xA;&gt; &#x9;attakcs by third-parties, not just repo maintainers&#xA;&gt; Message-ID: &lt;1487953849.5148.2.camel at mmci.uni-saarland.de&gt;&#xA;&gt; Content-Type: text/plain; charset=&#34;UTF-8&#34;&#xA;&gt; &#xA;&gt; On Fri, 2017-02-24 at 16:18 +0100, Aymeric Vitte via bitcoin-dev wrote:&#xA;&gt;&gt; Not sure that you really read deeply what I sent, because stating&#xA;&gt;&gt; that&#xA;&gt;&gt; hashing files continuously instead of hashing the intermediate steps&#xA;&gt;&gt; just gives more latitude to the attacker can&#39;t be true when the&#xA;&gt;&gt; attacker&#xA;&gt;&gt; has absolutely no control over the past files&#xA;&gt; What prevents the attacker to provide different past files when talking&#xA;&gt; to parties who are still in the initial state?&#xA;&gt; &#xA;&gt; Then the question is: knowing the hash state, is it as easy to find a&#xA;&gt;&gt; collision between two files that will be computed in the next round&#xA;&gt;&gt; than&#xA;&gt;&gt; finding a collision between two files only?&#xA;&gt; With the original usage of the hash function, the hash state is always&#xA;&gt; the initial state. Now that the attacker has some control over the hash&#xA;&gt; state even. In other words, if the original use of the hash function&#xA;&gt; was vulnerable, then your scheme is vulnerable for the initial state.&#xA;&gt; &#xA;&gt; Concrete attack: If you can find x != y with H(x) = H(y), then you can&#xA;&gt; also find m, x != y, with H(m||x) = H(m||y), just by setting m = &#34;&#34;. &#xA;&gt; &#xA;&gt; Not sure if this is the right place to discuss that issue though...&#xA;&gt; &#xA;&gt; Best,&#xA;&gt; Tim&#xA;&gt; &#xA;&gt; &#xA;&gt; ------------------------------&#xA;&gt; &#xA;&gt; Message: 4&#xA;&gt; Date: Fri, 24 Feb 2017 18:29:50 +0100&#xA;&gt; From: Aymeric Vitte &lt;vitteaymeric at gmail.com&gt;&#xA;&gt; To: Tim Ruffing &lt;tim.ruffing at mmci.uni-saarland.de&gt;,&#x9;Bitcoin Protocol&#xA;&gt; &#x9;Discussion &lt;bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;&gt; Subject: Re: [bitcoin-dev] SHA1 collisions make Git vulnerable to&#xA;&gt; &#x9;attakcs by third-parties, not just repo maintainers&#xA;&gt; Message-ID: &lt;b557a0de-2492-80a1-eff7-229503ae382d at gmail.com&gt;&#xA;&gt; Content-Type: text/plain; charset=windows-1252&#xA;&gt; &#xA;&gt; ??? apparently we are not discussing the same thing&#xA;&gt; &#xA;&gt; Maybe I did not provide the right links (reading them again I myself&#xA;&gt; don&#39;t find them so clear), see maybe again&#xA;&gt; https://github.com/whatwg/streams/issues/33#issuecomment-28045860&#xA;&gt; &#xA;&gt; a - b - c -d&#xA;&gt; &#xA;&gt; hash(a)&#xA;&gt; &#xA;&gt; hash(a+b)&#xA;&gt; &#xA;&gt; etc&#xA;&gt; &#xA;&gt; But you are not going to rehash from the beginning, then:&#xA;&gt; &#xA;&gt; update a --&gt; keep the remaining bytes a_ (+ hash state 1) --&gt; digest&#xA;&gt; a=hash(a)&#xA;&gt; &#xA;&gt; update a_+b from hash state 1--&gt; keep the remaining bytes b_ (+ hash&#xA;&gt; state 2) --&gt; digest a_+b=hash(a+b)&#xA;&gt; &#xA;&gt; etc&#xA;&gt; &#xA;&gt; Basically that&#39;s similar to a real time progressive hash of chunks of a&#xA;&gt; file that you are streaming and therefore don&#39;t know what will come next&#xA;&gt; (per opposition to hashing a file that you already have), this could&#xA;&gt; apply to trees&#xA;&gt; &#xA;&gt; This is different from something like:&#xA;&gt; &#xA;&gt; hash(a)&#xA;&gt; &#xA;&gt; hash(hash(a) +hash(b))&#xA;&gt; &#xA;&gt; etc&#xA;&gt; &#xA;&gt; There is no initial state, and the attacker can&#39;t modify what was&#xA;&gt; already hashed, to make it more difficult you can probably modify the&#xA;&gt; hash state N&#xA;&gt; &#xA;&gt; &#xA;&gt; Le 24/02/2017 ? 17:30, Tim Ruffing via bitcoin-dev a ?crit :&#xA;&gt;&gt; On Fri, 2017-02-24 at 16:18 +0100, Aymeric Vitte via bitcoin-dev wrote:&#xA;&gt;&gt;&gt; Not sure that you really read deeply what I sent, because stating&#xA;&gt;&gt;&gt; that&#xA;&gt;&gt;&gt; hashing files continuously instead of hashing the intermediate steps&#xA;&gt;&gt;&gt; just gives more latitude to the attacker can&#39;t be true when the&#xA;&gt;&gt;&gt; attacker&#xA;&gt;&gt;&gt; has absolutely no control over the past files&#xA;&gt;&gt; What prevents the attacker to provide different past files when talking&#xA;&gt;&gt; to parties who are still in the initial state?&#xA;&gt;&gt; &#xA;&gt;&gt; Then the question is: knowing the hash state, is it as easy to find a&#xA;&gt;&gt;&gt; collision between two files that will be computed in the next round&#xA;&gt;&gt;&gt; than&#xA;&gt;&gt;&gt; finding a collision between two files only?&#xA;&gt;&gt; With the original usage of the hash function, the hash state is always&#xA;&gt;&gt; the initial state. Now that the attacker has some control over the hash&#xA;&gt;&gt; state even. In other words, if the original use of the hash function&#xA;&gt;&gt; was vulnerable, then your scheme is vulnerable for the initial state.&#xA;&gt;&gt; &#xA;&gt;&gt; Concrete attack: If you can find x != y with H(x) = H(y), then you can&#xA;&gt;&gt; also find m, x != y, with H(m||x) = H(m||y), just by setting m = &#34;&#34;. &#xA;&gt;&gt; &#xA;&gt;&gt; Not sure if this is the right place to discuss that issue though...&#xA;&gt;&gt; &#xA;&gt;&gt; Best,&#xA;&gt;&gt; Tim&#xA;&gt;&gt; _______________________________________________&#xA;&gt;&gt; bitcoin-dev mailing list&#xA;&gt;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt; &#xA;&gt; -- &#xA;&gt; Zcash wallets made simple: https://github.com/Ayms/zcash-wallets&#xA;&gt; Bitcoin wallets made simple: https://github.com/Ayms/bitcoin-wallets&#xA;&gt; Get the torrent dynamic blocklist: http://peersm.com/getblocklist&#xA;&gt; Check the 10 M passwords list: http://peersm.com/findmyass&#xA;&gt; Anti-spies and private torrents, dynamic blocklist: http://torrent-live.org&#xA;&gt; Peersm : http://www.peersm.com&#xA;&gt; torrent-live: https://github.com/Ayms/torrent-live&#xA;&gt; node-Tor : https://www.github.com/Ayms/node-Tor&#xA;&gt; GitHub : https://www.github.com/Ayms&#xA;&gt; &#xA;&gt; &#xA;&gt; &#xA;&gt; ------------------------------&#xA;&gt; &#xA;&gt; Message: 5&#xA;&gt; Date: Fri, 24 Feb 2017 14:20:19 -0800&#xA;&gt; From: Bram Cohen &lt;bram at bittorrent.com&gt;&#xA;&gt; To: Peter Todd &lt;pete at petertodd.org&gt;&#xA;&gt; Cc: Bitcoin Protocol Discussion&#xA;&gt; &#x9;&lt;bitcoin-dev at lists.linuxfoundation.org&gt;&#xA;&gt; Subject: Re: [bitcoin-dev] A Better MMR Definition&#xA;&gt; Message-ID:&#xA;&gt; &#x9;&lt;CA+KqGkpi4GvgU-K6vt-U5ZN4AkpjZ0rruzddoJS4-V0TcnyqUQ at mail.gmail.com&gt;&#xA;&gt; Content-Type: text/plain; charset=&#34;utf-8&#34;&#xA;&gt; &#xA;&gt; So your idea is to cluster entries by entry time because newer things are&#xA;&gt; more likely to leave and updating multiple things near each other is&#xA;&gt; cheaper?&#xA;&gt; &#xA;&gt; That can be done with my tool. Instead of using hashes for the values being&#xA;&gt; stored, you use position entries. The first entry gets a value of all&#xA;&gt; zeros, the next one a one followed by all zeros, then the next two&#xA;&gt; correspond to the first two with the second bit flipped to one, then the&#xA;&gt; next four the first four with the third bit flipped to one, etc. It&#xA;&gt; probably performs a little bit better to do it two bits at a time instead&#xA;&gt; of one so that the entries are 00, 01, 10, 11, 0001, 0010, 0011, 0101,&#xA;&gt; 0110, 0111, 1001, etc. If you were to really use this you&#39;d probably want&#xA;&gt; to to add some optimizations to use the fact that the terminals fit in 64&#xA;&gt; bits instead of 256, but it mostly works unchanged, and gets whatever&#xA;&gt; benefits there are to this clustering plus the high performance&#xA;&gt; implementation tricks I&#39;ve built which I keep complaining that nobody&#39;s&#xA;&gt; giving feedback on.&#xA;&gt; &#xA;&gt; I&#39;m not sold on this being a win: The empirical access patterns are&#xA;&gt; unknown, it requires an extra cache miss per lookup to find the entry&#xA;&gt; number, it may be that everything is optimized well enough without it for&#xA;&gt; there to be no meaningful gains, and it&#39;s a bunch of extra complexity. What&#xA;&gt; should be done is that a plain vanilla UTXO set solution is optimized as&#xA;&gt; well as it can be first, and then the insertion ordering trick is tried as&#xA;&gt; an optimization to see if it&#39;s an improvement. Without that baseline&#xA;&gt; there&#39;s no meaningful basis for comparison, and I&#39;m quite confident that a&#xA;&gt; naive implementation which just allocates individual nodes will&#xA;&gt; underperform the thing I&#39;ve come up with, even without adding optimizations&#xA;&gt; related to fitting in 64 bits.&#xA;&gt; &#xA;&gt; On Thu, Feb 23, 2017 at 8:36 PM, Peter Todd &lt;pete at petertodd.org&gt; wrote:&#xA;&gt; &#xA;&gt;&gt; On Thu, Feb 23, 2017 at 07:32:43PM -0800, Bram Cohen wrote:&#xA;&gt;&gt;&gt; On Thu, Feb 23, 2017 at 7:15 PM, Peter Todd &lt;pete at petertodd.org&gt; wrote:&#xA;&gt;&gt;&gt; &#xA;&gt;&gt;&gt;&gt; &#xA;&gt;&gt;&gt;&gt; Glad we&#39;re on the same page with regard to what&#39;s possible in TXO&#xA;&gt;&gt;&gt;&gt; commitments.&#xA;&gt;&gt;&gt;&gt; &#xA;&gt;&gt;&gt;&gt; Secondly, am I correct in saying your UTXO commitments scheme requires&#xA;&gt;&gt;&gt;&gt; random&#xA;&gt;&gt;&gt;&gt; access? While you describe it as a &#34;merkle set&#34;, obviously to be&#xA;&gt;&gt; merkelized&#xA;&gt;&gt;&gt;&gt; it&#39;ll have to have an ordering of some kind. What do you propose that&#xA;&gt;&gt;&gt;&gt; ordering&#xA;&gt;&gt;&gt;&gt; to be?&#xA;&gt;&gt;&gt;&gt; &#xA;&gt;&gt;&gt; &#xA;&gt;&gt;&gt; The ordering is by the bits in the hash. Technically it&#39;s a Patricia&#xA;&gt;&gt; Trie.&#xA;&gt;&gt;&gt; I&#39;m using &#39;merkle tree&#39; to refer to basically anything with a hash root.&#xA;&gt;&gt; &#xA;&gt;&gt; The hash of what? The values in the set?&#xA;&gt;&gt; &#xA;&gt;&gt;&gt;&gt; Maybe more specifically, what exact values do you propose to be in the&#xA;&gt;&gt; set?&#xA;&gt;&gt;&gt;&gt; &#xA;&gt;&gt;&gt;&gt; &#xA;&gt;&gt;&gt; That is unspecified in the implementation, it just takes a 256 bit value&#xA;&gt;&gt;&gt; which is presumably a hash of something. The intention is to nail down a&#xA;&gt;&gt;&gt; simple format and demonstrate good performance and leave those semantics&#xA;&gt;&gt; to&#xA;&gt;&gt;&gt; a higher layer. The simplest thing would be to hash together the txid and&#xA;&gt;&gt;&gt; output number.&#xA;&gt;&gt; &#xA;&gt;&gt; Ok, so let&#39;s assume the values in the set are the unspent outpoints.&#xA;&gt;&gt; &#xA;&gt;&gt; Since we&#39;re ordering by the hash of the values in the set, outpoints will&#xA;&gt;&gt; be&#xA;&gt;&gt; distributed uniformly in the set, and thus the access pattern of data in&#xA;&gt;&gt; the&#xA;&gt;&gt; set is uniform.&#xA;&gt;&gt; &#xA;&gt;&gt; Now let&#39;s fast-forward 10 years. For the sake of argument, assume that for&#xA;&gt;&gt; every 1 UTXO in the set that corresponds to funds in someone&#39;s wallet that&#xA;&gt;&gt; are&#xA;&gt;&gt; likely to be spent, there are 2^12 = 4096 UTXO&#39;s that have been permanently&#xA;&gt;&gt; lost (and/or created in spam attacks) and thus will never be spent.&#xA;&gt;&gt; &#xA;&gt;&gt; Since lost UTXO&#39;s are *also* uniformly distributed, if I&#39;m processing a new&#xA;&gt;&gt; block that spends 2^12 = 4096 UTXO&#39;s, on average for each UTXO spent, I&#39;ll&#xA;&gt;&gt; have to update log2(4096) = 12 more digests than I would have had those&#xA;&gt;&gt; &#34;dead&#34;&#xA;&gt;&gt; UTXO&#39;s not existed.&#xA;&gt;&gt; &#xA;&gt;&gt; Concretely, imagine our UTXO set had just 8 values in it, and we were&#xA;&gt;&gt; updating&#xA;&gt;&gt; two of them:&#xA;&gt;&gt; &#xA;&gt;&gt;               #&#xA;&gt;&gt;              / \&#xA;&gt;&gt;             /   \&#xA;&gt;&gt;            /     \&#xA;&gt;&gt;           /       \&#xA;&gt;&gt;          /         \&#xA;&gt;&gt;         #           #&#xA;&gt;&gt;        / \         / \&#xA;&gt;&gt;       /   \       /   \&#xA;&gt;&gt;      #     .     .     #&#xA;&gt;&gt;     / \   / \   / \   / \&#xA;&gt;&gt;    .   X .   . .   . X   .&#xA;&gt;&gt; &#xA;&gt;&gt; To mark two coins as spent, we&#39;ve had to update 5 inner nodes.&#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; Now let&#39;s look at what happens in an insertion-ordered TXO commitment&#xA;&gt;&gt; scheme.&#xA;&gt;&gt; For sake of argument, let&#39;s assume the best possible case, where every UTXO&#xA;&gt;&gt; spent in that same block was recently created. Since the UTXO&#39;s are&#xA;&gt;&gt; recently&#xA;&gt;&gt; created, chances are almost every single one of those &#34;dead&#34; UTXO&#39;s will&#xA;&gt;&gt; have&#xA;&gt;&gt; been created in the past. Thus, since this is an insertion-ordered data&#xA;&gt;&gt; structure, those UTXO&#39;s exist in an older part of the data structure that&#xA;&gt;&gt; our&#xA;&gt;&gt; new block doesn&#39;t need to modify at all.&#xA;&gt;&gt; &#xA;&gt;&gt; Concretely, again let&#39;s imagine a TXO commitment with 8 values in it, and&#xA;&gt;&gt; two&#xA;&gt;&gt; of them being spent:&#xA;&gt;&gt; &#xA;&gt;&gt;               #&#xA;&gt;&gt;              / \&#xA;&gt;&gt;             /   \&#xA;&gt;&gt;            /     \&#xA;&gt;&gt;           /       \&#xA;&gt;&gt;          /         \&#xA;&gt;&gt;         .           #&#xA;&gt;&gt;        / \         / \&#xA;&gt;&gt;       /   \       /   \&#xA;&gt;&gt;      .     .     .     #&#xA;&gt;&gt;     / \   / \   / \   / \&#xA;&gt;&gt;    .   . .   . .   . X   X&#xA;&gt;&gt; &#xA;&gt;&gt; To mark two coins as spent, we&#39;ve only had to update 3 inner nodes; while&#xA;&gt;&gt; our&#xA;&gt;&gt; tree is higher with those lost coins, those extra inner nodes are amortised&#xA;&gt;&gt; across all the coins we have to update.&#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; The situation gets even better when we look at the *new* UTXO&#39;s that our&#xA;&gt;&gt; block&#xA;&gt;&gt; creates. Suppose our UTXO set has size n. To mark a single coin as spent,&#xA;&gt;&gt; we&#xA;&gt;&gt; have to update log2(n) inner nodes. We do get to amortise this a bit at&#xA;&gt;&gt; the top&#xA;&gt;&gt; levels in the tree, but even if we assume the amortisation is totally free,&#xA;&gt;&gt; we&#39;re updating at least log2(n) - log2(m) inner nodes &#34;under&#34; the amortised&#xA;&gt;&gt; nodes at the top of the tree for *each* new node.&#xA;&gt;&gt; &#xA;&gt;&gt; Meanwhile with an insertion-ordered TXO commitment, each new UTXO added to&#xA;&gt;&gt; the&#xA;&gt;&gt; data set goes in the same place - the end. So almost none of the existing&#xA;&gt;&gt; data&#xA;&gt;&gt; needs to be touched to add the new UTXOs. Equally, the hashing required&#xA;&gt;&gt; for the&#xA;&gt;&gt; new UTXO&#39;s can be done in an incremental fashion that&#39;s very L1/L2 cache&#xA;&gt;&gt; friendly.&#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; tl;dr: Precisely because access patterns in TXO commitments are *not*&#xA;&gt;&gt; uniform,&#xA;&gt;&gt; I think we&#39;ll find that from a L1/L2/etc cache perspective alone, TXO&#xA;&gt;&gt; commitments will result in better performance than UTXO commitments.&#xA;&gt;&gt; &#xA;&gt;&gt; &#xA;&gt;&gt; Now it is true that Bitcoin&#39;s current design means we&#39;ll need a map of&#xA;&gt;&gt; confirmed outpoints to TXO insertion order indexes. But it&#39;s not&#xA;&gt;&gt; particularly&#xA;&gt;&gt; hard to add that &#34;metadata&#34; to transactions on the P2P layer in the same&#xA;&gt;&gt; way&#xA;&gt;&gt; that segwit added witnesses to transactions without modifying how txids&#xA;&gt;&gt; were&#xA;&gt;&gt; calculated; if you only connect to peers who provide you with TXO index&#xA;&gt;&gt; information in blocks and transactions, you don&#39;t need to keep that map&#xA;&gt;&gt; yourself.&#xA;&gt;&gt; &#xA;&gt;&gt; Finally, note how this makes transactions *smaller* in many circumstances:&#xA;&gt;&gt; it&#39;s&#xA;&gt;&gt; just a 8-byte max index rather than a 40 byte outpoint.&#xA;&gt;&gt; &#xA;&gt;&gt; --&#xA;&gt;&gt; https://petertodd.org &#39;peter&#39;[:-1]@petertodd.org&#xA;&gt;&gt; &#xA;&gt; -------------- next part --------------&#xA;&gt; An HTML attachment was scrubbed...&#xA;&gt; URL: &lt;http://lists.linuxfoundation.org/pipermail/bitcoin-dev/attachments/20170224/63ab2731/attachment.html&gt;&#xA;&gt; &#xA;&gt; ------------------------------&#xA;&gt; &#xA;&gt; _______________________________________________&#xA;&gt; bitcoin-dev mailing list&#xA;&gt; bitcoin-dev at lists.linuxfoundation.org&#xA;&gt; https://lists.linuxfoundation.org/mailman/listinfo/bitcoin-dev&#xA;&gt; &#xA;&gt; &#xA;&gt; End of bitcoin-dev Digest, Vol 21, Issue 34&#xA;&gt; *******************************************</html></oembed>