Commit js, ts, and definitions in separate folders
This commit is contained in:
parent
e7ac2b9a4e
commit
bc28949056
148 changed files with 3850 additions and 39 deletions
ts_src
49
ts_src/networks.ts
Normal file
49
ts_src/networks.ts
Normal file
|
@ -0,0 +1,49 @@
|
|||
// https://en.bitcoin.it/wiki/List_of_address_prefixes
|
||||
// Dogecoin BIP32 is a proposed standard: https://bitcointalk.org/index.php?topic=409731
|
||||
export type Network = {
|
||||
messagePrefix: string;
|
||||
bech32: string;
|
||||
bip32: bip32;
|
||||
pubKeyHash: number;
|
||||
scriptHash: number;
|
||||
wif: number;
|
||||
}
|
||||
|
||||
type bip32 = {
|
||||
public: number;
|
||||
private: number;
|
||||
}
|
||||
|
||||
export const bitcoin: Network = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bc',
|
||||
bip32: {
|
||||
public: 0x0488b21e,
|
||||
private: 0x0488ade4
|
||||
},
|
||||
pubKeyHash: 0x00,
|
||||
scriptHash: 0x05,
|
||||
wif: 0x80
|
||||
}
|
||||
export const regtest: Network = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'bcrt',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
}
|
||||
export const testnet: Network = {
|
||||
messagePrefix: '\x18Bitcoin Signed Message:\n',
|
||||
bech32: 'tb',
|
||||
bip32: {
|
||||
public: 0x043587cf,
|
||||
private: 0x04358394
|
||||
},
|
||||
pubKeyHash: 0x6f,
|
||||
scriptHash: 0xc4,
|
||||
wif: 0xef
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue