genesis.go raw
1 package chaincfg
2
3 import (
4 "time"
5
6 "next.orly.dev/pkg/nostr/crypto/ec/chainhash"
7 "next.orly.dev/pkg/nostr/crypto/ec/wire"
8 )
9
10 var (
11 // genesisCoinbaseTx is the coinbase transaction for the genesis blocks for
12 // the main network, regression test network, and test network (version 3).
13 genesisCoinbaseTx = wire.MsgTx{
14 Version: 1,
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,
23 0x45, /* |.......E| */
24 0x54, 0x68, 0x65, 0x20, 0x54, 0x69, 0x6d,
25 0x65, /* |The Time| */
26 0x73, 0x20, 0x30, 0x33, 0x2f, 0x4a, 0x61,
27 0x6e, /* |s 03/Jan| */
28 0x2f, 0x32, 0x30, 0x30, 0x39, 0x20, 0x43,
29 0x68, /* |/2009 Ch| */
30 0x61, 0x6e, 0x63, 0x65, 0x6c, 0x6c, 0x6f,
31 0x72, /* |ancellor| */
32 0x20, 0x6f, 0x6e, 0x20, 0x62, 0x72, 0x69,
33 0x6e, /* | on brin| */
34 0x6b, 0x20, 0x6f, 0x66, 0x20, 0x73, 0x65,
35 0x63, /* |k of sec|*/
36 0x6f, 0x6e, 0x64, 0x20, 0x62, 0x61, 0x69,
37 0x6c, /* |ond bail| */
38 0x6f, 0x75, 0x74, 0x20, 0x66, 0x6f, 0x72,
39 0x20, /* |out for |*/
40 0x62, 0x61, 0x6e, 0x6b, 0x73, /* |banks| */
41 },
42 Sequence: 0xffffffff,
43 },
44 },
45 TxOut: []*wire.TxOut{
46 {
47 Value: 0x12a05f200,
48 PkScript: []byte{
49 0x41, 0x04, 0x67, 0x8a, 0xfd, 0xb0, 0xfe,
50 0x55, /* |A.g....U| */
51 0x48, 0x27, 0x19, 0x67, 0xf1, 0xa6, 0x71,
52 0x30, /* |H'.g..q0| */
53 0xb7, 0x10, 0x5c, 0xd6, 0xa8, 0x28, 0xe0,
54 0x39, /* |..\..(.9| */
55 0x09, 0xa6, 0x79, 0x62, 0xe0, 0xea, 0x1f,
56 0x61, /* |..yb...a| */
57 0xde, 0xb6, 0x49, 0xf6, 0xbc, 0x3f, 0x4c,
58 0xef, /* |..I..?L.| */
59 0x38, 0xc4, 0xf3, 0x55, 0x04, 0xe5, 0x1e,
60 0xc1, /* |8..U....| */
61 0x12, 0xde, 0x5c, 0x38, 0x4d, 0xf7, 0xba,
62 0x0b, /* |..\8M...| */
63 0x8d, 0x57, 0x8a, 0x4c, 0x70, 0x2b, 0x6b,
64 0xf1, /* |.W.Lp+k.| */
65 0x1d, 0x5f, 0xac, /* |._.| */
66 },
67 },
68 },
69 LockTime: 0,
70 }
71 // genesisHash is the hash of the first block in the block chain for the main
72 // network (genesis block).
73 genesisHash = chainhash.Hash(
74 [chainhash.HashSize]byte{
75 // Make go vet happy.
76 0x6f, 0xe2, 0x8c, 0x0a, 0xb6, 0xf1, 0xb3, 0x72,
77 0xc1, 0xa6, 0xa2, 0x46, 0xae, 0x63, 0xf7, 0x4f,
78 0x93, 0x1e, 0x83, 0x65, 0xe1, 0x5a, 0x08, 0x9c,
79 0x68, 0xd6, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00,
80 },
81 )
82 // genesisMerkleRoot is the hash of the first transaction in the genesis block
83 // for the main network.
84 genesisMerkleRoot = chainhash.Hash(
85 [chainhash.HashSize]byte{
86 // Make go vet happy.
87 0x3b, 0xa3, 0xed, 0xfd, 0x7a, 0x7b, 0x12, 0xb2,
88 0x7a, 0xc7, 0x2c, 0x3e, 0x67, 0x76, 0x8f, 0x61,
89 0x7f, 0xc8, 0x1b, 0xc3, 0x88, 0x8a, 0x51, 0x32,
90 0x3a, 0x9f, 0xb8, 0xaa, 0x4b, 0x1e, 0x5e, 0x4a,
91 },
92 )
93 // genesisBlock defines
94 // genesisBlock defines the genesis block of the block chain which serves as the
95 // public transaction ledger for the main network.
96 genesisBlock = wire.MsgBlock{
97 Header: wire.BlockHeader{
98 Version: 1,
99 PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000
100 MerkleRoot: genesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b
101 Timestamp: time.Unix(
102 0x495fab29,
103 0,
104 ), // 2009-01-03 18:15:05 +0000 UTC
105 Bits: 0x1d00ffff, // 486604799 [00000000ffff0000000000000000000000000000000000000000000000000000]
106 Nonce: 0x7c2bac1d, // 2083236893
107 },
108 Transactions: []*wire.MsgTx{&genesisCoinbaseTx},
109 }
110 )
111