testnet4
This commit is contained in:
parent
f2a3667593
commit
92a776cfc3
@ -14,6 +14,7 @@ This lists the new changes that have not yet been published in a normal release.
|
||||
- Bugfix: Prevent yikes in ownership search
|
||||
- Change: Do not allow to purge settings of current active tmp seed when deleting it from Seed Vault
|
||||
- Change: Do not include sighash in PSBT input data, if sighash value is SIGHASH_ALL
|
||||
- Change: Testnet3 -> Testnet4 (all parameters are the same)
|
||||
|
||||
|
||||
# Mk4 Specific Changes
|
||||
|
||||
@ -179,8 +179,7 @@ class AddressListMenu(MenuSystem):
|
||||
# Create list of choices (address_index_0, path, addr_fmt)
|
||||
choices = []
|
||||
for name, path, addr_fmt in chains.CommonDerivations:
|
||||
if '{coin_type}' in path:
|
||||
path = path.replace('{coin_type}', str(chain.b44_cointype))
|
||||
path = path.replace('{coin_type}', str(chain.b44_cointype))
|
||||
|
||||
if self.account_num != 0 and '{account}' not in path:
|
||||
# skip derivations that are not affected by account number
|
||||
|
||||
@ -29,8 +29,6 @@ Slip132Version = namedtuple('Slip132Version', ('pub', 'priv', 'hint'))
|
||||
class ChainsBase:
|
||||
|
||||
curve = 'secp256k1'
|
||||
menu_name = None # use 'name' if this isn't defined
|
||||
core_name = None # name of chain's "core" p2p software
|
||||
|
||||
# b44_cointype comes from
|
||||
# <https://github.com/satoshilabs/slips/blob/master/slip-0044.md>
|
||||
@ -290,8 +288,7 @@ class ChainsBase:
|
||||
class BitcoinMain(ChainsBase):
|
||||
# see <https://github.com/bitcoin/bitcoin/blob/master/src/chainparams.cpp#L140>
|
||||
ctype = 'BTC'
|
||||
name = 'Bitcoin'
|
||||
core_name = 'Bitcoin Core'
|
||||
name = 'Bitcoin Mainnet'
|
||||
|
||||
slip132 = {
|
||||
AF_CLASSIC: Slip132Version(0x0488B21E, 0x0488ADE4, 'x'),
|
||||
@ -310,9 +307,9 @@ class BitcoinMain(ChainsBase):
|
||||
b44_cointype = 0
|
||||
|
||||
class BitcoinTestnet(BitcoinMain):
|
||||
# testnet4 (was testnet3 up until 2025 but all parameters are the same)
|
||||
ctype = 'XTN'
|
||||
name = 'Bitcoin Testnet'
|
||||
menu_name = 'Testnet: BTC'
|
||||
name = 'Bitcoin Testnet 4'
|
||||
|
||||
slip132 = {
|
||||
AF_CLASSIC: Slip132Version(0x043587cf, 0x04358394, 't'),
|
||||
@ -334,7 +331,6 @@ class BitcoinTestnet(BitcoinMain):
|
||||
class BitcoinRegtest(BitcoinMain):
|
||||
ctype = 'XRT'
|
||||
name = 'Bitcoin Regtest'
|
||||
menu_name = 'Regtest: BTC'
|
||||
|
||||
slip132 = {
|
||||
AF_CLASSIC: Slip132Version(0x043587cf, 0x04358394, 't'),
|
||||
|
||||
@ -73,14 +73,7 @@ be needed for different systems.
|
||||
sym=chain.ctype, ct=chain.b44_cointype, xfp=xfp))
|
||||
|
||||
for name, path, addr_fmt in chains.CommonDerivations:
|
||||
|
||||
if '{coin_type}' in path:
|
||||
path = path.replace('{coin_type}', str(chain.b44_cointype))
|
||||
|
||||
if '{' in name:
|
||||
name = name.format(core_name=chain.core_name)
|
||||
|
||||
show_slip132 = ('Core' not in name)
|
||||
path = path.replace('{coin_type}', str(chain.b44_cointype))
|
||||
|
||||
yield ('''## For {name}: {path}\n\n'''.format(name=name, path=path))
|
||||
yield ('''First %d receive addresses (account=0, change=0):\n\n''' % num_rx)
|
||||
@ -103,7 +96,7 @@ be needed for different systems.
|
||||
|
||||
node = sv.derive_path(hard_sub, register=False)
|
||||
yield ("%s => %s\n" % (hard_sub, chain.serialize_public(node)))
|
||||
if show_slip132 and addr_fmt != AF_CLASSIC and (addr_fmt in chain.slip132):
|
||||
if addr_fmt != AF_CLASSIC and (addr_fmt in chain.slip132):
|
||||
yield ("%s => %s ##SLIP-132##\n" % (
|
||||
hard_sub, chain.serialize_public(node, addr_fmt)))
|
||||
|
||||
|
||||
@ -304,7 +304,7 @@ If you disable sighash flag restrictions, and ignore the \
|
||||
warnings, funds can be stolen by specially crafted PSBT or MitM.
|
||||
|
||||
Keep blocked unless you intend to sign special transactions.'''),
|
||||
ToggleMenuItem('Testnet Mode', 'chain', ['Bitcoin', 'Testnet3', 'Regtest'],
|
||||
ToggleMenuItem('Testnet Mode', 'chain', ['Bitcoin', 'Testnet4', 'Regtest'],
|
||||
value_map=['BTC', 'XTN', 'XRT'],
|
||||
on_change=change_which_chain,
|
||||
story="Testnet must only be used by developers because \
|
||||
|
||||
@ -216,8 +216,7 @@ class OwnershipCache:
|
||||
addr_fmt = ch.possible_address_fmt(addr)
|
||||
if not addr_fmt:
|
||||
# might be valid address over on testnet vs mainnet
|
||||
nm = ch.name if ch.ctype != 'BTC' else 'Bitcoin Mainnet'
|
||||
raise UnknownAddressExplained('That address is not valid on ' + nm)
|
||||
raise UnknownAddressExplained('That address is not valid on ' + ch.name)
|
||||
|
||||
possibles = []
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user