<oembed><type>rich</type><version>1.0</version><author_name>npub1ac86vemj7ce5z8jyxt39rna3tvwql6xd30ha3vxcd6esysp23d9qrlswfj</author_name><author_url>https://nostr.ae/npub1ac86vemj7ce5z8jyxt39rna3tvwql6xd30ha3vxcd6esysp23d9qrlswfj</author_url><provider_name>njump</provider_name><provider_url>https://nostr.ae</provider_url><html>📅 Original date posted:2015-02-20&#xA;📝 Original message:The idea is not mine, some random guy appeared in #bitcoin-wizards one&#xA;day and said something about it, and lots of people reacted, wow why&#xA;didnt we think about that before.&#xA;&#xA;It goes something like each block contains a commitment to a bloom&#xA;filter that has all of the addresses in the block stored in it.&#xA;&#xA;Now the user downloads the headers and bloom data for all blocks.  The&#xA;know the bloom data is correct in an SPV sense because of the&#xA;commitment.  They can scan it offline and locally by searching for&#xA;addresses from their wallet in it.  Not sure off hand what is the most&#xA;efficient strategy, probably its pretty fast locally anyway.&#xA;&#xA;Now they know (modulo false positives) which addresses of theirs maybe&#xA;in the block.&#xA;&#xA;So now they ask a full node for merkle paths + transactions for the&#xA;addresses from the UTXO set from the block(s) that it was found in.&#xA;&#xA;Separately UTXO commitments could optionally be combined to improve&#xA;security in two ways:&#xA;&#xA;- the normal SPV increase that you can also see that the transaction&#xA;is actually in the last blocks UTXO set.&#xA;&#xA;- to avoid withholding by the full node, if the UTXO commitment is a&#xA;trie (sorted) they can expect a merkle path to lexically adjacent&#xA;nodes either side of where the claimed missing address would be as a&#xA;proof that there really are no transactions for that address in the&#xA;block.  (Distinguishing false positive from node withholding)&#xA;&#xA;Adam&#xA;&#xA;On 20 February 2015 at 17:43, Mike Hearn &lt;mike at plan99.net&gt; wrote:&#xA;&gt; Ah, I see, I didn&#39;t catch that this scheme relies on UTXO commitments&#xA;&gt; (presumably with Mark&#39;s PATRICIA tree system?).&#xA;&gt;&#xA;&gt; If you&#39;re doing a binary search over block contents then does that imply&#xA;&gt; multiple protocol round trips per synced block? I&#39;m still having trouble&#xA;&gt; visualising how this works. Perhaps you could write down an example run for&#xA;&gt; me.&#xA;&gt;&#xA;&gt; How does it interact with the need to download chains rather than individual&#xA;&gt; transactions, and do so without round-tripping to the remote node for each&#xA;&gt; block? Bloom filtering currently pulls down blocks in batches without much&#xA;&gt; client/server interaction and that is useful for performance.&#xA;&gt;&#xA;&gt; Like I said, I&#39;d rather just junk the whole notion of chain scanning and get&#xA;&gt; to a point where clients are only syncing headers. If nodes were calculating&#xA;&gt; a script-&gt;(outpoint, merkle branch) map in LevelDB and allowing range&#xA;&gt; queries over it, then you could quickly pull down relevant UTXOs along with&#xA;&gt; the paths that indicated they did at one point exist. Nodes can still&#xA;&gt; withhold evidence that those outputs were spent, but the same is true today&#xA;&gt; and in practice this doesn&#39;t seem to be an issue.&#xA;&gt;&#xA;&gt; The primary advantage of that approach is it does not require a change to&#xA;&gt; the consensus rules. But there are lots of unanswered questions about how it&#xA;&gt; interacts with HD lookahead and so on.&#xA;&gt;</html></oembed>