github.com/mit-dci/lit@v0.0.0-20221102210550-8c3d3b49f2ce/coinparam/bc2.go (about) 1 package coinparam 2 3 import ( 4 "time" 5 6 "github.com/mit-dci/lit/btcutil/chaincfg/chainhash" 7 "github.com/mit-dci/lit/wire" 8 ) 9 10 // BC2NetParams are the parameters for the BC2 test network. 11 var BC2NetParams = Params{ 12 Name: "bc2", 13 NetMagicBytes: 0xcaa5afea, 14 DefaultPort: "8444", 15 DNSSeeds: []string{}, 16 17 // Chain parameters 18 GenesisBlock: &bc2GenesisBlock, 19 GenesisHash: &bc2GenesisHash, 20 PoWFunction: func(b []byte, height int32) chainhash.Hash { 21 return chainhash.DoubleHashH(b) 22 }, 23 DiffCalcFunction: diffBitcoin, 24 FeePerByte: 80, 25 PowLimit: bc2NetPowLimit, 26 PowLimitBits: 0x1d7fffff, 27 CoinbaseMaturity: 10, 28 SubsidyReductionInterval: 210000, 29 TargetTimespan: time.Hour * 1, // 1 hour 30 TargetTimePerBlock: time.Minute * 1, // 1 minute 31 RetargetAdjustmentFactor: 4, // 25% less, 400% more 32 ReduceMinDifficulty: false, 33 MinDiffReductionTime: time.Minute * 20, // TargetTimePerBlock * 2 34 GenerateSupported: false, 35 36 // Checkpoints ordered from oldest to newest. 37 Checkpoints: []Checkpoint{}, 38 39 // Enforce current block version once majority of the network has 40 // upgraded. 41 // 51% (51 / 100) 42 // Reject previous block versions once a majority of the network has 43 // upgraded. 44 // 75% (75 / 100) 45 BlockEnforceNumRequired: 51, 46 BlockRejectNumRequired: 75, 47 BlockUpgradeNumToCheck: 100, 48 49 // Mempool parameters 50 RelayNonStdTxs: true, 51 52 // Address encoding magics 53 PubKeyHashAddrID: 0x19, // starts with B 54 ScriptHashAddrID: 0x1c, // starts with ? 55 Bech32Prefix: "bc2", 56 PrivateKeyID: 0xef, // starts with 9 7(uncompressed) or c (compressed) 57 58 // BIP32 hierarchical deterministic extended key magics 59 HDPrivateKeyID: [4]byte{0x04, 0x35, 0x83, 0x94}, // starts with tprv 60 HDPublicKeyID: [4]byte{0x04, 0x35, 0x87, 0xcf}, // starts with tpub 61 62 // BIP44 coin type used in the hierarchical deterministic path for 63 // address generation. 64 HDCoinType: 2, 65 66 TestCoin: true, 67 } 68 69 // bc2GenesisHash is the hash of the first block in the block chain for the 70 // test network (version 3). 71 var bc2GenesisHash = chainhash.Hash([chainhash.HashSize]byte{ // Make go vet happy. 72 0x71, 0xed, 0xa3, 0xc2, 0xe3, 0x36, 0x73, 0x3d, 0x45, 0x03, 0x88, 0x90, 73 0xd8, 0xae, 0x54, 0x11, 0x87, 0x92, 0x1c, 0x49, 0xb8, 0x7f, 0x41, 0xd6, 74 0x99, 0xf6, 0xf3, 0xae, 0x0a, 0x00, 0x00, 0x00, 75 }) 76 77 // bc2GenesisMerkleRoot is the same on bc2 78 var bc2GenesisMerkleRoot = genesisMerkleRoot 79 80 // bc2GenesisBlock has a different time stamp and difficulty 81 var bc2GenesisBlock = wire.MsgBlock{ 82 Header: wire.BlockHeader{ 83 Version: 1, 84 PrevBlock: chainhash.Hash{}, // 0000000000000000000000000000000000000000000000000000000000000000 85 MerkleRoot: bc2GenesisMerkleRoot, // 4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b 86 Timestamp: time.Unix(1483467305, 0), // later 87 Bits: 0x1d7fffff, // 486604799 [00000000ffff0000000000000000000000000000000000000000000000000000] 88 Nonce: 0x334188d, // 53745805 89 }, 90 Transactions: []*wire.MsgTx{&genesisCoinbaseTx}, 91 }