2018-07-04 14:44:26 +00:00
|
|
|
syntax = "proto2";
|
2018-07-29 14:17:00 +00:00
|
|
|
package hw.trezor.messages.ethereum;
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
// Sugar for easier handling in Java
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
option java_outer_classname = "TrezorMessageEthereum";
|
|
|
|
|
2018-11-16 13:14:18 +00:00
|
|
|
import "messages-common.proto";
|
|
|
|
|
|
|
|
|
2018-11-16 13:12:52 +00:00
|
|
|
/**
|
|
|
|
* Request: Ask device for public key corresponding to address_n path
|
|
|
|
* @start
|
|
|
|
* @next EthereumPublicKey
|
|
|
|
* @next Failure
|
|
|
|
*/
|
|
|
|
message EthereumGetPublicKey {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Contains public key derived from device private seed
|
|
|
|
* @end
|
|
|
|
*/
|
|
|
|
message EthereumPublicKey {
|
2021-01-14 11:05:03 +00:00
|
|
|
required hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node
|
|
|
|
required string xpub = 2; // serialized form of public node
|
2018-11-16 13:12:52 +00:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:44:26 +00:00
|
|
|
/**
|
|
|
|
* Request: Ask device for Ethereum address corresponding to address_n path
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next EthereumAddress
|
|
|
|
* @next Failure
|
|
|
|
*/
|
|
|
|
message EthereumGetAddress {
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Contains an Ethereum address derived from device private seed
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message EthereumAddress {
|
2020-06-30 07:43:01 +00:00
|
|
|
optional bytes _old_address = 1 [deprecated=true]; // trezor <1.8.0, <2.1.0 - raw bytes of Ethereum address
|
2019-05-07 16:23:18 +00:00
|
|
|
optional string address = 2; // Ethereum address as hex-encoded string
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device to sign transaction
|
2021-08-31 09:36:13 +00:00
|
|
|
* gas_price, gas_limit and chain_id must be provided and non-zero.
|
|
|
|
* All other fields are optional and default to value `0` if missing.
|
2018-07-04 14:44:26 +00:00
|
|
|
* Note: the first at most 1024 bytes of data MUST be transmitted as part of this message.
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next EthereumTxRequest
|
|
|
|
* @next Failure
|
|
|
|
*/
|
|
|
|
message EthereumSignTx {
|
2021-08-31 09:36:13 +00:00
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
optional bytes nonce = 2 [default='']; // <=256 bit unsigned big endian
|
|
|
|
required bytes gas_price = 3; // <=256 bit unsigned big endian (in wei)
|
|
|
|
required bytes gas_limit = 4; // <=256 bit unsigned big endian
|
|
|
|
optional string to = 11 [default='']; // recipient address
|
|
|
|
optional bytes value = 6 [default='']; // <=256 bit unsigned big endian (in wei)
|
|
|
|
optional bytes data_initial_chunk = 7 [default='']; // The initial data chunk (<= 1024 bytes)
|
|
|
|
optional uint32 data_length = 8 [default=0]; // Length of transaction payload
|
|
|
|
required uint64 chain_id = 9; // Chain Id for EIP 155
|
|
|
|
optional uint32 tx_type = 10; // Used for Wanchain
|
2021-06-05 00:15:25 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device to sign EIP1559 transaction
|
|
|
|
* Note: the first at most 1024 bytes of data MUST be transmitted as part of this message.
|
|
|
|
* @start
|
|
|
|
* @next EthereumTxRequest
|
|
|
|
* @next Failure
|
|
|
|
*/
|
|
|
|
message EthereumSignTxEIP1559 {
|
2021-08-31 09:29:30 +00:00
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
required bytes nonce = 2; // <=256 bit unsigned big endian
|
|
|
|
required bytes max_gas_fee = 3; // <=256 bit unsigned big endian (in wei)
|
|
|
|
required bytes max_priority_fee = 4; // <=256 bit unsigned big endian (in wei)
|
|
|
|
required bytes gas_limit = 5; // <=256 bit unsigned big endian
|
|
|
|
optional string to = 6 [default='']; // recipient address
|
|
|
|
required bytes value = 7; // <=256 bit unsigned big endian (in wei)
|
2021-06-05 00:15:25 +00:00
|
|
|
optional bytes data_initial_chunk = 8 [default='']; // The initial data chunk (<= 1024 bytes)
|
2021-08-31 09:29:30 +00:00
|
|
|
required uint32 data_length = 9; // Length of transaction payload
|
|
|
|
required uint64 chain_id = 10; // Chain Id for EIP 155
|
|
|
|
repeated EthereumAccessList access_list = 11; // Access List
|
2021-06-05 00:15:25 +00:00
|
|
|
|
|
|
|
message EthereumAccessList {
|
|
|
|
required string address = 1;
|
|
|
|
repeated bytes storage_keys = 2;
|
|
|
|
}
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Device asks for more data from transaction payload, or returns the signature.
|
|
|
|
* If data_length is set, device awaits that many more bytes of payload.
|
|
|
|
* Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present.
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next EthereumTxAck
|
|
|
|
*/
|
|
|
|
message EthereumTxRequest {
|
|
|
|
optional uint32 data_length = 1; // Number of bytes being requested (<= 1024)
|
|
|
|
optional uint32 signature_v = 2; // Computed signature (recovery parameter, limited to 27 or 28)
|
|
|
|
optional bytes signature_r = 3; // Computed signature R component (256 bit)
|
|
|
|
optional bytes signature_s = 4; // Computed signature S component (256 bit)
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Transaction payload data.
|
|
|
|
* @next EthereumTxRequest
|
|
|
|
*/
|
|
|
|
message EthereumTxAck {
|
2021-08-31 09:36:13 +00:00
|
|
|
required bytes data_chunk = 1; // Bytes from transaction payload (<= 1024 bytes)
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device to sign message
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next EthereumMessageSignature
|
|
|
|
* @next Failure
|
|
|
|
*/
|
|
|
|
message EthereumSignMessage {
|
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
2021-08-31 09:36:13 +00:00
|
|
|
required bytes message = 2; // message to be signed
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
2018-07-16 14:51:03 +00:00
|
|
|
/**
|
|
|
|
* Response: Signed message
|
|
|
|
* @end
|
|
|
|
*/
|
|
|
|
message EthereumMessageSignature {
|
2021-01-14 11:05:03 +00:00
|
|
|
required bytes signature = 2; // signature of the message
|
|
|
|
required string address = 3; // address used to sign the message
|
2018-07-16 14:51:03 +00:00
|
|
|
}
|
|
|
|
|
2018-07-04 14:44:26 +00:00
|
|
|
/**
|
|
|
|
* Request: Ask device to verify message
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next Success
|
|
|
|
* @next Failure
|
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message EthereumVerifyMessage {
|
2021-08-31 09:36:13 +00:00
|
|
|
required bytes signature = 2; // signature to verify
|
|
|
|
required bytes message = 3; // message to verify
|
|
|
|
required string address = 4; // address to verify
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|