-
Notifications
You must be signed in to change notification settings - Fork 42
/
Copy pathparams.proto
89 lines (82 loc) · 3.93 KB
/
params.proto
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
syntax = "proto3";
package babylon.btcstaking.v1;
import "gogoproto/gogo.proto";
import "cosmos_proto/cosmos.proto";
option go_package = "github.com/babylonlabs-io/babylon/x/btcstaking/types";
// Params defines the parameters for the module.
message Params {
option (gogoproto.goproto_stringer) = false;
// PARAMETERS COVERING STAKING
// covenant_pks is the list of public keys held by the covenant committee
// each PK follows encoding in BIP-340 spec on Bitcoin
repeated bytes covenant_pks = 1 [ (gogoproto.customtype) = "github.com/babylonlabs-io/babylon/types.BIP340PubKey" ];
// covenant_quorum is the minimum number of signatures needed for the covenant
// multisignature
uint32 covenant_quorum = 2;
// min_staking_value_sat is the minimum of satoshis locked in staking output
int64 min_staking_value_sat = 3;
// max_staking_value_sat is the maximum of satoshis locked in staking output
int64 max_staking_value_sat = 4;
// min_staking_time is the minimum lock time specified in staking output script
uint32 min_staking_time_blocks = 5;
// max_staking_time_blocks is the maximum lock time time specified in staking output script
uint32 max_staking_time_blocks = 6;
// PARAMETERS COVERING SLASHING
// slashing_pk_script is the pk_script expected in slashing output ie. the first
// output of slashing transaction
bytes slashing_pk_script = 7;
// min_slashing_tx_fee_sat is the minimum amount of tx fee (quantified
// in Satoshi) needed for the pre-signed slashing tx. It covers both:
// staking slashing transaction and unbonding slashing transaction
int64 min_slashing_tx_fee_sat = 8;
// slashing_rate determines the portion of the staked amount to be slashed,
// expressed as a decimal (e.g., 0.5 for 50%). Maximal precion is 2 decimal
// places
string slashing_rate = 9 [
(cosmos_proto.scalar) = "cosmos.Dec",
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// PARAMETERS COVERING UNBONDING
// unbonding_time is the exact unbonding time required from unbonding transaction
// it must be larger than `checkpoint_finalization_timeout` from `btccheckpoint` module
uint32 unbonding_time_blocks = 10;
// unbonding_fee exact fee required for unbonding transaction
int64 unbonding_fee_sat = 11;
// PARAMETERS COVERING FINALITY PROVIDERS
// min_commission_rate is the chain-wide minimum commission rate that a finality provider
// can charge their delegators expressed as a decimal (e.g., 0.5 for 50%). Maximal precion
// is 2 decimal places
string min_commission_rate = 12 [
(gogoproto.customtype) = "cosmossdk.io/math.LegacyDec",
(gogoproto.nullable) = false
];
// base gas fee for delegation creation
uint64 delegation_creation_base_gas_fee = 13;
// allow_list_expiration_height is the height at which the allow list expires
// i.e all staking transactions are allowed to enter Babylon chain afterwards
// setting it to 0 means allow list is disabled
uint64 allow_list_expiration_height = 14;
// btc_activation_height is the btc height from which parameters are activated (inclusive)
uint32 btc_activation_height = 15;
}
// HeightVersionPair pairs a btc height with a version of the parameters
message HeightVersionPair {
// start_height is the height from which the parameters are activated (inclusive)
uint64 start_height = 1;
// version is the version of the parameters
uint32 version = 2;
}
// HeightToVersionMap maps a btc height to a version of the parameters
message HeightToVersionMap {
// Pairs must be sorted by `start_height` in ascending order, without duplicates
repeated HeightVersionPair pairs = 1;
}
// StoredParams attach information about the version of stored parameters
message StoredParams {
// version of the stored parameters. Each parameters update
// increments version number by 1
uint32 version = 1;
// NOTE: Parameters must always be provided
Params params = 2 [(gogoproto.nullable) = false];
}