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 PayToWitnessPubKeyHashDataSize = 20
27 PayToWitnessScriptHashDataSize = 32
29 CoinbaseArbitrarySizeLimit = 128
32 // BTMAssetID is BTM's asset id, the soul asset of Bytom
33 var BTMAssetID = &bc.AssetID{
34 V0: uint64(18446744073709551615),
35 V1: uint64(18446744073709551615),
36 V2: uint64(18446744073709551615),
37 V3: uint64(18446744073709551615),
40 //BTMAlias is default btm
50 var BTMDescription = `Bytom Official Issue`
53 var BTMDefinitionMap = map[string]interface{}{
56 "decimals": BTMDecimals,
57 "description": BTMDescription,
60 // BlockSubsidy calculate the coinbase rewards on given block height
61 func BlockSubsidy(height uint64) uint64 {
63 return InitialBlockSubsidy
65 return baseSubsidy >> uint(height/subsidyReductionInterval)
68 // IsBech32SegwitPrefix returns whether the prefix is a known prefix for segwit
69 // addresses on any default or registered network. This is used when decoding
70 // an address string into a specific address type.
71 func IsBech32SegwitPrefix(prefix string, params *Params) bool {
72 prefix = strings.ToLower(prefix)
73 return prefix == params.Bech32HRPSegwit+"1"
76 // Params store the config for different network
78 // Name defines a human-readable identifier for the network.
80 Bech32HRPSegwit string
83 // MainNetParams is the config for production
84 var MainNetParams = Params{
86 Bech32HRPSegwit: "bm",
89 // TestNetParams is the config for test-net
90 var TestNetParams = Params{
92 Bech32HRPSegwit: "tm",