forked from mrcryptooo/btc-staker
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathtransaction.proto
70 lines (62 loc) · 2.3 KB
/
transaction.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
syntax = "proto3";
package proto;
option go_package = "github.com/babylonchain/btc-staker/proto";
enum TransactionState {
SENT_TO_BTC = 0;
CONFIRMED_ON_BTC = 1;
SENT_TO_BABYLON = 2;
DELEGATION_ACTIVE = 3;
UNBONDING_CONFIRMED_ON_BTC = 4;
SPENT_ON_BTC = 5;
}
message WatchedTxData {
bytes slashing_transaction = 1;
bytes slashing_transaction_sig = 2;
bytes staker_babylon_pk = 3;
bytes staker_btc_pk = 4;
// TODO: Consider improving data model as currently for watched transactions
// unbonding_transaction and unbonding_time are duplicated with UnbondingTxData
// which is stored in TrackedTransaction
bytes unbonding_transaction = 5;
bytes slashing_unbonding_transaction = 6;
bytes slashing_unbonding_transaction_sig = 7;
uint32 unbonding_time = 8;
}
// Contains information about btc confirmation
message BTCConfirmationInfo {
uint32 block_height = 1;
bytes block_hash = 2;
}
message CovenantSig {
bytes covenant_sig = 1;
bytes covenant_sig_btc_pk = 2;
}
message UnbondingTxData {
bytes unbonding_transaction = 1;
uint32 unbonding_time = 2;
repeated CovenantSig covenant_signatures = 3;
// this data is only filed if tracked transactions state is >= UNBONDING_CONFIRMED_ON_BTC,
// and it is filled as last piece of information in unbonding process
BTCConfirmationInfo unbonding_tx_btc_confirmation_info = 4;
}
message TrackedTransaction {
// index of tracked transaction in database, first tracked transaction has index 1
uint64 tracked_transaction_idx = 1;
bytes staking_transaction = 2;
uint32 staking_output_idx = 3;
// address to retrive private key from connected wallet
string staker_address = 4;
// time lock on staking transaction
uint32 staking_time = 5;
// Public keys of finality providers to which we delegated
repeated bytes finality_providers_btc_pks = 6;
// this data is only filed if tracked transactions state is >= CONFIRMED_ON_BTC
BTCConfirmationInfo staking_tx_btc_confirmation_info = 7;
uint32 btc_sig_type = 8;
bytes babylon_sig_btc_pk = 9;
bytes btc_sig_babylon_sig = 10;
TransactionState state = 11;
bool watched = 12;
// this data is only filled if tracked transactions state is >= SENT_TO_BABYLON
UnbondingTxData unbonding_tx_data = 13;
}