forked from trezor/trezor-firmware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
messages-common.proto
165 lines (151 loc) · 4.42 KB
/
messages-common.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
syntax = "proto2";
package hw.trezor.messages.common;
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageCommon";
option (include_in_bitcoin_only) = true;
import "messages.proto";
/**
* Response: Success of the previous request
* @end
*/
message Success {
optional string message = 1 [default=""]; // human readable description of action or request-specific payload
}
/**
* Response: Failure of the previous request
* @end
*/
message Failure {
optional FailureType code = 1; // computer-readable definition of the error state
optional string message = 2; // human-readable message of the error state
enum FailureType {
Failure_UnexpectedMessage = 1;
Failure_ButtonExpected = 2;
Failure_DataError = 3;
Failure_ActionCancelled = 4;
Failure_PinExpected = 5;
Failure_PinCancelled = 6;
Failure_PinInvalid = 7;
Failure_InvalidSignature = 8;
Failure_ProcessError = 9;
Failure_NotEnoughFunds = 10;
Failure_NotInitialized = 11;
Failure_PinMismatch = 12;
Failure_WipeCodeMismatch = 13;
Failure_InvalidSession = 14;
Failure_FirmwareError = 99;
}
}
/**
* Response: Device is waiting for HW button press.
* @auxstart
* @next ButtonAck
*/
message ButtonRequest {
optional ButtonRequestType code = 1; // enum identifier of the screen
optional uint32 pages = 2; // if the screen is paginated, number of pages
/**
* Type of button request
*/
enum ButtonRequestType {
ButtonRequest_Other = 1;
ButtonRequest_FeeOverThreshold = 2;
ButtonRequest_ConfirmOutput = 3;
ButtonRequest_ResetDevice = 4;
ButtonRequest_ConfirmWord = 5;
ButtonRequest_WipeDevice = 6;
ButtonRequest_ProtectCall = 7;
ButtonRequest_SignTx = 8;
ButtonRequest_FirmwareCheck = 9;
ButtonRequest_Address = 10;
ButtonRequest_PublicKey = 11;
ButtonRequest_MnemonicWordCount = 12;
ButtonRequest_MnemonicInput = 13;
_Deprecated_ButtonRequest_PassphraseType = 14 [deprecated=true];
ButtonRequest_UnknownDerivationPath = 15;
ButtonRequest_RecoveryHomepage = 16;
ButtonRequest_Success = 17;
ButtonRequest_Warning = 18;
ButtonRequest_PassphraseEntry = 19;
ButtonRequest_PinEntry = 20;
}
}
/**
* Request: Computer agrees to wait for HW button press
* @auxend
*/
message ButtonAck {
}
/**
* Response: Device is asking computer to show PIN matrix and awaits PIN encoded using this matrix scheme
* @auxstart
* @next PinMatrixAck
*/
message PinMatrixRequest {
optional PinMatrixRequestType type = 1;
/**
* Type of PIN request
*/
enum PinMatrixRequestType {
PinMatrixRequestType_Current = 1;
PinMatrixRequestType_NewFirst = 2;
PinMatrixRequestType_NewSecond = 3;
PinMatrixRequestType_WipeCodeFirst = 4;
PinMatrixRequestType_WipeCodeSecond = 5;
}
}
/**
* Request: Computer responds with encoded PIN
* @auxend
*/
message PinMatrixAck {
required string pin = 1; // matrix encoded PIN entered by user
}
/**
* Response: Device awaits encryption passphrase
* @auxstart
* @next PassphraseAck
*/
message PassphraseRequest {
optional bool _on_device = 1 [deprecated=true]; // <2.3.0
}
/**
* Request: Send passphrase back
* @auxend
*/
message PassphraseAck {
optional string passphrase = 1;
optional bytes _state = 2 [deprecated=true]; // <2.3.0
optional bool on_device = 3; // user wants to enter passphrase on the device
}
/**
* Response: Device awaits passphrase state
* Deprecated in 2.3.0
* @next Deprecated_PassphraseStateAck
*/
message Deprecated_PassphraseStateRequest {
option deprecated = true;
optional bytes state = 1; // actual device state
}
/**
* Request: Send passphrase state back
* Deprecated in 2.3.0
* @auxend
*/
message Deprecated_PassphraseStateAck {
option deprecated = true;
}
/**
* Structure representing BIP32 (hierarchical deterministic) node
* Used for imports of private key into the device and exporting public key out of device
* @embed
*/
message HDNodeType {
required uint32 depth = 1;
required uint32 fingerprint = 2;
required uint32 child_num = 3;
required bytes chain_code = 4;
optional bytes private_key = 5;
required bytes public_key = 6;
}