<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="en">
	<id>https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=BIP_0158</id>
	<title>BIP 0158 - Revision history</title>
	<link rel="self" type="application/atom+xml" href="https://en.bitcoin.it/w/index.php?action=history&amp;feed=atom&amp;title=BIP_0158"/>
	<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;action=history"/>
	<updated>2026-05-02T15:39:27Z</updated>
	<subtitle>Revision history for this page on the wiki</subtitle>
	<generator>MediaWiki 1.43.8</generator>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70189&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/18956f177a1eabd3/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70189&amp;oldid=prev"/>
		<updated>2024-05-09T00:32:22Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/18956f177a1eabd3/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 00:32, 9 May 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l86&quot;&gt;Line 86:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 86:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;selected&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;selected&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Set membership queries against the hash outputs will have a false positive rate&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Set membership queries against the hash outputs will have a false positive rate&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;of &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;. To avoid integer overflow, the number of items &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;of &amp;lt;code&amp;gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;1 / &lt;/ins&gt;M&amp;lt;/code&amp;gt;. To avoid integer overflow, the number of items &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MUST be &amp;lt;2^32 and &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; MUST be &amp;lt;2^32.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;MUST be &amp;lt;2^32 and &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; MUST be &amp;lt;2^32.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l190&quot;&gt;Line 190:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 190:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt;, a vector of &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; raw items&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt;, a vector of &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; raw items&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;, the bit parameter of the Golomb-Rice coding&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;, the bit parameter of the Golomb-Rice coding&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;, the target false positive rate&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;, &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;the inverse of &lt;/ins&gt;the target false positive rate&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, the 128-bit key used to randomize the SipHash outputs&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, the 128-bit key used to randomize the SipHash outputs&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70139&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/584f4a732ba94199/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70139&amp;oldid=prev"/>
		<updated>2024-04-27T02:11:35Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/584f4a732ba94199/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:11, 27 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l42&quot;&gt;Line 42:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 42:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;CompactSize&amp;#039;&amp;#039; is a compact encoding of unsigned integers used in the Bitcoin&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;CompactSize&amp;#039;&amp;#039; is a compact encoding of unsigned integers used in the Bitcoin&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;P2P protocol.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;P2P protocol.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&#039;&#039;Data pushes&#039;&#039; are byte vectors pushed to the stack according to the rules of&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;Bitcoin script.&lt;/del&gt;&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;Bit streams&amp;#039;&amp;#039; are readable and writable streams of individual bits. The&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;#039;&amp;#039;Bit streams&amp;#039;&amp;#039; are readable and writable streams of individual bits. The&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70122&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/ea6e905d6103fcd6/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=70122&amp;oldid=prev"/>
		<updated>2024-04-23T23:16:10Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/ea6e905d6103fcd6/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 23:16, 23 April 2024&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l315&quot;&gt;Line 315:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 315:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;, encoded as a &amp;lt;code&amp;gt;CompactSize&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;, encoded as a &amp;lt;code&amp;gt;CompactSize&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The bytes of the compressed filter itself&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The bytes of the compressed filter itself&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-deleted&quot;&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;A zero element filter MUST be written as one byte containing zeroes.&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Signaling ====&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;==== Signaling ====&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=69630&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/de6b3ffeb807e3cb/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=69630&amp;oldid=prev"/>
		<updated>2023-02-21T02:13:08Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/de6b3ffeb807e3cb/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 02:13, 21 February 2023&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l277&quot;&gt;Line 277:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 277:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sync a regular Bitcoin wallet. A basic filter MUST contain exactly the&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;sync a regular Bitcoin wallet. A basic filter MUST contain exactly the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;following items for each transaction in a block:&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;following items for each transaction in a block:&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The previous output script (the script being spent) for each input, except&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The previous output script (the script being spent) for each input, except for the coinbase transaction.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/del&gt;for the coinbase transaction.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The scriptPubKey of each output, aside from all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output scripts.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;* The scriptPubKey of each output, aside from all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;  &lt;/del&gt;scripts.&lt;/div&gt;&lt;/td&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-side-added&quot;&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Any &amp;quot;nil&amp;quot; items MUST NOT be included into the final set of filter elements.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Any &amp;quot;nil&amp;quot; items MUST NOT be included into the final set of filter elements.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=69089&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/edffe529056f6dfd/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=69089&amp;oldid=prev"/>
		<updated>2021-12-15T15:51:30Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/edffe529056f6dfd/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:51, 15 December 2021&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l303&quot;&gt;Line 303:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 303:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Empirical analysis also shows that &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;was chosen as &lt;/del&gt;these parameters minimize the&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;Empirical analysis also shows that these parameters minimize the &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bandwidth&lt;/ins&gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;bandwidth &lt;/del&gt;utilized, considering both the expected number of blocks downloaded&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;utilized, considering both the expected number of blocks downloaded due to false&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;due to false positives and the size of the filters themselves.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;positives and the size of the filters themselves.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The parameter &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; MUST be set to the first 16 bytes of the hash&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;The parameter &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; MUST be set to the first 16 bytes of the hash&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=66970&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/fd89f0ad9233a717/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=66970&amp;oldid=prev"/>
		<updated>2019-10-25T15:18:51Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/fd89f0ad9233a717/bip-0158.mediawiki&lt;/p&gt;
