genesis.go raw
1 package chaincfg
2
3 import (
4 "github.com/p9c/p9/pkg/fork"
5 "time"
6
7 "github.com/p9c/p9/pkg/chainhash"
8 "github.com/p9c/p9/pkg/wire"
9 )
10
11 // genesisCoinbaseTx is the coinbase transaction for the genesis blocks for the main network, regression test network,
12 // and test network (version 3).
13 var genesisCoinbaseTx = wire.MsgTx{
14 Version: 2,
15 TxIn: []*wire.TxIn{
16 {
17 PreviousOutPoint: wire.OutPoint{
18 Hash: chainhash.Hash{},
19 Index: 0xffffffff,
20 },
21 SignatureScript: []byte{
22 0x04, 0xff, 0xff, 0x00, 0x1d, 0x01, 0x04, 0x32,
23 0x4e, 0x59, 0x54, 0x69, 0x6d, 0x65, 0x73, 0x20,
24 0x32, 0x30, 0x31, 0x34, 0x2d, 0x30, 0x37, 0x2d,
25 0x31, 0x39, 0x20, 0x2d, 0x20, 0x44, 0x65, 0x6c,
26 0x6c, 0x20, 0x42, 0x65, 0x67, 0x69, 0x6e, 0x73,
27 0x20, 0x41, 0x63, 0x63, 0x65, 0x70, 0x74, 0x69,
28 0x6e, 0x67, 0x20, 0x42, 0x69, 0x74, 0x63, 0x6f,
29 0x69, 0x6e,
30 },
31 Sequence: 0xffffffff,
32 },
33 },
34 TxOut: []*wire.TxOut{
35 {
36 Value: 0x174876E800,
37 PkScript: []byte{
38 0x41, 0x04, 0xe0, 0xd2, 0x71, 0x72, 0x51, 0x0c,
39 0x68, 0x06, 0x88, 0x97, 0x40, 0xed, 0xaf, 0xe6,
40 0xe6, 0x3e, 0xb2, 0x3f, 0xca, 0x32, 0x78, 0x6f,
41 0xcc, 0xfd, 0xb2, 0x82, 0xbb, 0x28, 0x76, 0xa9,
42 0xf4, 0x3b, 0x22, 0x82, 0x45, 0xdf, 0x05, 0x76,
43 0x61, 0xff, 0x94, 0x3f, 0x61, 0x50, 0x71, 0x6a,
44 0x20, 0xea, 0x18, 0x51, 0xe8, 0xa7, 0xe9, 0xf5,
45 0x4e, 0x62, 0x02, 0x97, 0x66, 0x46, 0x18, 0x43,
46 0x8d, 0xae, 0xac,
47 },
48 },
49 },
50 LockTime: 0,
51 }
52
53 // genesisHash is the hash of the first block in the block chain for the main network (genesis block).
54 var genesisHash = chainhash.Hash(
55 [chainhash.HashSize]byte{
56 0xc7, 0xcc, 0x40, 0xc7, 0xc5, 0x4f, 0xd1, 0x39,
57 0x1d, 0xdf, 0x3a, 0xe7, 0xcf, 0x98, 0xf2, 0x8b,
58 0x23, 0xcf, 0xfd, 0x0c, 0x66, 0xd3, 0x04, 0xc9,
59 0xaa, 0xd3, 0xba, 0xfc, 0xf0, 0x09, 0x00, 0x00,
60 // 0x00, 0x00, 0x09, 0xf0, 0xfc, 0xba, 0xd3, 0xaa,
61 // 0xc9, 0x04, 0xd3, 0x66, 0x0c, 0xfd, 0xcf, 0x23,
62 // 0x8b, 0xf2, 0x98, 0xcf, 0xe7, 0x3a, 0xdf, 0x1d,
63 // 0x39, 0xd1, 0x4f, 0xc5, 0xc7, 0x40, 0xcc, 0xc7,
64 },
65 )
66
67 // genesisMerkleRoot is the hash of the first transaction in the genesis block for the main network.
68 var genesisMerkleRoot = chainhash.Hash(
69 [chainhash.HashSize]byte{
70 // 0xc8, 0x43, 0xea, 0xe4, 0x65, 0x8e, 0x3a, 0x51,
71 // 0xd2, 0xf2, 0x80, 0xc3, 0x63, 0x76, 0xce, 0x56,
72 // 0xdc, 0x71, 0xa6, 0xc7, 0x0e, 0x4b, 0x1c, 0x5a,
73 // 0xd2, 0xd7, 0xa9, 0x31, 0x6f, 0x9b, 0x9a, 0xb7,
74 0xb7, 0x9a, 0x9b, 0x6f, 0x31, 0xa9, 0xd7, 0xd2,
75 0x5a, 0x1c, 0x4b, 0x0e, 0xc7, 0xa6, 0x71, 0xdc,
76 0x56, 0xce, 0x76, 0x63, 0xc3, 0x80, 0xf2, 0xd2,
77 0x51, 0x3a, 0x8e, 0x65, 0xe4, 0xea, 0x43, 0xc8,
78 },
79 )
80
81 // genesisBlock defines the genesis block of the block chain which serves as the public transaction ledger for the main
82 // network.
83 var genesisBlock = wire.Block{
84 Header: wire.BlockHeader{
85 Version: 2,
86 PrevBlock: chainhash.Hash{},
87 MerkleRoot: genesisMerkleRoot,
88 Timestamp: time.Unix(0x53c9ecdc, 0), // 2014-07-19 03:58:20 +0000 UTC
89 Bits: 0x1e0fffff, // 4294905630[00000fffff000000000000000000000000000000000000000000000000000000]
90 Nonce: 0x10281, // 2164392192
91 },
92 Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
93 }
94
95 // regTestGenesisHash is the hash of the first block in the block chain for the regression test network (genesis block).
96 var regTestGenesisHash = chainhash.Hash(
97 [chainhash.HashSize]byte{
98 0x81, 0x91, 0x37, 0x60, 0xab, 0x59, 0x85, 0x57,
99 0x7b, 0x23, 0x4d, 0xf6, 0xe2, 0x65, 0xba, 0x6b,
100 0x48, 0x7e, 0x66, 0x25, 0xc8, 0x52, 0x2a, 0xdc,
101 0x83, 0xa1, 0x0e, 0x22, 0x9e, 0xb7, 0xe9, 0x69,
102 },
103 )
104
105 // regTestGenesisMerkleRoot is the hash of the first transaction in the genesis block for the regression test network.
106 // It is the same as the merkle root for the main network.
107 var regTestGenesisMerkleRoot = genesisMerkleRoot
108
109 // regTestGenesisBlock defines the genesis block of the block chain which serves as the public transaction ledger for
110 // the regression test network.
111 var regTestGenesisBlock = wire.Block{
112 Header: wire.BlockHeader{
113 Version: 2,
114 PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000
115 MerkleRoot: regTestGenesisMerkleRoot,
116 Timestamp: time.Unix(0x53c9ea84, 0),
117 Bits: 0x207fffff, // 4294934304 [7fffff0000000000000000000000000000000000000000000000000000000000]
118 Nonce: 0x00000001,
119 },
120 Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
121 }
122
123 // testNet3GenesisMerkleRoot is the hash of the first transaction in the genesis block for the test network (version 3).
124 // It is the same as the merkle root for the main network.
125 var testNet3GenesisMerkleRoot = genesisMerkleRoot
126
127 // testNet3GenesisBlock defines the genesis block of the block chain which serves as the public transaction ledger for
128 // the test network (version 3).
129 var testNet3GenesisBlock = wire.Block{
130 Header: wire.BlockHeader{
131 Version: 2,
132 PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000
133 MerkleRoot: testNet3GenesisMerkleRoot,
134 Timestamp: time.Unix(0x5dda3362, 0),
135 Bits: fork.SecondPowLimitBits, // 0x1e00f1ea, //testnetBits, // 0x1e0fffff,
136 // 486604799 [00000000ffff0000000000000000000000000000000000000000000000000000]
137 Nonce: 0x001adf18, // 417274368
138 },
139 Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
140 }
141
142 // testNet3GenesisHash is the hash of the first block in the block chain for the test network (version 3).
143 // var testNet3GenesisHash = chainhash.Hash([chainhash.HashSize]byte{
144 // 0xdf, 0x0c, 0xb3, 0x5f, 0x69, 0x72, 0x75, 0xe1,
145 // 0x8f, 0x66, 0xa2, 0x7d, 0xc8, 0xbb, 0x12, 0xfa,
146 // 0x85, 0x4d, 0xed, 0x22, 0x2c, 0x0c, 0x1b, 0xf9,
147 // 0x5e, 0xa3, 0xba, 0xec, 0x41, 0x0e, 0x00, 0x00,
148 // })
149 var testNet3GenesisHash = testNet3GenesisBlock.Header.BlockHash()
150
151 // simNetGenesisHash is the hash of the first block in the block chain for the simulation test network.
152 var simNetGenesisHash = chainhash.Hash(
153 [chainhash.HashSize]byte{
154 0xdf, 0x0c, 0xb3, 0x5f, 0x69, 0x72, 0x75, 0xe1,
155 0x8f, 0x66, 0xa2, 0x7d, 0xc8, 0xbb, 0x12, 0xfa,
156 0x85, 0x4d, 0xed, 0x22, 0x2c, 0x0c, 0x1b, 0xf9,
157 0x5e, 0xa3, 0xba, 0xec, 0x41, 0x0e, 0x00, 0x00,
158 },
159 )
160
161 // simNetGenesisMerkleRoot is the hash of the first transaction in the genesis block for the simulation test network. It
162 // is the same as the merkle root for the main network.
163 var simNetGenesisMerkleRoot = genesisMerkleRoot
164
165 // simNetGenesisBlock defines the genesis block of the block chain which serves as the public transaction ledger for the
166 // simulation test network.
167 var simNetGenesisBlock = wire.Block{
168 Header: wire.BlockHeader{
169 Version: 2,
170 PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000
171 MerkleRoot: simNetGenesisMerkleRoot,
172 Timestamp: time.Unix(0x53c9ea84, 0),
173 Bits: 0x207fffff, // 545259519 [7fffff0000000000000000000000000000000000000000000000000000000000]
174 Nonce: 2,
175 },
176 Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
177 }
178