elements/test/functional/data
2026-04-16 14:07:53 +00:00
..
__init__.py lint: enable mypy checking for missing imports 2021-10-16 09:14:37 +08:00
blockheader_testnet3.hex test: Test that low difficulty chain fork is rejected 2019-08-16 13:02:16 -04:00
invalid_txs.py Merge d9f8dc6453 into merged_master (Bitcoin PR bitcoin/bitcoin#31097) 2026-03-30 14:21:02 +00:00
mainnet_alt.json test: check difficulty adjustment using alternate mainnet 2025-01-22 12:31:46 +01:00
README.md Docs: fix typos in documentation files 2025-03-08 09:26:18 +08:00
rpc_bip67.json Merge 520d140e6e into merged_master (Bitcoin PR #17056) 2020-11-09 21:20:35 +00:00
rpc_decodescript.json Merge 7edce77ff3 into merged_master (Bitcoin PR bitcoin/bitcoin#28067) 2025-07-03 09:42:33 +02:00
rpc_getblockstats.json Merge 5d9b5305af into merged_master (Bitcoin PR bitcoin/bitcoin#19888) 2025-03-17 13:04:28 +00:00
rpc_psbt.json Merge 1f9d30744d into merged_master (Bitcoin PR bitcoin/bitcoin#29855) 2026-03-05 14:02:42 +00:00

Various test vectors

mainnet_alt.json

For easier testing the difficulty is maximally increased in the first (and only) retarget period, by producing blocks approximately 2 minutes apart.

The alternate mainnet chain was generated as follows:

  • use faketime to set node clock to 2 minutes after genesis block
  • mine a block using a CPU miner such as https://github.com/pooler/cpuminer
  • restart node with a faketime 2 minutes later
for i in {1..2015}
do
 faketime "`date -d @"$(( 1231006505 + $i * 120 ))"  +'%Y-%m-%d %H:%M:%S'`" \
 bitcoind -connect=0 -nocheckpoints -stopatheight=$i
done

The CPU miner is kept running as follows:

./minerd --coinbase-addr 1NQpH6Nf8QtR2HphLRcvuVqfhXBXsiWn8r --no-stratum --algo sha256d --no-longpoll --scantime 3 --retry-pause 1

The payout address is derived from first BIP32 test vector master key:

pkh(xprv9s21ZrQH143K3QTDL4LXw2F7HEK3wJUD2nW2nRk4stbPy6cq3jPPqjiChkVvvNKmPGJxWUtg6LnF5kejMRNNU3TGtRBeJgk33yuGBxrMPHi/44h/0h/0h/<0;1>/*)#fkjtr0yn

It uses pkh() because tr() outputs at low heights are not spendable (unexpected-witness).

This makes each block deterministic except for its timestamp and nonce, which are stored in mainnet_alt.json and used to reconstruct the chain without having to redo the proof-of-work.

The timestamp was not kept constant because at difficulty 1 it's not sufficient to only grind the nonce. Grinding the extra_nonce or version field instead would have required additional (stratum) software. It would also make it more complicated to reconstruct the blocks in this test.