&lt;table style=&quot;background-color: #fff; color: #202122;&quot; data-mw=&quot;interface&quot;&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;col class=&quot;diff-marker&quot; /&gt;
				&lt;col class=&quot;diff-content&quot; /&gt;
				&lt;tr class=&quot;diff-title&quot; lang=&quot;en&quot;&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;← Older revision&lt;/td&gt;
				&lt;td colspan=&quot;2&quot; style=&quot;background-color: #fff; color: #202122; text-align: center;&quot;&gt;Revision as of 15:18, 25 October 2019&lt;/td&gt;
				&lt;/tr&gt;&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l23&quot;&gt;Line 23:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 23:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;construction proposed is an alternative to Bloom filters, as used in BIP 37,&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;construction proposed is an alternative to Bloom filters, as used in BIP 37,&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;that minimizes filter size by using Golomb-Rice coding for compression. This&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;that minimizes filter size by using Golomb-Rice coding for compression. This&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;document specifies &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;two &lt;/del&gt;initial &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;types of filters &lt;/del&gt;based on this construction that&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;document specifies &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;one &lt;/ins&gt;initial &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;filter type &lt;/ins&gt;based on this construction that&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;enables basic wallets and applications with more advanced smart contracts.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;enables basic wallets and applications with more advanced smart contracts.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l288&quot;&gt;Line 288:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 288:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for future commitments is an additional &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output in the&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;for future commitments is an additional &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output in the&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;coinbase transaction similar to the current witness commitment&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;coinbase transaction similar to the current witness commitment&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ref&amp;gt;https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki&amp;lt;/&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;rev&lt;/del&gt;&amp;gt;. By&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;&amp;lt;ref&amp;gt;https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki&amp;lt;/&lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;ref&lt;/ins&gt;&amp;gt;. By&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;excluding all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; outputs we avoid a circular dependency&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;excluding all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; outputs we avoid a circular dependency&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;between the commitment, and the item being committed to.&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;between the commitment, and the item being committed to.&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot; id=&quot;mw-diff-left-l326&quot;&gt;Line 326:&lt;/td&gt;
&lt;td colspan=&quot;2&quot; class=&quot;diff-lineno&quot;&gt;Line 326:&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| NODE_COMPACT_FILTERS&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| NODE_COMPACT_FILTERS&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;white-space: nowrap;&amp;quot; | &amp;lt;code&amp;gt;1 &amp;lt;&amp;lt; 6&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| style=&amp;quot;white-space: nowrap;&amp;quot; | &amp;lt;code&amp;gt;1 &amp;lt;&amp;lt; 6&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;−&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #ffe49c; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| If enabled, the node MUST respond to all BIP 157 messages for filter &lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;types &lt;/del&gt;&amp;lt;code&amp;gt;0x00&lt;del style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0x01&lt;/del&gt;&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot; data-marker=&quot;+&quot;&gt;&lt;/td&gt;&lt;td style=&quot;color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #a3d3ff; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;| If enabled, the node MUST respond to all BIP 157 messages for filter &lt;ins style=&quot;font-weight: bold; text-decoration: none;&quot;&gt;type &lt;/ins&gt;&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;div&gt;|}&lt;/div&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;td class=&quot;diff-marker&quot;&gt;&lt;/td&gt;&lt;td style=&quot;background-color: #f8f9fa; color: #202122; font-size: 88%; border-style: solid; border-width: 1px 1px 1px 4px; border-radius: 0.33em; border-color: #eaecf0; vertical-align: top; white-space: pre-wrap;&quot;&gt;&lt;br&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;</summary>
		<author><name>934</name></author>
	</entry>
	<entry>
		<id>https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=66816&amp;oldid=prev</id>
		<title>934: Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b5723035e23896d0/bip-0158.mediawiki</title>
		<link rel="alternate" type="text/html" href="https://en.bitcoin.it/w/index.php?title=BIP_0158&amp;diff=66816&amp;oldid=prev"/>
		<updated>2019-09-24T17:59:46Z</updated>

		<summary type="html">&lt;p&gt;Update BIP text with latest version from https://github.com/bitcoin/bips/blob/b5723035e23896d0/bip-0158.mediawiki&lt;/p&gt;
