6 "github.com/bytom/protocol/bc"
11 // define the Max transaction size and Max block size
12 MaxTxSize = uint64(1024)
13 MaxBlockSzie = uint64(16384)
15 //config parameter for coinbase reward
16 CoinbasePendingBlockNumber = uint64(6)
17 subsidyReductionInterval = uint64(560640)
18 baseSubsidy = uint64(624000000000)
19 initialBlockSubsidy = uint64(1470000000000000000)
21 // config for pow mining
22 powMinBits = uint64(2161727821138738707)
23 BlocksPerRetarget = uint64(1024)
24 targetSecondsPerBlock = uint64(60)
27 // BTMAssetID is BTM's asset id, the soul asset of Bytom
28 var BTMAssetID = &bc.AssetID{
29 V0: uint64(18446744073709551615),
30 V1: uint64(18446744073709551615),
31 V2: uint64(18446744073709551615),
32 V3: uint64(18446744073709551615),
35 // BlockSubsidy calculate the coinbase rewards on given block height
36 func BlockSubsidy(height uint64) uint64 {
38 return initialBlockSubsidy
40 return baseSubsidy >> uint(height/subsidyReductionInterval)
43 // IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
44 // addresses on any default or registered network. This is used when decoding
45 // an address string into a specific address type.
46 func IsBech32SegwitPrefix(prefix string, params *Params) bool {
47 prefix = strings.ToLower(prefix)
48 return prefix == params.Bech32HRPSegwit+"1"
51 // Params store the config for different network
53 // Name defines a human-readable identifier for the network.
55 Bech32HRPSegwit string
58 // MainNetParams is the config for production
59 var MainNetParams = Params{
61 Bech32HRPSegwit: "bm",
64 // TestNetParams is the config for test-net
65 var TestNetParams = Params{
67 Bech32HRPSegwit: "tm",