2018-07-16 13:00:18 +00:00
|
|
|
syntax = "proto2";
|
2018-07-29 14:17:00 +00:00
|
|
|
package hw.trezor.messages.common;
|
2018-07-16 13:00:18 +00:00
|
|
|
|
2019-05-13 12:29:38 +00:00
|
|
|
// Sugar for easier handling in Java
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
option java_outer_classname = "TrezorMessageCommon";
|
|
|
|
|
2021-09-27 22:42:28 +00:00
|
|
|
option (include_in_bitcoin_only) = true;
|
|
|
|
|
|
|
|
import "messages.proto";
|
|
|
|
|
2018-07-16 13:00:18 +00:00
|
|
|
/**
|
|
|
|
* Response: Success of the previous request
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-16 13:00:18 +00:00
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message Success {
|
2021-01-14 11:05:03 +00:00
|
|
|
optional string message = 1 [default=""]; // human readable description of action or request-specific payload
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Response: Failure of the previous request
|
|
|
|
* @end
|
|
|
|
*/
|
2018-07-16 13:00:18 +00:00
|
|
|
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;
|
2019-10-18 13:28:53 +00:00
|
|
|
Failure_WipeCodeMismatch = 13;
|
2020-08-28 08:45:01 +00:00
|
|
|
Failure_InvalidSession = 14;
|
2018-07-16 13:00:18 +00:00
|
|
|
Failure_FirmwareError = 99;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device is waiting for HW button press.
|
2018-07-16 14:51:03 +00:00
|
|
|
* @auxstart
|
2018-07-16 13:00:18 +00:00
|
|
|
* @next ButtonAck
|
|
|
|
*/
|
|
|
|
message ButtonRequest {
|
2024-07-04 14:00:36 +00:00
|
|
|
optional ButtonRequestType code = 1; // enum identifier of the screen (deprecated)
|
2021-06-17 11:57:03 +00:00
|
|
|
optional uint32 pages = 2; // if the screen is paginated, number of pages
|
2024-07-04 14:00:36 +00:00
|
|
|
|
|
|
|
// this existed briefly: https://github.com/trezor/trezor-firmware/commit/1012ee8497b241e8ca559e386d936fa549bc0357
|
|
|
|
reserved 3;
|
|
|
|
|
|
|
|
optional string name = 4; // name of the screen
|
|
|
|
|
2018-07-16 13:00:18 +00:00
|
|
|
/**
|
|
|
|
* 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;
|
2020-02-19 20:33:42 +00:00
|
|
|
_Deprecated_ButtonRequest_PassphraseType = 14 [deprecated=true];
|
2018-09-04 11:52:03 +00:00
|
|
|
ButtonRequest_UnknownDerivationPath = 15;
|
2019-07-11 14:52:25 +00:00
|
|
|
ButtonRequest_RecoveryHomepage = 16;
|
|
|
|
ButtonRequest_Success = 17;
|
|
|
|
ButtonRequest_Warning = 18;
|
2019-12-11 15:19:38 +00:00
|
|
|
ButtonRequest_PassphraseEntry = 19;
|
2020-05-25 13:23:23 +00:00
|
|
|
ButtonRequest_PinEntry = 20;
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Computer agrees to wait for HW button press
|
2018-07-16 14:51:03 +00:00
|
|
|
* @auxend
|
2018-07-16 13:00:18 +00:00
|
|
|
*/
|
|
|
|
message ButtonAck {
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device is asking computer to show PIN matrix and awaits PIN encoded using this matrix scheme
|
2018-07-16 14:51:03 +00:00
|
|
|
* @auxstart
|
2018-07-16 13:00:18 +00:00
|
|
|
* @next PinMatrixAck
|
|
|
|
*/
|
|
|
|
message PinMatrixRequest {
|
|
|
|
optional PinMatrixRequestType type = 1;
|
|
|
|
/**
|
|
|
|
* Type of PIN request
|
|
|
|
*/
|
|
|
|
enum PinMatrixRequestType {
|
|
|
|
PinMatrixRequestType_Current = 1;
|
|
|
|
PinMatrixRequestType_NewFirst = 2;
|
|
|
|
PinMatrixRequestType_NewSecond = 3;
|
2019-10-18 13:28:53 +00:00
|
|
|
PinMatrixRequestType_WipeCodeFirst = 4;
|
|
|
|
PinMatrixRequestType_WipeCodeSecond = 5;
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Computer responds with encoded PIN
|
2018-07-16 14:51:03 +00:00
|
|
|
* @auxend
|
2018-07-16 13:00:18 +00:00
|
|
|
*/
|
|
|
|
message PinMatrixAck {
|
|
|
|
required string pin = 1; // matrix encoded PIN entered by user
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device awaits encryption passphrase
|
2018-07-16 14:51:03 +00:00
|
|
|
* @auxstart
|
2018-07-16 13:00:18 +00:00
|
|
|
* @next PassphraseAck
|
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message PassphraseRequest {
|
2020-02-10 11:33:36 +00:00
|
|
|
optional bool _on_device = 1 [deprecated=true]; // <2.3.0
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Send passphrase back
|
2019-11-08 08:43:32 +00:00
|
|
|
* @auxend
|
2018-07-16 13:00:18 +00:00
|
|
|
*/
|
2020-02-10 11:36:05 +00:00
|
|
|
message PassphraseAck {
|
2018-07-16 13:00:18 +00:00
|
|
|
optional string passphrase = 1;
|
2020-02-20 11:10:03 +00:00
|
|
|
optional bytes _state = 2 [deprecated=true]; // <2.3.0
|
2020-02-07 14:17:09 +00:00
|
|
|
optional bool on_device = 3; // user wants to enter passphrase on the device
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|
|
|
|
|
2020-02-10 11:33:36 +00:00
|
|
|
/**
|
|
|
|
* Response: Device awaits passphrase state
|
|
|
|
* Deprecated in 2.3.0
|
|
|
|
* @next Deprecated_PassphraseStateAck
|
|
|
|
*/
|
|
|
|
message Deprecated_PassphraseStateRequest {
|
2020-02-10 14:36:58 +00:00
|
|
|
option deprecated = true;
|
2020-02-10 11:33:36 +00:00
|
|
|
optional bytes state = 1; // actual device state
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2020-02-10 11:36:05 +00:00
|
|
|
* Request: Send passphrase state back
|
|
|
|
* Deprecated in 2.3.0
|
2020-02-10 11:33:36 +00:00
|
|
|
* @auxend
|
|
|
|
*/
|
|
|
|
message Deprecated_PassphraseStateAck {
|
2020-02-10 14:36:58 +00:00
|
|
|
option deprecated = true;
|
2020-02-10 11:33:36 +00:00
|
|
|
}
|
|
|
|
|
2018-07-16 13:00:18 +00:00
|
|
|
/**
|
|
|
|
* Structure representing BIP32 (hierarchical deterministic) node
|
|
|
|
* Used for imports of private key into the device and exporting public key out of device
|
2018-07-16 14:51:03 +00:00
|
|
|
* @embed
|
2018-07-16 13:00:18 +00:00
|
|
|
*/
|
|
|
|
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;
|
2020-09-14 11:31:10 +00:00
|
|
|
required bytes public_key = 6;
|
2018-07-16 13:00:18 +00:00
|
|
|
}
|