&lt;p&gt;&lt;b&gt;New page&lt;/b&gt;&lt;/p&gt;&lt;div&gt;{{bip}}&lt;br /&gt;
{{BipMoved|bip-0158.mediawiki}}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
  BIP: 158&lt;br /&gt;
  Layer: Peer Services&lt;br /&gt;
  Title: Compact Block Filters for Light Clients&lt;br /&gt;
  Author: Olaoluwa Osuntokun &amp;lt;laolu32@gmail.com&amp;gt;&lt;br /&gt;
          Alex Akselrod &amp;lt;alex@akselrod.org&amp;gt;&lt;br /&gt;
  Comments-Summary: None yet&lt;br /&gt;
  Comments-URI: https://github.com/bitcoin/bips/wiki/Comments:BIP-0158&lt;br /&gt;
  Status: Draft&lt;br /&gt;
  Type: Standards Track&lt;br /&gt;
  Created: 2017-05-24&lt;br /&gt;
  License: CC0-1.0&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
== Abstract ==&lt;br /&gt;
&lt;br /&gt;
This BIP describes a structure for compact filters on block data, for use in the&lt;br /&gt;
BIP 157 light client protocol&amp;lt;ref&amp;gt;bip-0157.mediawiki&amp;lt;/ref&amp;gt;. The filter&lt;br /&gt;
construction proposed is an alternative to Bloom filters, as used in BIP 37,&lt;br /&gt;
that minimizes filter size by using Golomb-Rice coding for compression. This&lt;br /&gt;
document specifies two initial types of filters based on this construction that&lt;br /&gt;
enables basic wallets and applications with more advanced smart contracts.&lt;br /&gt;
&lt;br /&gt;
== Motivation ==&lt;br /&gt;
&lt;br /&gt;
[[bip-0157.mediawiki|BIP 157]] defines a light client protocol based on&lt;br /&gt;
deterministic filters of block content. The filters are designed to&lt;br /&gt;
minimize the expected bandwidth consumed by light clients, downloading filters&lt;br /&gt;
and full blocks. This document defines the initial filter type &amp;#039;&amp;#039;basic&amp;#039;&amp;#039;&lt;br /&gt;
that is designed to reduce the filter size for regular wallets.&lt;br /&gt;
&lt;br /&gt;
== Definitions ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[]byte&amp;lt;/code&amp;gt; represents a vector of bytes.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;code&amp;gt;[N]byte&amp;lt;/code&amp;gt; represents a fixed-size byte array with length N.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;CompactSize&amp;#039;&amp;#039; is a compact encoding of unsigned integers used in the Bitcoin&lt;br /&gt;
P2P protocol.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Data pushes&amp;#039;&amp;#039; are byte vectors pushed to the stack according to the rules of&lt;br /&gt;
Bitcoin script.&lt;br /&gt;
&lt;br /&gt;
&amp;#039;&amp;#039;Bit streams&amp;#039;&amp;#039; are readable and writable streams of individual bits. The&lt;br /&gt;
following functions are used in the pseudocode in this document:&lt;br /&gt;
* &amp;lt;code&amp;gt;new_bit_stream&amp;lt;/code&amp;gt; instantiates a new writable bit stream&lt;br /&gt;
* &amp;lt;code&amp;gt;new_bit_stream(vector)&amp;lt;/code&amp;gt; instantiates a new bit stream reading data from &amp;lt;code&amp;gt;vector&amp;lt;/code&amp;gt;&lt;br /&gt;
* &amp;lt;code&amp;gt;write_bit(stream, b)&amp;lt;/code&amp;gt; appends the bit &amp;lt;code&amp;gt;b&amp;lt;/code&amp;gt; to the end of the stream&lt;br /&gt;
* &amp;lt;code&amp;gt;read_bit(stream)&amp;lt;/code&amp;gt; reads the next available bit from the stream&lt;br /&gt;
* &amp;lt;code&amp;gt;write_bits_big_endian(stream, n, k)&amp;lt;/code&amp;gt; appends the &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; least significant bits of integer &amp;lt;code&amp;gt;n&amp;lt;/code&amp;gt; to the end of the stream in big-endian bit order&lt;br /&gt;
* &amp;lt;code&amp;gt;read_bits_big_endian(stream, k)&amp;lt;/code&amp;gt; reads the next available &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; bits from the stream and interprets them as the least significant bits of a big-endian integer&lt;br /&gt;
&lt;br /&gt;
The key words &amp;quot;MUST&amp;quot;, &amp;quot;MUST NOT&amp;quot;, &amp;quot;REQUIRED&amp;quot;, &amp;quot;SHALL&amp;quot;, &amp;quot;SHALL NOT&amp;quot;, &amp;quot;SHOULD&amp;quot;,&lt;br /&gt;
&amp;quot;SHOULD NOT&amp;quot;, &amp;quot;RECOMMENDED&amp;quot;, &amp;quot;MAY&amp;quot;, and &amp;quot;OPTIONAL&amp;quot; in this document are to be&lt;br /&gt;
interpreted as described in RFC 2119.&lt;br /&gt;
&lt;br /&gt;
== Specification ==&lt;br /&gt;
&lt;br /&gt;
=== Golomb-Coded Sets ===&lt;br /&gt;
&lt;br /&gt;
For each block, compact filters are derived containing sets of items associated&lt;br /&gt;
with the block (eg. addresses sent to, outpoints spent, etc.). A set of such&lt;br /&gt;
data objects is compressed into a probabilistic structure called a&lt;br /&gt;
&amp;#039;&amp;#039;Golomb-coded set&amp;#039;&amp;#039; (GCS), which matches all items in the set with probability&lt;br /&gt;
1, and matches other items with probability &amp;lt;code&amp;gt;1/M&amp;lt;/code&amp;gt; for some&lt;br /&gt;
integer parameter &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;. The encoding is also parameterized by&lt;br /&gt;
&amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;, the bit length of the remainder code. Each filter defined&lt;br /&gt;
specifies values for &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
At a high level, a GCS is constructed from a set of &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; items by:&lt;br /&gt;
# hashing all items to 64-bit integers in the range &amp;lt;code&amp;gt;[0, N * M)&amp;lt;/code&amp;gt;&lt;br /&gt;
# sorting the hashed values in ascending order&lt;br /&gt;
# computing the differences between each value and the previous one&lt;br /&gt;
# writing the differences sequentially, compressed with Golomb-Rice coding&lt;br /&gt;
&lt;br /&gt;
The following sections describe each step in greater detail.&lt;br /&gt;
&lt;br /&gt;
==== Hashing Data Objects ====&lt;br /&gt;
&lt;br /&gt;
The first step in the filter construction is hashing the variable-sized raw&lt;br /&gt;
items in the set to the range &amp;lt;code&amp;gt;[0, F)&amp;lt;/code&amp;gt;, where &amp;lt;code&amp;gt;F = N *&lt;br /&gt;
M&amp;lt;/code&amp;gt;. Customarily, &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; is set to &amp;lt;code&amp;gt;2^P&amp;lt;/code&amp;gt;. However, if&lt;br /&gt;
one is able to select both Parameters independently, then more optimal values&lt;br /&gt;
can be&lt;br /&gt;
selected&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Set membership queries against the hash outputs will have a false positive rate&lt;br /&gt;
of &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;. To avoid integer overflow, the number of items &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;&lt;br /&gt;
MUST be &amp;lt;2^32 and &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; MUST be &amp;lt;2^32.&lt;br /&gt;
&lt;br /&gt;
The items are first passed through the pseudorandom function &amp;#039;&amp;#039;SipHash&amp;#039;&amp;#039;, which&lt;br /&gt;
takes a 128-bit key &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; and a variable-sized byte vector and produces&lt;br /&gt;
a uniformly random 64-bit output. Implementations of this BIP MUST use the&lt;br /&gt;
SipHash parameters &amp;lt;code&amp;gt;c = 2&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;d = 4&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
The 64-bit SipHash outputs are then mapped uniformly over the desired range by&lt;br /&gt;
multiplying with F and taking the top 64 bits of the 128-bit result. This&lt;br /&gt;
algorithm is a faster alternative to modulo reduction, as it avoids the&lt;br /&gt;
expensive division&lt;br /&gt;
operation&amp;lt;ref&amp;gt;https://lemire.me/blog/2016/06/27/a-fast-alternative-to-the-modulo-reduction/&amp;lt;/ref&amp;gt;.&lt;br /&gt;
Note that care must be taken when implementing this reduction to ensure the&lt;br /&gt;
upper 64 bits of the integer multiplication are not truncated; certain&lt;br /&gt;
architectures and high level languages may require code that decomposes the&lt;br /&gt;
64-bit multiplication into four 32-bit multiplications and recombines into the&lt;br /&gt;
result.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
hash_to_range(item: []byte, F: uint64, k: [16]byte) -&amp;gt; uint64:&lt;br /&gt;
    return (siphash(k, item) * F) &amp;gt;&amp;gt; 64&lt;br /&gt;
