Legacy addresses are less and less common these days and not recommended to use, so it seems senseful to also reflect that in the example addresses and update to the most recent address / output type (bech32m / P2TR). Also, as I couldn’t see any value in computing these at runtime, they are pre-generated. This was done with the following Python script, executed in ./test/functional
(it’s also included in the commit body, though without the she-bang):
0#!/usr/bin/env python3
1from test_framework.segwit_addr import CHARSET, decode_segwit_address, encode_segwit_address
2from test_framework.messages import sha256
3
4output_key = sha256(b'bitcoin dummy taproot output key')
5for network, hrp in [('mainnet', 'bc'), ('signet', 'tb'), ('testnet', 'tb'), ('regtest', 'bcrt')]:
6 dummy_address = encode_segwit_address(hrp, 1, output_key)
7 while decode_segwit_address(hrp, dummy_address) != (None, None):
8 last_char = CHARSET[(CHARSET.index(dummy_address[-1]) + 1) % 32]
9 dummy_address = dummy_address[:-1] + last_char
10 print(f'{network:7} example address: {dummy_address}')
Note that the last bech32 character is modified in order to make the checksum fail.
master (mainnet):
PR (mainnet):