6 "github.com/bytom/protocol/bc"
11 // define the Max transaction size and Max block size
12 MaxTxSize = uint64(1048576)
13 MaxBlockSzie = uint64(10485760)
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)
26 // MaxTimeOffsetSeconds is the maximum number of seconds a block time is allowed to be ahead of the current time
27 MaxTimeOffsetSeconds = uint64(60 * 60)
29 PayToWitnessPubKeyHashDataSize = 20
30 PayToWitnessScriptHashDataSize = 32
32 CoinbaseArbitrarySizeLimit = 128
35 // BTMAssetID is BTM's asset id, the soul asset of Bytom
36 var BTMAssetID = &bc.AssetID{
37 V0: uint64(18446744073709551615),
38 V1: uint64(18446744073709551615),
39 V2: uint64(18446744073709551615),
40 V3: uint64(18446744073709551615),
43 //BTMAlias is default btm
53 var BTMDescription = `Bytom Official Issue`
56 var BTMDefinitionMap = map[string]interface{}{
59 "decimals": BTMDecimals,
60 "description": BTMDescription,
63 // BlockSubsidy calculate the coinbase rewards on given block height
64 func BlockSubsidy(height uint64) uint64 {
66 return InitialBlockSubsidy
68 return baseSubsidy >> uint(height/subsidyReductionInterval)
71 // IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
72 // addresses on any default or registered network. This is used when decoding
73 // an address string into a specific address type.
74 func IsBech32SegwitPrefix(prefix string, params *Params) bool {
75 prefix = strings.ToLower(prefix)
76 return prefix == params.Bech32HRPSegwit+"1"
79 // Params store the config for different network
81 // Name defines a human-readable identifier for the network.
83 Bech32HRPSegwit string
86 // MainNetParams is the config for production
87 var MainNetParams = Params{
89 Bech32HRPSegwit: "bm",
92 // TestNetParams is the config for test-net
93 var TestNetParams = Params{
95 Bech32HRPSegwit: "tm",