&lt;br /&gt;
hashed_set_construct(raw_items: [][]byte, k: [16]byte, M: uint) -&amp;gt; []uint64:&lt;br /&gt;
    let N = len(raw_items)&lt;br /&gt;
    let F = N * M&lt;br /&gt;
&lt;br /&gt;
    let set_items = []&lt;br /&gt;
&lt;br /&gt;
    for item in raw_items:&lt;br /&gt;
        let set_value = hash_to_range(item, F, k)&lt;br /&gt;
        set_items.append(set_value)&lt;br /&gt;
&lt;br /&gt;
    return set_items&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Golomb-Rice Coding ====&lt;br /&gt;
&lt;br /&gt;
Instead of writing the items in the hashed set directly to the filter, greater&lt;br /&gt;
compression is achieved by only writing the differences between successive&lt;br /&gt;
items in sorted order. Since the items are distributed uniformly, it can be&lt;br /&gt;
shown that the differences resemble a geometric&lt;br /&gt;
distribution&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Geometric_distribution&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&amp;#039;&amp;#039;Golomb-Rice&amp;#039;&amp;#039;&lt;br /&gt;
&amp;#039;&amp;#039;coding&amp;#039;&amp;#039;&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Golomb_coding#Rice_coding&amp;lt;/ref&amp;gt;&lt;br /&gt;
is a technique that optimally compresses geometrically distributed values.&lt;br /&gt;
&lt;br /&gt;
With Golomb-Rice, a value is split into a quotient and remainder modulo&lt;br /&gt;
&amp;lt;code&amp;gt;2^P&amp;lt;/code&amp;gt;, which are encoded separately. The quotient &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt; is&lt;br /&gt;
encoded as &amp;#039;&amp;#039;unary&amp;#039;&amp;#039;, with a string of &amp;lt;code&amp;gt;q&amp;lt;/code&amp;gt; 1&amp;#039;s followed by one 0. The&lt;br /&gt;
remainder &amp;lt;code&amp;gt;r&amp;lt;/code&amp;gt; is represented in big-endian by P bits. For example,&lt;br /&gt;
this is a table of Golomb-Rice coded values using &amp;lt;code&amp;gt;P=2&amp;lt;/code&amp;gt;:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! n !! (q, r) !! c&lt;br /&gt;
|-&lt;br /&gt;
| 0 || (0, 0) || &amp;lt;code&amp;gt;0 00&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 1 || (0, 1) || &amp;lt;code&amp;gt;0 01&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 2 || (0, 2) || &amp;lt;code&amp;gt;0 10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 3 || (0, 3) || &amp;lt;code&amp;gt;0 11&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 4 || (1, 0) || &amp;lt;code&amp;gt;10 00&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 5 || (1, 1) || &amp;lt;code&amp;gt;10 01&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 6 || (1, 2) || &amp;lt;code&amp;gt;10 10&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 7 || (1, 3) || &amp;lt;code&amp;gt;10 11&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 8 || (2, 0) || &amp;lt;code&amp;gt;110 00&amp;lt;/code&amp;gt;&lt;br /&gt;
|-&lt;br /&gt;
| 9 || (2, 1) || &amp;lt;code&amp;gt;110 01&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
golomb_encode(stream, x: uint64, P: uint):&lt;br /&gt;
    let q = x &amp;gt;&amp;gt; P&lt;br /&gt;
