Skip to content

Commit

Permalink
BIP158: include the direct pkScript rather than its data pushes
Browse files Browse the repository at this point in the history
In this commit, we modify regular filter construction slightly.  Rather
than including each pushed data in the script, we instead just include
the script directly, which will eventually be hashed. The rationale for
doing this is two-fold:

  * Most scripts today and in the foreseeable future will just be a
    commitment.

  * Including only the script itself and not the hash of the script
    reduces the worst case filter size. Otherwise, an attacker could
    include a bunch of 2 byte push datas and blow up the filter size for
    all nodes.
  • Loading branch information
Roasbeef committed Apr 1, 2018
1 parent 032a5f6 commit 4077def
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion bip-0158.mediawiki
Original file line number Diff line number Diff line change
Expand Up @@ -268,7 +268,7 @@ 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 outpoint of each input, except for the coinbase transaction
* Each data push in the scriptPubKey of each output, ''only if'' the scriptPubKey is parseable
* The scriptPubKey of each output
* The <code>txid</code> of the transaction itself
The extended filter contains extra data that is meant to enable applications
Expand Down

0 comments on commit 4077def

Please sign in to comment.