forked from trezor/trezor-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmessages-tezos.proto
174 lines (162 loc) · 5.76 KB
/
messages-tezos.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
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
syntax = "proto2";
package hw.trezor.messages.tezos;
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageTezos";
/**
* Request: Ask device for Tezos address corresponding to address_n path
* @start
* @next TezosAddress
* @next Failure
*/
message TezosGetAddress {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // optionally show on display before sending the result
optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
* Response: Contains Tezos address derived from device private seed
* @end
*/
message TezosAddress {
required string address = 1; // Coin address in Base58 encoding
}
/**
* Request: Ask device for Tezos public key corresponding to address_n path
* @start
* @next TezosPublicKey
*/
message TezosGetPublicKey {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bool show_display = 2; // Optionally show on display before sending the result
optional bool chunkify = 3; // display the public key in chunks of 4 characters
}
/**
* Response: Contains Tezos public key derived from device private seed
* @end
*/
message TezosPublicKey {
required string public_key = 1; // b58 encoded Tezos public key with prefix
}
/**
* Request: Ask device to sign Tezos transaction
* @start
* @next TezosSignedTx
*/
message TezosSignTx {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
required bytes branch = 2;
optional TezosRevealOp reveal = 3; // Tezos reveal operation (may be bundled with other op)
optional TezosTransactionOp transaction = 4; // Tezos transaction operation
optional TezosOriginationOp origination = 5; // Tezos origination operation
optional TezosDelegationOp delegation = 6; // Tezos delegation operation
optional TezosProposalOp proposal = 7; // Tezos proposal operation
optional TezosBallotOp ballot = 8; // Tezos ballot operation
optional bool chunkify = 9; // display the address in chunks of 4 characters
/*
* Tezos contract ID
*/
message TezosContractID {
required TezosContractType tag = 1;
required bytes hash = 2; // Implicit = 21B, originated = 20B + 1B padding
/*
* Type of Tezos Contract type
*/
enum TezosContractType {
Implicit = 0;
Originated = 1;
}
}
/**
* Structure representing information for reveal
*/
message TezosRevealOp {
required bytes source = 7;
required uint64 fee = 2;
required uint64 counter = 3;
required uint64 gas_limit = 4;
required uint64 storage_limit = 5;
required bytes public_key = 6;
}
/**
* Structure representing information for transaction
*/
message TezosTransactionOp {
required bytes source = 9;
required uint64 fee = 2;
required uint64 counter = 3;
required uint64 gas_limit = 4;
required uint64 storage_limit = 5;
required uint64 amount = 6;
required TezosContractID destination = 7;
optional bytes parameters = 8;
optional TezosParametersManager parameters_manager = 10;
message TezosParametersManager {
optional bytes set_delegate = 1;
optional bool cancel_delegate = 2;
optional TezosManagerTransfer transfer = 3;
message TezosManagerTransfer {
required TezosContractID destination = 1;
required uint64 amount = 2;
}
}
}
/**
* Structure representing information for origination
*/
message TezosOriginationOp {
required bytes source = 12;
required uint64 fee = 2;
required uint64 counter = 3;
required uint64 gas_limit = 4;
required uint64 storage_limit = 5;
optional bytes manager_pubkey = 6;
required uint64 balance = 7;
optional bool spendable = 8;
optional bool delegatable = 9;
optional bytes delegate = 10;
required bytes script = 11;
}
/**
* Structure representing information for delegation
*/
message TezosDelegationOp {
required bytes source = 7;
required uint64 fee = 2;
required uint64 counter = 3;
required uint64 gas_limit = 4;
required uint64 storage_limit = 5;
required bytes delegate = 6;
}
/**
* Structure representing information for proposal
*/
message TezosProposalOp {
required bytes source = 1; //Contains only public_key_hash, not to be confused with TezosContractID
required uint64 period = 2;
repeated bytes proposals = 4;
}
/**
* Structure representing information for ballot
*/
message TezosBallotOp {
required bytes source = 1; //Contains only public_key_hash, not to be confused with TezosContractID
required uint64 period = 2;
required bytes proposal = 3;
required TezosBallotType ballot = 4;
enum TezosBallotType {
Yay = 0;
Nay = 1;
Pass = 2;
}
}
}
/**
* Response: Contains Tezos transaction signature
* @end
*/
message TezosSignedTx {
required string signature = 1; // Tezos b58 encoded transaction signature with prefix
required bytes sig_op_contents = 2; // operation_bytes + signed operation_bytes
required string operation_hash = 3; // b58 encoded hashed operation contents with prefix
}