Commit Graph
14 Commits
Author SHA1 Message Date
Olaoluwa Osuntokun 11ceb96849 Merge pull request #733 from tuxcanfly/bip158-update-tests
bip158: update test vectors
2024-04-23 14:25:47 -07:00
Olaoluwa Osuntokun 43ce3a461d Merge pull request #1530 from nau/patch-1
Remove duplicate word in bip-0085.mediawiki
2024-04-22 17:54:16 -07:00
Olaoluwa Osuntokun 749ce1f54e Merge pull request #1564 from bitjson/patch-1
feat: add TypeScript BIP39 implementation
2024-04-22 17:52:49 -07:00
Olaoluwa Osuntokun 898559fd05 BIP-0157: increase max getcfilters request to 1k blocks
In this commit, we effectively revert #699 by allow clients to request
filter for up to 1k consecutive blocks. Testing in the field has shown
that applications are able to reduce perceived latency from syncing to
full functionality after an app has been offline for several days by
batching requests for filters. A value of 100 would mean each additional
day behind adds an additional round trip, resulting in 10s of
seconds of lag after just a few days of being offline. A value of ~1k
allows implementations to catch up with roughly a week's worth of
filters in a single round trip.
2019-10-24 19:51:37 -07:00
Olaoluwa Osuntokun 5ab481ce53 fixup! BIP-0158: clarify OP_RETURN handling for filters 2019-02-12 21:14:29 -08:00
Olaoluwa Osuntokun 1330853c3e BIP-0158: clarify OP_RETURN handling for filters
In this commit, we clarify how we handle `OP_RETURN` outputs for regular
filters. The prior language was a bit ambiguous, so we hope to make it
as explicit as possible.
2019-02-12 19:57:51 -08:00
Olaoluwa Osuntokun dd3948b474 BIP-0158: add test cases for OP_RETURN with op codes, empty filter
In this commit, we add a new test case for a filter built from a block
that has a transaction with an OP_RETURN which isn't followed by only
push data items. The prior implementation for btcd (which was used to
generated these test vectors), had a stricter check which caused it to
add extra items to the filter. We also add a case of a block that has a
single coinbase transaction, with that transaction having only an
OP_RETURN output. As a result, that filter will be "empty", and is
signalled by by a single zero (0x00) byte.

In order to make building the code that makes the test vectors
reproducible, we've added go.mod and go.sum files as well.
2019-02-12 18:31:12 -08:00
Olaoluwa Osuntokun ac76644533 BIP-0158: regenerate test vectors for fp=19, new reg filter, no ext filter
In this commit, we simplify the code that generates the test vectors to
only generate filters for a target fp of 19, and also only for the
regular filter, as it's the only filter type currently defined.

The test vectors have also been updated to include the previous output
scripts for all input within a block as these are now required to
construct the regular filter.

Finally, the generation code has been updated to properly fetch the
previous input scripts to the generation code can verify the filter it
generates manually against the end server.
2018-07-04 23:19:16 -05:00
Olaoluwa Osuntokun 6a4e819829 BIP-0158: switch to prev output scripts, skip all OP_RETURN 2018-07-04 23:19:15 -05:00
Olaoluwa Osuntokun 1c2ed6dce3 BIP-0158: allow filters to define values for P and M, reparameterize default filter 2018-07-04 15:41:05 -05:00
Olaoluwa Osuntokun 4a85759f02 BIP-0158: remove the extended filter type 2018-07-04 15:41:05 -05:00
Olaoluwa Osuntokun 285606ef7a BIP-0158: remove txid from extended filter 2018-05-30 17:15:59 -07:00
Olaoluwa Osuntokun 4077defdbc BIP158: include the direct pkScript rather than its data pushes
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.
2018-03-31 17:48:18 -07:00
Olaoluwa Osuntokun 04bc8408cf BIP 68 Nit: fix spelling Contrats -> Contracts 2016-02-05 20:30:12 -08:00