&lt;br /&gt;
    while q &amp;gt; 0:&lt;br /&gt;
        write_bit(stream, 1)&lt;br /&gt;
        q--&lt;br /&gt;
    write_bit(stream, 0)&lt;br /&gt;
&lt;br /&gt;
    write_bits_big_endian(stream, x, P)&lt;br /&gt;
&lt;br /&gt;
golomb_decode(stream, P: uint) -&amp;gt; uint64:&lt;br /&gt;
    let q = 0&lt;br /&gt;
    while read_bit(stream) == 1:&lt;br /&gt;
        q++&lt;br /&gt;
&lt;br /&gt;
    let r = read_bits_big_endian(stream, P)&lt;br /&gt;
&lt;br /&gt;
    let x = (q &amp;lt;&amp;lt; P) + r&lt;br /&gt;
    return x&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set Construction ====&lt;br /&gt;
&lt;br /&gt;
A GCS is constructed from four parameters:&lt;br /&gt;
* &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt;, a vector of &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; raw items&lt;br /&gt;
* &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt;, the bit parameter of the Golomb-Rice coding&lt;br /&gt;
* &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt;, the target false positive rate&lt;br /&gt;
* &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt;, the 128-bit key used to randomize the SipHash outputs&lt;br /&gt;
&lt;br /&gt;
The result is a byte vector with a minimum size of &amp;lt;code&amp;gt;N * (P + 1)&amp;lt;/code&amp;gt;&lt;br /&gt;
bits.&lt;br /&gt;
&lt;br /&gt;
The raw items in &amp;lt;code&amp;gt;L&amp;lt;/code&amp;gt; are first hashed to 64-bit unsigned integers as&lt;br /&gt;
specified above and sorted. The differences between consecutive values,&lt;br /&gt;
hereafter referred to as &amp;#039;&amp;#039;deltas&amp;#039;&amp;#039;, are encoded sequentially to a bit stream&lt;br /&gt;
with Golomb-Rice coding. Finally, the bit stream is padded with 0&amp;#039;s to the&lt;br /&gt;
nearest byte boundary and serialized to the output byte vector.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
construct_gcs(L: [][]byte, P: uint, k: [16]byte, M: uint) -&amp;gt; []byte:&lt;br /&gt;
    let set_items = hashed_set_construct(L, k, M)&lt;br /&gt;
&lt;br /&gt;
    set_items.sort()&lt;br /&gt;
&lt;br /&gt;
    let output_stream = new_bit_stream()&lt;br /&gt;
&lt;br /&gt;
    let last_value = 0&lt;br /&gt;
    for item in set_items:&lt;br /&gt;
        let delta = item - last_value&lt;br /&gt;
        golomb_encode(output_stream, delta, P)&lt;br /&gt;
        last_value = item&lt;br /&gt;
&lt;br /&gt;
    return output_stream.bytes()&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Set Querying/Decompression ====&lt;br /&gt;
&lt;br /&gt;
To check membership of an item in a compressed GCS, one must reconstruct the&lt;br /&gt;
hashed set members from the encoded deltas. The procedure to do so is the&lt;br /&gt;
reverse of the compression: deltas are decoded one by one and added to a&lt;br /&gt;
cumulative sum. Each intermediate sum represents a hashed value in the original&lt;br /&gt;
set. The queried item is hashed in the same way as the set members and compared&lt;br /&gt;
against the reconstructed values. Note that querying does not require the entire&lt;br /&gt;
decompressed set be held in memory at once.&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcs_match(key: [16]byte, compressed_set: []byte, target: []byte, P: uint, N: uint, M: uint) -&amp;gt; bool:&lt;br /&gt;
    let F = N * M&lt;br /&gt;
    let target_hash = hash_to_range(target, F, k)&lt;br /&gt;
&lt;br /&gt;
    stream = new_bit_stream(compressed_set)&lt;br /&gt;
&lt;br /&gt;
    let last_value = 0&lt;br /&gt;
&lt;br /&gt;
    loop N times:&lt;br /&gt;
        let delta = golomb_decode(stream, P)&lt;br /&gt;
        let set_item = last_value + delta&lt;br /&gt;
&lt;br /&gt;
        if set_item == target_hash:&lt;br /&gt;
            return true&lt;br /&gt;
&lt;br /&gt;
        // Since the values in the set are sorted, terminate the search once&lt;br /&gt;
        // the decoded value exceeds the target.&lt;br /&gt;
        if set_item &amp;gt; target_hash:&lt;br /&gt;
            break&lt;br /&gt;
&lt;br /&gt;
        last_value = set_item&lt;br /&gt;
&lt;br /&gt;
    return false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
