1
0
mirror of https://github.com/bitcoin/bips.git synced 2026-02-23 15:38:22 +00:00

BIP158: add test vectors and generation code

In this commit, we add test vectors for filter and header construction and
the code to generate them. The included test vectors are for testnet with a
value of 20 for P. The code generates filters and headers for values of 1
through 32 for P using testnet blocks. Currently, to run the code,
the `Roasbeef` fork of `btcd` (at https://github.com/roasbeef/btcd) is
required to be running locally in testnet mode; this will be changed in a
future commit after the code is merged into the `btcsuite` mainline.
This commit is contained in:
Alex
2018-04-03 12:07:37 -06:00
parent d1874d5cd2
commit 3571e1a52d
3 changed files with 376 additions and 1 deletions

View File

@@ -420,7 +420,7 @@ gcs_match_any(key: [16]byte, compressed_set: []byte, targets: [][]byte, P: uint,
== Appendix C: Test Vectors ==
TODO: To be generated.
Test vectors for a P value of 20 on five testnet blocks, including the filters and filter headers, can be found [[bip-0158/testnet-20.csv|here]]. The code to generate these vectors for P values of 1 through 32 can be found [[bip-0158/gentestvectors.go|here]].
== References ==