mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-06 14:52:33 +00:00
coins: add slip44
This commit is contained in:
parent
ab98322d4d
commit
fd35b4c5c9
@ -11,6 +11,7 @@ class CoinInfo:
|
|||||||
xpub_magic: int,
|
xpub_magic: int,
|
||||||
bech32_prefix: str,
|
bech32_prefix: str,
|
||||||
cashaddr_prefix: str,
|
cashaddr_prefix: str,
|
||||||
|
slip44: int,
|
||||||
segwit: bool,
|
segwit: bool,
|
||||||
fork_id: int,
|
fork_id: int,
|
||||||
force_bip143: bool,
|
force_bip143: bool,
|
||||||
@ -25,6 +26,7 @@ class CoinInfo:
|
|||||||
self.xpub_magic = xpub_magic
|
self.xpub_magic = xpub_magic
|
||||||
self.bech32_prefix = bech32_prefix
|
self.bech32_prefix = bech32_prefix
|
||||||
self.cashaddr_prefix = cashaddr_prefix
|
self.cashaddr_prefix = cashaddr_prefix
|
||||||
|
self.slip44 = slip44
|
||||||
self.segwit = segwit
|
self.segwit = segwit
|
||||||
self.fork_id = fork_id
|
self.fork_id = fork_id
|
||||||
self.force_bip143 = force_bip143
|
self.force_bip143 = force_bip143
|
||||||
@ -44,6 +46,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='bc',
|
bech32_prefix='bc',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=0,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -59,6 +62,7 @@ COINS = [
|
|||||||
xpub_magic=0x043587cf,
|
xpub_magic=0x043587cf,
|
||||||
bech32_prefix='tb',
|
bech32_prefix='tb',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=1,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -74,6 +78,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix='bitcoincash',
|
cashaddr_prefix='bitcoincash',
|
||||||
|
slip44=145,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=0,
|
fork_id=0,
|
||||||
force_bip143=True,
|
force_bip143=True,
|
||||||
@ -89,6 +94,7 @@ COINS = [
|
|||||||
xpub_magic=0x043587cf,
|
xpub_magic=0x043587cf,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix='bchtest',
|
cashaddr_prefix='bchtest',
|
||||||
|
slip44=1,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=0,
|
fork_id=0,
|
||||||
force_bip143=True,
|
force_bip143=True,
|
||||||
@ -104,6 +110,7 @@ COINS = [
|
|||||||
xpub_magic=0x019da462,
|
xpub_magic=0x019da462,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=7,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -119,6 +126,7 @@ COINS = [
|
|||||||
xpub_magic=0x019da462,
|
xpub_magic=0x019da462,
|
||||||
bech32_prefix='ltc',
|
bech32_prefix='ltc',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=2,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -134,6 +142,7 @@ COINS = [
|
|||||||
xpub_magic=0x02facafd,
|
xpub_magic=0x02facafd,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=3,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -149,6 +158,7 @@ COINS = [
|
|||||||
xpub_magic=0x02fe52cc,
|
xpub_magic=0x02fe52cc,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=5,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -164,6 +174,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=133,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -179,6 +190,7 @@ COINS = [
|
|||||||
xpub_magic=0x043587cf,
|
xpub_magic=0x043587cf,
|
||||||
bech32_prefix=None,
|
bech32_prefix=None,
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=1,
|
||||||
segwit=False,
|
segwit=False,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -194,6 +206,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='btg',
|
bech32_prefix='btg',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=156,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=79,
|
fork_id=79,
|
||||||
force_bip143=True,
|
force_bip143=True,
|
||||||
@ -209,6 +222,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='dgb',
|
bech32_prefix='dgb',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=20,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -224,6 +238,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='mona',
|
bech32_prefix='mona',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=22,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -239,6 +254,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='fc',
|
bech32_prefix='fc',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=75,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
@ -254,6 +270,7 @@ COINS = [
|
|||||||
xpub_magic=0x0488b21e,
|
xpub_magic=0x0488b21e,
|
||||||
bech32_prefix='vtc',
|
bech32_prefix='vtc',
|
||||||
cashaddr_prefix=None,
|
cashaddr_prefix=None,
|
||||||
|
slip44=28,
|
||||||
segwit=True,
|
segwit=True,
|
||||||
fork_id=None,
|
fork_id=None,
|
||||||
force_bip143=False,
|
force_bip143=False,
|
||||||
|
@ -20,3 +20,10 @@ def by_address_type(address_type):
|
|||||||
if c.address_type == address_type:
|
if c.address_type == address_type:
|
||||||
return c
|
return c
|
||||||
raise ValueError('Unknown coin address type %d' % address_type)
|
raise ValueError('Unknown coin address type %d' % address_type)
|
||||||
|
|
||||||
|
|
||||||
|
def by_slip44(slip44):
|
||||||
|
for c in COINS:
|
||||||
|
if c.slip44 == slip44:
|
||||||
|
return c
|
||||||
|
raise ValueError('Unknown coin slip44 index %d' % slip44)
|
||||||
|
@ -11,6 +11,7 @@ fields = [
|
|||||||
'xpub_magic',
|
'xpub_magic',
|
||||||
'bech32_prefix',
|
'bech32_prefix',
|
||||||
'cashaddr_prefix',
|
'cashaddr_prefix',
|
||||||
|
'slip44',
|
||||||
'segwit',
|
'segwit',
|
||||||
'fork_id',
|
'fork_id',
|
||||||
'force_bip143',
|
'force_bip143',
|
||||||
|
Loading…
Reference in New Issue
Block a user