Skip to content

BIP158: include the direct pkScript rather than its data pushes - #667

Merged
luke-jr merged 1 commit into
bitcoin:masterfrom
Roasbeef:bip-158-minor-updates
Apr 1, 2018
Merged

luke-jr merged 1 commit into
bitcoin:masterfrom
Roasbeef:bip-158-minor-updates

Conversation

@Roasbeef

@Roasbeef Roasbeef commented Apr 1, 2018

Copy link
Copy Markdown
Contributor

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.

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.
@jimpo

jimpo commented Apr 1, 2018

Copy link
Copy Markdown
Contributor

+1

@tuxcanfly

Copy link
Copy Markdown
Contributor

+1 this will simplify the implementation as well.

@luke-jr
luke-jr merged commit 7eb444d into bitcoin:master Apr 1, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants