2014-04-16 21:43:34 +02:00
|
|
|
// https://en.bitcoin.it/wiki/List_of_address_prefixes
|
2014-04-30 00:07:15 +02:00
|
|
|
// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
|
2019-03-07 04:11:15 +01:00
|
|
|
export interface Network {
|
2018-12-26 08:13:43 +01:00
|
|
|
messagePrefix: string;
|
|
|
|
bech32: string;
|
2019-03-07 04:11:15 +01:00
|
|
|
bip32: Bip32;
|
2018-12-26 08:13:43 +01:00
|
|
|
pubKeyHash: number;
|
|
|
|
scriptHash: number;
|
|
|
|
wif: number;
|
2019-03-07 04:11:15 +01:00
|
|
|
}
|
2018-12-26 08:13:43 +01:00
|
|
|
|
2019-03-07 04:11:15 +01:00
|
|
|
interface Bip32 {
|
2018-12-26 08:13:43 +01:00
|
|
|
public: number;
|
|
|
|
private: number;
|
2019-03-07 04:11:15 +01:00
|
|
|
}
|
2014-06-17 08:48:06 +02:00
|
|
|
|
2022-04-06 00:41:17 +02:00
|
|
|
export const mainnet: Network = {
|
|
|
|
messagePrefix: '\x18Bitcoin Signed Message:\n', // ?
|
|
|
|
bech32: 'bech32', // TODO is this right?! BECH32_ADDRESS lbry/wallet/orchstr8/node.py?
|
2018-12-26 08:13:43 +01:00
|
|
|
bip32: {
|
2022-04-06 00:41:17 +02:00
|
|
|
public: 0x0488b21e, // lbry/wallet/server/coin.py XPUB_VERBYTES (unchanged)
|
|
|
|
private: 0x0488ade4, // lbry/wallet/server/coin.py XPRV_VERBYTES (unchanged)
|
2014-04-16 21:43:34 +02:00
|
|
|
},
|
2022-04-06 00:41:17 +02:00
|
|
|
pubKeyHash: 0x55, // lbry/wallet/server/coin.py P2PKH_VERBYTE
|
|
|
|
scriptHash: 0x7a, // lbry/wallet/server/coin.py P2SH_VERBYTES
|
|
|
|
wif: 0x1c, // lbry/wallet/server/coin.py WIF_BYTE
|
2019-03-03 15:07:49 +01:00
|
|
|
};
|
2018-12-26 08:13:43 +01:00
|
|
|
export const regtest: Network = {
|
|
|
|
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
2022-04-06 00:41:17 +02:00
|
|
|
bech32: 'bech32', // TODO is this right?! BECH32_ADDRESS lbry/wallet/orchstr8/node.py?
|
2018-12-26 08:13:43 +01:00
|
|
|
bip32: {
|
2022-04-06 00:41:17 +02:00
|
|
|
public: 0x043587cf, // lbry/wallet/server/coin.py XPUB_VERBYTES (unchanged)
|
|
|
|
private: 0x04358394, // lbry/wallet/server/coin.py XPRV_VERBYTES (unchanged)
|
2018-12-26 08:13:43 +01:00
|
|
|
},
|
2022-04-06 00:41:17 +02:00
|
|
|
pubKeyHash: 0x6f, // lbry/wallet/server/coin.py P2PKH_VERBYTE (unchanged)
|
|
|
|
scriptHash: 0xc4, // lbry/wallet/server/coin.py P2SH_VERBYTES (unchanged)
|
|
|
|
wif: 0x1c, // lbry/wallet/server/coin.py WIF_BYTE
|
2019-03-03 15:07:49 +01:00
|
|
|
};
|
2018-12-26 08:13:43 +01:00
|
|
|
export const testnet: Network = {
|
|
|
|
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
2022-04-06 00:41:17 +02:00
|
|
|
bech32: 'bech32', // TODO is this right?! BECH32_ADDRESS lbry/wallet/orchstr8/node.py?
|
2018-12-26 08:13:43 +01:00
|
|
|
bip32: {
|
2022-04-06 00:41:17 +02:00
|
|
|
public: 0x043587cf, // lbry/wallet/server/coin.py XPUB_VERBYTES (unchanged)
|
|
|
|
private: 0x04358394, // lbry/wallet/server/coin.py XPRV_VERBYTES (unchanged)
|
2018-11-15 07:32:03 +01:00
|
|
|
},
|
2022-04-06 00:41:17 +02:00
|
|
|
pubKeyHash: 0x6f, // lbry/wallet/server/coin.py P2PKH_VERBYTE (unchanged)
|
|
|
|
scriptHash: 0xc4, // lbry/wallet/server/coin.py P2SH_VERBYTES (unchanged)
|
|
|
|
wif: 0x1c, // lbry/wallet/server/coin.py WIF_BYTE
|
2019-03-03 15:07:49 +01:00
|
|
|
};
|