Some applications may need to check for set intersection instead of membership&lt;br /&gt;
of a single item. This can be performed far more efficiently than checking each&lt;br /&gt;
item individually by leveraging the sorted structure of the compressed GCS.&lt;br /&gt;
First the query elements are all hashed and sorted, then compared in order&lt;br /&gt;
against the decompressed GCS contents. See&lt;br /&gt;
[[#golomb-coded-set-multi-match|Appendix B]] for pseudocode.&lt;br /&gt;
&lt;br /&gt;
=== Block Filters ===&lt;br /&gt;
&lt;br /&gt;
This BIP defines one initial filter type:&lt;br /&gt;
* Basic (&amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt;)&lt;br /&gt;
** &amp;lt;code&amp;gt;M = 784931&amp;lt;/code&amp;gt;&lt;br /&gt;
** &amp;lt;code&amp;gt;P = 19&amp;lt;/code&amp;gt;&lt;br /&gt;
&lt;br /&gt;
==== Contents ====&lt;br /&gt;
&lt;br /&gt;
The basic filter is designed to contain everything that a light client needs to&lt;br /&gt;
sync a regular Bitcoin wallet. A basic filter MUST contain exactly the&lt;br /&gt;
following items for each transaction in a block:&lt;br /&gt;
* The previous output script (the script being spent) for each input, except&lt;br /&gt;
  for the coinbase transaction.&lt;br /&gt;
* The scriptPubKey of each output, aside from all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output&lt;br /&gt;
  scripts.&lt;br /&gt;
&lt;br /&gt;
Any &amp;quot;nil&amp;quot; items MUST NOT be included into the final set of filter elements.&lt;br /&gt;
&lt;br /&gt;
We exclude all outputs that start with &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; in order to allow&lt;br /&gt;
filters to easily be committed to in the future via a soft-fork. A likely area&lt;br /&gt;
for future commitments is an additional &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; output in the&lt;br /&gt;
coinbase transaction similar to the current witness commitment&lt;br /&gt;
&amp;lt;ref&amp;gt;https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki&amp;lt;/rev&amp;gt;. By&lt;br /&gt;
excluding all &amp;lt;code&amp;gt;OP_RETURN&amp;lt;/code&amp;gt; outputs we avoid a circular dependency&lt;br /&gt;
between the commitment, and the item being committed to.&lt;br /&gt;
&lt;br /&gt;
==== Construction ====&lt;br /&gt;
&lt;br /&gt;
The basic type is constructed as Golomb-coded sets with the following&lt;br /&gt;
parameters.&lt;br /&gt;
&lt;br /&gt;
The parameter &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; MUST be set to &amp;lt;code&amp;gt;19&amp;lt;/code&amp;gt;, and the parameter&lt;br /&gt;
&amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; MUST be set to &amp;lt;code&amp;gt;784931&amp;lt;/code&amp;gt;. Analysis has shown that if&lt;br /&gt;
one is able to select &amp;lt;code&amp;gt;P&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;M&amp;lt;/code&amp;gt; independently, then&lt;br /&gt;
setting &amp;lt;code&amp;gt;M=1.497137 * 2^P&amp;lt;/code&amp;gt; is close to optimal&lt;br /&gt;
&amp;lt;ref&amp;gt;https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845&amp;lt;/ref&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
Empirical analysis also shows that was chosen as these parameters minimize the&lt;br /&gt;
bandwidth utilized, considering both the expected number of blocks downloaded&lt;br /&gt;
due to false positives and the size of the filters themselves.&lt;br /&gt;
&lt;br /&gt;
The parameter &amp;lt;code&amp;gt;k&amp;lt;/code&amp;gt; MUST be set to the first 16 bytes of the hash&lt;br /&gt;
(in standard little-endian representation) of the block for which the filter is&lt;br /&gt;
constructed. This ensures the key is deterministic while still varying from&lt;br /&gt;
block to block.&lt;br /&gt;
&lt;br /&gt;
Since the value &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt; is required to decode a GCS, a serialized GCS&lt;br /&gt;
includes it as a prefix, written as a &amp;lt;code&amp;gt;CompactSize&amp;lt;/code&amp;gt;. Thus, the&lt;br /&gt;
complete serialization of a filter is:&lt;br /&gt;
* &amp;lt;code&amp;gt;N&amp;lt;/code&amp;gt;, encoded as a &amp;lt;code&amp;gt;CompactSize&amp;lt;/code&amp;gt;&lt;br /&gt;
* The bytes of the compressed filter itself&lt;br /&gt;
&lt;br /&gt;
==== Signaling ====&lt;br /&gt;
&lt;br /&gt;
This BIP allocates a new service bit:&lt;br /&gt;
&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
|-&lt;br /&gt;
| NODE_COMPACT_FILTERS&lt;br /&gt;
| style=&amp;quot;white-space: nowrap;&amp;quot; | &amp;lt;code&amp;gt;1 &amp;lt;&amp;lt; 6&amp;lt;/code&amp;gt;&lt;br /&gt;
| If enabled, the node MUST respond to all BIP 157 messages for filter types &amp;lt;code&amp;gt;0x00&amp;lt;/code&amp;gt; and &amp;lt;code&amp;gt;0x01&amp;lt;/code&amp;gt;&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== Compatibility ==&lt;br /&gt;
&lt;br /&gt;
This block filter construction is not incompatible with existing software,&lt;br /&gt;
though it requires implementation of the new filters.&lt;br /&gt;
&lt;br /&gt;
== Acknowledgments ==&lt;br /&gt;
&lt;br /&gt;
We would like to thank bfd (from the bitcoin-dev mailing list) for bringing the&lt;br /&gt;
basis of this BIP to our attention, Greg Maxwell for pointing us in the&lt;br /&gt;
direction of Golomb-Rice coding and fast range optimization, Pieter Wullie for&lt;br /&gt;
his analysis of optimal GCS parameters, and Pedro&lt;br /&gt;
Martelletto for writing the initial indexing code for &amp;lt;code&amp;gt;btcd&amp;lt;/code&amp;gt;.&lt;br /&gt;
&lt;br /&gt;
We would also like to thank Dave Collins, JJ Jeffrey, and Eric Lombrozo for&lt;br /&gt;
useful discussions.&lt;br /&gt;
&lt;br /&gt;
== Reference Implementation ==&lt;br /&gt;
&lt;br /&gt;
Light client: [https://github.com/lightninglabs/neutrino]&lt;br /&gt;
&lt;br /&gt;
Full-node indexing: https://github.com/Roasbeef/btcd/tree/segwit-cbf&lt;br /&gt;
&lt;br /&gt;
Golomb-Rice Coded sets: https://github.com/btcsuite/btcutil/blob/master/gcs&lt;br /&gt;
&lt;br /&gt;
== Appendix A: Alternatives ==&lt;br /&gt;
&lt;br /&gt;
A number of alternative set encodings were considered before Golomb-coded&lt;br /&gt;
sets were settled upon. In this appendix section, we&amp;#039;ll list a few of the&lt;br /&gt;
alternatives along with our rationale for not pursuing them.&lt;br /&gt;
&lt;br /&gt;
==== Bloom Filters ====&lt;br /&gt;
&lt;br /&gt;
Bloom Filters are perhaps the best known probabilistic data structure for&lt;br /&gt;
testing set membership, and were introduced into the Bitcoin protocol with BIP&lt;br /&gt;
37. The size of a Bloom filter is larger than the expected size of a GCS with&lt;br /&gt;
the same false positive rate, which is the main reason the option was rejected.&lt;br /&gt;
&lt;br /&gt;
==== Cryptographic Accumulators ====&lt;br /&gt;
&lt;br /&gt;
Cryptographic&lt;br /&gt;
accumulators&amp;lt;ref&amp;gt;https://en.wikipedia.org/wiki/Accumulator_(cryptography)&amp;lt;/ref&amp;gt;&lt;br /&gt;
are a cryptographic data structures that enable (amongst other operations) a one&lt;br /&gt;
way membership test. One advantage of accumulators are that they are constant&lt;br /&gt;
size, independent of the number of elements inserted into the accumulator.&lt;br /&gt;
However, current constructions of cryptographic accumulators require an initial&lt;br /&gt;
trusted set up. Additionally, accumulators based on the Strong-RSA Assumption&lt;br /&gt;
require mapping set items to prime representatives in the associated group which&lt;br /&gt;
can be preemptively expensive.&lt;br /&gt;
&lt;br /&gt;
==== Matrix Based Probabilistic Set Data Structures ====&lt;br /&gt;
&lt;br /&gt;
There exist data structures based on matrix solving which are even more space&lt;br /&gt;
efficient compared to Bloom&lt;br /&gt;
filters&amp;lt;ref&amp;gt;https://arxiv.org/pdf/0804.1845.pdf&amp;lt;/ref&amp;gt;. We instead opted for our&lt;br /&gt;
GCS-based filters as they have a much lower implementation complexity and are&lt;br /&gt;
easier to understand.&lt;br /&gt;
&lt;br /&gt;
== Appendix B: Pseudocode ==&lt;br /&gt;
&lt;br /&gt;
=== Golomb-Coded Set Multi-Match ===&lt;br /&gt;
&lt;br /&gt;
&amp;lt;pre&amp;gt;&lt;br /&gt;
gcs_match_any(key: [16]byte, compressed_set: []byte, targets: [][]byte, P: uint, N: uint, M: uint) -&amp;gt; bool:&lt;br /&gt;
    let F = N * M&lt;br /&gt;
&lt;br /&gt;
    // Map targets to the same range as the set hashes.&lt;br /&gt;
    let target_hashes = []&lt;br /&gt;
    for target in targets:&lt;br /&gt;
        let target_hash = hash_to_range(target, F, k)&lt;br /&gt;
        target_hashes.append(target_hash)&lt;br /&gt;
&lt;br /&gt;
    // Sort targets so matching can be checked in linear time.&lt;br /&gt;
    target_hashes.sort()&lt;br /&gt;
&lt;br /&gt;
    stream = new_bit_stream(compressed_set)&lt;br /&gt;
&lt;br /&gt;
    let value = 0&lt;br /&gt;
    let target_idx = 0&lt;br /&gt;
    let target_val = target_hashes[target_idx]&lt;br /&gt;
&lt;br /&gt;
    loop N times:&lt;br /&gt;
        let delta = golomb_decode(stream, P)&lt;br /&gt;
        value += delta&lt;br /&gt;
&lt;br /&gt;
        inner loop:&lt;br /&gt;
            if target_val == value:&lt;br /&gt;
                return true&lt;br /&gt;
&lt;br /&gt;
            // Move on to the next set value.&lt;br /&gt;
            else if target_val &amp;gt; value:&lt;br /&gt;
                break inner loop&lt;br /&gt;
&lt;br /&gt;
            // Move on to the next target value.&lt;br /&gt;
            else if target_val &amp;lt; value:&lt;br /&gt;
                target_idx++&lt;br /&gt;
&lt;br /&gt;
                // If there are no targets left, then there are no matches.&lt;br /&gt;
                if target_idx == len(targets):&lt;br /&gt;
                    break outer loop&lt;br /&gt;
&lt;br /&gt;
                target_val = target_hashes[target_idx]&lt;br /&gt;
&lt;br /&gt;
    return false&lt;br /&gt;
&amp;lt;/pre&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Appendix C: Test Vectors ==&lt;br /&gt;
&lt;br /&gt;
Test vectors for basic block filters on five testnet blocks, including the filters and filter headers, can be found [[bip-0158/testnet-19.json|here]]. The code to generate them can be found [[bip-0158/gentestvectors.go|here]].&lt;br /&gt;
&lt;br /&gt;
== References ==&lt;br /&gt;
&lt;br /&gt;
&amp;lt;references/&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== Copyright ==&lt;br /&gt;
&lt;br /&gt;
This document is licensed under the  Creative Commons CC0 1.0 Universal license.&lt;/div&gt;</summary>
		<author><name>934</name></author>
	</entry>
</feed>