summaryrefslogtreecommitdiff
path: root/bip-0158.mediawiki
diff options
context:
space:
mode:
Diffstat (limited to 'bip-0158.mediawiki')
-rw-r--r--bip-0158.mediawiki33
1 files changed, 15 insertions, 18 deletions
diff --git a/bip-0158.mediawiki b/bip-0158.mediawiki
index 5ebfaed..054aa1f 100644
--- a/bip-0158.mediawiki
+++ b/bip-0158.mediawiki
@@ -19,7 +19,7 @@ This BIP describes a structure for compact filters on block data, for use in the
BIP 157 light client protocol<ref>bip-0157.mediawiki</ref>. The filter
construction proposed is an alternative to Bloom filters, as used in BIP 37,
that minimizes filter size by using Golomb-Rice coding for compression. This
-document specifies two initial types of filters based on this construction that
+document specifies one initial filter type based on this construction that
enables basic wallets and applications with more advanced smart contracts.
== Motivation ==
@@ -27,9 +27,8 @@ enables basic wallets and applications with more advanced smart contracts.
[[bip-0157.mediawiki|BIP 157]] defines a light client protocol based on
deterministic filters of block content. The filters are designed to
minimize the expected bandwidth consumed by light clients, downloading filters
-and full blocks. This document defines two initial filter types, ''basic'' and
-''extended'', to provide support for advanced applications while reducing the
-filter size for regular wallets.
+and full blocks. This document defines the initial filter type ''basic''
+that is designed to reduce the filter size for regular wallets.
== Definitions ==
@@ -274,18 +273,16 @@ This BIP defines one initial filter type:
The basic filter is designed to contain everything that a light client needs to
sync a regular Bitcoin wallet. A basic filter MUST contain exactly the
following items for each transaction in a block:
-* The previous output script (the script being spent) for each input, except
- for the coinbase transaction.
-* The scriptPubKey of each output, aside from all <code>OP_RETURN</code> output
- scripts.
+* The previous output script (the script being spent) for each input, except for the coinbase transaction.
+* The scriptPubKey of each output, aside from all <code>OP_RETURN</code> output scripts.
Any "nil" items MUST NOT be included into the final set of filter elements.
-We exclude all <code>OP_RETURN</code> outputs in order to allow filters to
-easily be committed to in the future via a soft-fork. A likely area for future
-commitments is an additional <code>OP_RETURN</code> output in the coinbase
-transaction similar to the current witness commitment
-<ref>https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki</rev>. By
+We exclude all outputs that start with <code>OP_RETURN</code> in order to allow
+filters to easily be committed to in the future via a soft-fork. A likely area
+for future commitments is an additional <code>OP_RETURN</code> output in the
+coinbase transaction similar to the current witness commitment
+<ref>https://github.com/bitcoin/bips/blob/master/bip-0141.mediawiki</ref>. By
excluding all <code>OP_RETURN</code> outputs we avoid a circular dependency
between the commitment, and the item being committed to.
@@ -300,9 +297,9 @@ one is able to select <code>P</code> and <code>M</code> independently, then
setting <code>M=1.497137 * 2^P</code> is close to optimal
<ref>https://gist.github.com/sipa/576d5f09c3b86c3b1b75598d799fc845</ref>.
-Empirical analysis also shows that was chosen as these parameters minimize the
-bandwidth utilized, considering both the expected number of blocks downloaded
-due to false positives and the size of the filters themselves.
+Empirical analysis also shows that these parameters minimize the bandwidth
+utilized, considering both the expected number of blocks downloaded due to false
+positives and the size of the filters themselves.
The parameter <code>k</code> MUST be set to the first 16 bytes of the hash
(in standard little-endian representation) of the block for which the filter is
@@ -325,7 +322,7 @@ This BIP allocates a new service bit:
|-
| NODE_COMPACT_FILTERS
| style="white-space: nowrap;" | <code>1 << 6</code>
-| If enabled, the node MUST respond to all BIP 157 messages for filter types <code>0x00</code> and <code>0x01</code>
+| If enabled, the node MUST respond to all BIP 157 messages for filter type <code>0x00</code>
|}
== Compatibility ==
@@ -350,7 +347,7 @@ Light client: [https://github.com/lightninglabs/neutrino]
Full-node indexing: https://github.com/Roasbeef/btcd/tree/segwit-cbf
-Golomb-Rice Coded sets: https://github.com/Roasbeef/btcutil/tree/gcs/gcs
+Golomb-Rice Coded sets: https://github.com/btcsuite/btcutil/blob/master/gcs
== Appendix A: Alternatives ==