-
Notifications
You must be signed in to change notification settings - Fork 13
/
Copy pathbitcoin_forks.go
69 lines (55 loc) · 2.62 KB
/
bitcoin_forks.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
package coincodec
import "github.com/wealdtech/go-slip44"
const (
ZCashStaticPrefixByte = 0x1C // 28
ZCashPrefixByteP2pkh = 0xB8 // 184
ZCashPrefixByteP2sh = 0xBD // 189
)
var (
zcashPrefixP2pkh = []byte{ZCashStaticPrefixByte, ZCashPrefixByteP2pkh}
zcashPrefixP2sh = []byte{ZCashStaticPrefixByte, ZCashPrefixByteP2sh}
)
var (
configLTC = CoinConfig{P2PKHPrefix: []byte{0x30}, P2SHPPrefix: []byte{0x32}, HRP: "ltc"}
configMONA = CoinConfig{P2PKHPrefix: []byte{0x32}, P2SHPPrefix: []byte{0x37}, HRP: "mona"}
configQTUM = CoinConfig{P2PKHPrefix: []byte{0x3A}, P2SHPPrefix: []byte{0x32}, HRP: "qc"}
configVIA = CoinConfig{P2PKHPrefix: []byte{0x47}, P2SHPPrefix: []byte{0x21}, HRP: "via"}
configDGB = CoinConfig{P2PKHPrefix: []byte{0x1E}, P2SHPPrefix: []byte{0x3F}, HRP: "dgb"}
configDOGE = CoinConfig{P2PKHPrefix: []byte{0x1E}, P2SHPPrefix: []byte{0x16}}
configDASH = CoinConfig{P2PKHPrefix: []byte{0x4C}, P2SHPPrefix: []byte{0x10}}
configXZC = CoinConfig{P2PKHPrefix: []byte{0x52}, P2SHPPrefix: []byte{0x07}}
configRVN = CoinConfig{P2PKHPrefix: []byte{0x3C}, P2SHPPrefix: []byte{0x7A}}
configZCASH = CoinConfig{P2PKHPrefix: zcashPrefixP2pkh, P2SHPPrefix: zcashPrefixP2sh}
)
func init() {
// LTC
toBytesMap[slip44.LITECOIN] = MakeBitcoinDecodeToBytes(&configLTC)
toStringMap[slip44.LITECOIN] = MakeBitcoinEncodeToString(&configLTC)
// DOGE
toBytesMap[slip44.DOGECOIN] = MakeBitcoinDecodeToBytes(&configDOGE)
toStringMap[slip44.DOGECOIN] = MakeBitcoinEncodeToString(&configDOGE)
// DASH
toBytesMap[slip44.DASH] = MakeBitcoinDecodeToBytes(&configDASH)
toStringMap[slip44.DASH] = MakeBitcoinEncodeToString(&configDASH)
// VIA
toBytesMap[slip44.VIACOIN] = MakeBitcoinDecodeToBytes(&configVIA)
toStringMap[slip44.VIACOIN] = MakeBitcoinEncodeToString(&configVIA)
// DGB
toBytesMap[slip44.DIGIBYTE] = MakeBitcoinDecodeToBytes(&configDGB)
toStringMap[slip44.DIGIBYTE] = MakeBitcoinEncodeToString(&configDGB)
// MONA
toBytesMap[slip44.MONACOIN] = MakeBitcoinDecodeToBytes(&configMONA)
toStringMap[slip44.MONACOIN] = MakeBitcoinEncodeToString(&configMONA)
// XZC
toBytesMap[slip44.ZCOIN] = MakeBitcoinDecodeToBytes(&configXZC)
toStringMap[slip44.ZCOIN] = MakeBitcoinEncodeToString(&configXZC)
// RVN
toBytesMap[slip44.RAVENCOIN] = MakeBitcoinDecodeToBytes(&configRVN)
toStringMap[slip44.RAVENCOIN] = MakeBitcoinEncodeToString(&configRVN)
// QTUM
toBytesMap[slip44.QTUM] = MakeBitcoinDecodeToBytes(&configQTUM)
toStringMap[slip44.QTUM] = MakeBitcoinEncodeToString(&configQTUM)
// ZCASH
toBytesMap[slip44.ZCASH] = MakeBitcoinDecodeToBytes(&configZCASH)
toStringMap[slip44.ZCASH] = MakeBitcoinEncodeToString(&configZCASH)
}