mirror of
https://github.com/bitcoin/bips.git
synced 2025-12-22 14:45:19 +00:00
Merge pull request #2015 from darosior/2509_consensus_cleanup_test_vectors
BIP54: Consensus Cleanup test vectors
This commit is contained in:
commit
2624ef7b83
13
bip-0054.md
13
bip-0054.md
@ -156,6 +156,15 @@ knowledge, there does not exist an open source reference broadly in use today fo
|
||||
We encourage mining pools to update their software to craft coinbase transactions that are
|
||||
forward-compatible with the changes proposed in this BIP.
|
||||
|
||||
## Reference implementation
|
||||
|
||||
An implementation of BIP54 for Bitcoin Core is available [here][inquisition-implem].
|
||||
|
||||
## Test vectors
|
||||
|
||||
Documented test vectors are available [here](./bip-0054/test_vectors/) for all mitigations
|
||||
introduced in this BIP.
|
||||
|
||||
## Acknowledgements
|
||||
|
||||
This document builds upon an [earlier proposal][BIP-XXXX] by Matt Corallo.
|
||||
@ -163,7 +172,8 @@ This document builds upon an [earlier proposal][BIP-XXXX] by Matt Corallo.
|
||||
The authors would like to thank everyone involved in researching the most appropriate mitigation for
|
||||
each of these bugs. We would like to thank in particular Anthony Towns and Sjors Provoost for their
|
||||
direct contributions to this proposal, as well as @0xb10c and Brian Groll for providing the authors
|
||||
with data to analyze the proposed mitigations.
|
||||
with data to analyze the proposed mitigations. Thanks to Chris Stewart for digging up historical
|
||||
violations to the new transaction size rule, which are partially reused in this BIP's test vectors.
|
||||
|
||||
## Copyright
|
||||
|
||||
@ -234,3 +244,4 @@ notably of Bitcoin Core but also of all other implementations the authors are aw
|
||||
[Delving duplicable]: https://delvingbitcoin.org/t/great-consensus-cleanup-revival/710/4
|
||||
[Core 0.16.1]: https://bitcoincore.org/en/releases/0.16.1
|
||||
[Core 29.0]: https://bitcoincore.org/en/releases/29.0
|
||||
[inquisition-implem]: https://github.com/darosior/bitcoin/tree/2509_inquisition_consensus_cleanup
|
||||
|
||||
102
bip-0054/test_vectors/README.md
Normal file
102
bip-0054/test_vectors/README.md
Normal file
@ -0,0 +1,102 @@
|
||||
## BIP54 test vectors
|
||||
|
||||
This folder contains a set of test vectors for each mitigation introduced in the BIP. This document
|
||||
presents them in more detail.
|
||||
|
||||
The code used to generate half of the test vectors is included with the implementation and available
|
||||
[here][other-vectors]. The other half requires mining mainnet blocks and is [published
|
||||
separately][bip54-miner]. In both cases it is implemented as a regular Bitcoin Core unit test, and
|
||||
the test vectors are persisted as a JSON file if the `UPDATE_JSON_TESTS` preprocessor directive is
|
||||
set (off by default).
|
||||
|
||||
To compile the [header][header-miner] and [block][block-miner] miners you may have to link to
|
||||
libatomic explicitly. This can be achieved like so:
|
||||
```
|
||||
cmake -B atomicbuild -DAPPEND_LDFLAGS="-latomic"
|
||||
cmake --build atomicbuild/ -j $(nproc)
|
||||
```
|
||||
|
||||
[Premined headers][premined-headers] are also provided along with the header miner to allow changing
|
||||
some of the last headers without having to re-generate the whole chain.
|
||||
|
||||
|
||||
### Difficulty adjustment exploits
|
||||
|
||||
The [`timestamps.json`](./timestamps.json) test vectors exercise the two constraints on block header
|
||||
timestamps introduced by BIP54 to mitigate the Timewarp and Murch-Zawy attacks. Each test case
|
||||
features a chain of mainnet headers starting from the genesis block, and whether this header chain
|
||||
is valid by BIP54 rules. Each test case also contains a comment describing why this particular chain
|
||||
is (in)valid according to BIP54. All test cases are valid according to current Bitcoin consensus
|
||||
rules. It is intended to be used to test a BIP54 implementation by feeding the header chain to a
|
||||
Bitcoin node implementation, enforcing the BIP54 rules on this chain from genesis.
|
||||
|
||||
The test vector file features a JSON array of JSON objects, each corresponding to a test case. Each
|
||||
JSON object features the following entries:
|
||||
- `header_chain`: a JSON array of strings. An ordered list of hex-encoded mainnet block headers.
|
||||
- `valid`: a JSON boolean. Whether this chain of headers is valid according to BIP54.
|
||||
- `comment`: a JSON string. Description of the test case.
|
||||
|
||||
For the purpose of testing a Timewarp fix, a Timewarp attack was included early on in the history of
|
||||
testnet3. An implementer of BIP54 may want to ensure that syncing testnet3 by enforcing BIP54 since
|
||||
genesis will treat block `00000000118da1e2165a19307b86f87eba814845e8a0f99734dce279ca3fb029` as
|
||||
invalid.
|
||||
|
||||
|
||||
### Long block validation time
|
||||
|
||||
The [`sigops.json`](sigops.json) file contains test vectors for the limit on the number of
|
||||
potentially-executed legacy signature operations in a single transaction, introduced by BIP54 in
|
||||
order to mitigate long block validation times. Each test case represents a transaction and whether a
|
||||
block containing it would be valid according to BIP54. The test cases feature an extensive set of
|
||||
combinations of inputs and output types, ways to run into the limit, historical violations and some
|
||||
pathological transactions exhibiting the specific implementation details. All test cases but those
|
||||
belonging to this last category feature transactions that are valid under current Bitcoin consensus
|
||||
rules. Each test case also features a comment describing why the transaction is (in)valid according
|
||||
to BIP54.
|
||||
|
||||
The test vector file features a JSON array of JSON objects, each corresponding to a test case. Each
|
||||
JSON object features the following entries:
|
||||
- `spent_outputs`: a JSON array of strings. An ordered list of hex-encoded Bitcoin-serialized
|
||||
transaction outputs spent by each input of this test case's transaction.
|
||||
- `tx`: a JSON string. A hex-encoded Bitcoin-serialized transaction to be evaluated.
|
||||
- `valid`: a JSON boolean. Whether this transaction is valid according to current consensus rules
|
||||
supplemented by BIP54.
|
||||
- `comment`: a JSON string. Description of the test case.
|
||||
|
||||
|
||||
### Merkle tree malleability with 64-byte transactions
|
||||
|
||||
The [`txsize.json`](./txsize.json) file contains test cases exercising the new constraint on
|
||||
non-witness transaction size introduced in BIP54. Each test case contains a transaction and whether
|
||||
it would be valid according to BIP54, as well as a comment describing why it is (in)valid. All test
|
||||
cases are otherwise valid according to current Bitcoin consensus rules.
|
||||
|
||||
The test vector file features a JSON array of JSON objects, each corresponding to a test case. Each
|
||||
JSON object features the following entries:
|
||||
- `tx`: a JSON string. A hex-encoded Bitcoin-serialized transaction to be evaluated.
|
||||
- `valid`: a JSON boolean. Whether this transaction is valid according to BIP54.
|
||||
- `comment`: a JSON string. Description of the test case.
|
||||
|
||||
|
||||
### Possibility of duplicate coinbase transactions
|
||||
|
||||
The [`coinbases.json`](./coinbases.json) file contains test cases exercising the new restrictions on
|
||||
coinbase transactions introduced in BIP54 to prevent duplicate coinbase transactions without
|
||||
resorting to BIP30 validation. Each test case contains a chain of mainnet blocks (including the
|
||||
genesis block), and whether this block chain is valid according to BIP54. All test cases are valid
|
||||
according to current Bitcoin's consensus rules, except one that features a block containing a
|
||||
coinbase transaction timelocked to a future block height.
|
||||
|
||||
The test vector file features a JSON array of JSON objects, each corresponding to a test case. Each
|
||||
JSON object features the following entries:
|
||||
- `block_chain`: a JSON array of strings. An ordered list of hex-encoded mainnet blocks.
|
||||
- `valid`: a JSON boolean. Whether this block chain is valid according to current Bitcoin consensus
|
||||
rules supplemented by BIP54.
|
||||
- `comment`: a JSON string. Description of the test case.
|
||||
|
||||
|
||||
[bip54-miner]: https://github.com/darosior/bitcoin/blob/bip54_miner/commits
|
||||
[header-miner]: https://github.com/darosior/bitcoin/blob/bip54_miner/src/test/bip54_header_miner.cpp
|
||||
[block-miner]: https://github.com/darosior/bitcoin/blob/bip54_miner/src/test/bip54_block_miner.cpp
|
||||
[other-vectors]: https://github.com/darosior/bitcoin/blob/2509_inquisition_consensus_cleanup/src/test/bip54_tests.cpp
|
||||
[premined-headers]: https://github.com/darosior/bitcoin/blob/bip54_miner/src/test/bip54_premined_headers.h
|
||||
79
bip-0054/test_vectors/coinbases.json
Normal file
79
bip-0054/test_vectors/coinbases.json
Normal file
@ -0,0 +1,79 @@
|
||||
[
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed99613746000000003e699c73b70d61674235d749cfcc240c91df1b658ab774fce2779679f6867d4189b45f49ffff001dc1adcf010101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff055403e0c810feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac15000000"
|
||||
],
|
||||
"valid": false,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 21 and non-final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed996137460000000082cf0907a8dfb0b461f9c3f4a807cff5fb85df8e54fcc5d8b5a6208b1144fac289b45f49ffff001d094390190101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05540320d613921000000100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac04000000"
|
||||
],
|
||||
"valid": false,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 4 and non-final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed9961374600000000da08acbf43b797bea5a20bb65f0a02871f6272cd0dbd5d192de0b8b241a285aa89b45f49ffff001d5077290a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff055403400d03feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000"
|
||||
],
|
||||
"valid": false,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 2 and non-final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed99613746000000000035fba8f8f05b94463822ffd007213ff095c4b82e5bc166fd51c8ba01e0659189b45f49ffff001d394a4d070101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025400fb4003000100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac03000000"
|
||||
],
|
||||
"valid": true,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 3 and non-final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed9961374600000000e7822dba53b0868472211017555701e69bbd9c3e2ec5502347dce64e963cff0989b45f49ffff001dfb8e6e110101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05540360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac03000000"
|
||||
],
|
||||
"valid": true,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 3 and maximum non-final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed9961374600000000a392d0e70a32b369e2ec509ec0b5cdfad3db5f78d594f855588d6193d7e5bef889b45f49ffff001d5ec3630c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05540320d613ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac03000000"
|
||||
],
|
||||
"valid": false,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to 3 and final nSequence."
|
||||
},
|
||||
{
|
||||
"block_chain": [
|
||||
"0100000000000000000000000000000000000000000000000000000000000000000000003ba3edfd7a7b12b27ac72c3e67768f617fc81bc3888a51323a9fb8aa4b1e5e4a29ab5f49ffff001d1dac2b7c0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff4d04ffff001d0104455468652054696d65732030332f4a616e2f32303039204368616e63656c6c6f72206f6e206272696e6b206f66207365636f6e64206261696c6f757420666f722062616e6b73ffffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"010000006fe28c0ab6f1b372c1a6a246ae63f74f931e8365e15a089c68d619000000000068fcdbe419c7d12484fd7e1f7cc22c98e4afab982539e2333ca8ce9a317a592f81ad5f49ffff001d846f5e090101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff025100feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac00000000",
|
||||
"01000000a58a17b4a4487b9c83ab80ed6a9ccbb9de25925193cc084f41872bd700000000462c6597dd11214ae6f20905dc3828c000a693c3e4b17df82469e528dd9eeab8d9af5f49ffff001dd6bbd40a0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05520360ae0afeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac01000000",
|
||||
"010000005702226e10bfe0b24a41a05f406c73046b9ad6fca09255968d3a954b00000000d72d147d9b46612e6adb7168821448e3eca3231ffce8c812a1503ab30001e3bd31b25f49ffff001d7b1408060101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05530320d613feffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac02000000",
|
||||
"01000000131cda7ce756b84bd95dd3ee07333f2224e286bb9a5e13ed99613746000000002be83903e9da68744e4da285d3641faf33694531e1717724d415265bc987bfbb89b45f49ffff001dbfe17c1f0101000000010000000000000000000000000000000000000000000000000000000000000000ffffffff05540340420ffeffffff0100f2052a01000000434104678afdb0fe5548271967f1a67130b7105cd6a828e03909a67962e0ea1f61deb649f6bc3f4cef38c4f35504e51ec112de5c384df7ba0b8d578a4c702b6bf11d5fac88b45f49"
|
||||
],
|
||||
"valid": false,
|
||||
"comment": "Block at height 4 with coinbase's nLockTime set to block's nTime minus 1 and maximum non-final nSequence."
|
||||
}
|
||||
]
|
||||
1604
bip-0054/test_vectors/sigops.json
Normal file
1604
bip-0054/test_vectors/sigops.json
Normal file
File diff suppressed because one or more lines are too long
24253
bip-0054/test_vectors/timestamps.json
Normal file
24253
bip-0054/test_vectors/timestamps.json
Normal file
File diff suppressed because it is too large
Load Diff
62
bip-0054/test_vectors/txsize.json
Normal file
62
bip-0054/test_vectors/txsize.json
Normal file
@ -0,0 +1,62 @@
|
||||
[
|
||||
{
|
||||
"tx": "0200000001827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff0100000000000000000300515200000000",
|
||||
"valid": true,
|
||||
"comment": "A 63-byte legacy transaction."
|
||||
},
|
||||
{
|
||||
"tx": "02000000000101827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff01000000000000000000010000000000",
|
||||
"valid": true,
|
||||
"comment": "A 61-byte legacy transaction with a witness."
|
||||
},
|
||||
{
|
||||
"tx": "0200000001827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff010000000000000000040051525400000000",
|
||||
"valid": false,
|
||||
"comment": "A 64-byte legacy transaction (4 bytes in spk)."
|
||||
},
|
||||
{
|
||||
"tx": "0200000001827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c883150000000403424242ffffffff010040075af07507000000000000",
|
||||
"valid": false,
|
||||
"comment": "A 64-byte legacy transaction (4 bytes in scriptsig)."
|
||||
},
|
||||
{
|
||||
"tx": "0200000001827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff01000000000000000005005152545800000000",
|
||||
"valid": true,
|
||||
"comment": "A 65-byte legacy transaction."
|
||||
},
|
||||
{
|
||||
"tx": "02000000000101827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff01000000000000000004005152540108213245576281941200000000",
|
||||
"valid": false,
|
||||
"comment": "A 64-byte Segwit transaction."
|
||||
},
|
||||
{
|
||||
"tx": "02000000000101827da3d85a6547d6b03662d2cb86982d655a6f390547285a3bf9ec9f28e0c8831500000000ffffffff0100000000000000000451024e7301415a78b5a14a2527feb02c08b8124e74c3b9bcc1bd3dba1fbfa87f1c930f28a46fea2bf375105dfd835e212c9127aad4976c46ef86be02edbb681e6f38f9a9e06f0100000000",
|
||||
"valid": false,
|
||||
"comment": "A 64-byte Segwit transaction (1 p2tr input, 1 p2a output)."
|
||||
},
|
||||
{
|
||||
"tx": "0200000001deb98691723fa71260ffca6ea0a7bc0a63b0a8a366e1b585caad47fb269a2ce401000000030251b201000000010000000000000000016a00000000",
|
||||
"valid": false,
|
||||
"comment": "Historical 64-byte transaction 892f44a49de6f5b212cdbea514d09e692d9fed5d897f37bcef14bd0eedebf193"
|
||||
},
|
||||
{
|
||||
"tx": "01000000010d0afe3d74062ee60c0ec55579d691d8c8af5c04eb97b777157a21a8c5fb143d00000000035101b100000000010000000000000000016a01000000",
|
||||
"valid": false,
|
||||
"comment": "Historical 64-byte transaction bbf71454857438c6dfd64c0d92a7c5360a8d8d57c9202f5806449e5b0d26b848"
|
||||
},
|
||||
{
|
||||
"tx": "02000000011658a33df410379bb512206659910c9fbd0e50bfb732f7be9936558ff036919401000000035101b201000000010000000000000000016a00000000",
|
||||
"valid": false,
|
||||
"comment": "Historical 64-byte transaction 6713d61a83e3d095582211ea8d6db452ac7561e863decba7c4046fb9f6d88aa0"
|
||||
},
|
||||
{
|
||||
"tx": "02000000011a7a4cf262fb7e53e2e6e0b2ef8b763f6ee97d8681ca968d1938418d56e6c38700000000035101b201000000010000000000000000016a00000000",
|
||||
"valid": false,
|
||||
"comment": "Historical 64-byte transaction 7f2efc6546011ad3227b2da678be0d30c7f4b08e2ce57b5edadd437f9e27a612"
|
||||
},
|
||||
{
|
||||
"tx": "01000000019222bbb054bb9f94571dfe769af5866835f2a97e883959fa757de4064bed8bca01000000035101b100000000010000000000000000016a01000000",
|
||||
"valid": false,
|
||||
"comment": "Historical 64-byte transaction 5302e01dc4b7e34314a34c7c3347107e612b9524be684d388cd4d2ca35ff1ec9"
|
||||
}
|
||||
]
|
||||
Loading…
x
Reference in New Issue
Block a user