github.com/ethereum/go-ethereum@v1.16.1/accounts/usbwallet/trezor/messages-ethereum.proto (about)

     1  // This file originates from the SatoshiLabs Trezor `common` repository at:
     2  //   https://github.com/trezor/trezor-common/blob/master/protob/messages-ethereum.proto
     3  // dated 28.05.2019, commit 893fd219d4a01bcffa0cd9cfa631856371ec5aa9.
     4  
     5  syntax = "proto2";
     6  package hw.trezor.messages.ethereum;
     7  
     8  option go_package  = "github.com/ethereum/go-ethereum/accounts/usbwallet/trezor";
     9  
    10  // Sugar for easier handling in Java
    11  option java_package = "com.satoshilabs.trezor.lib.protobuf";
    12  option java_outer_classname = "TrezorMessageEthereum";
    13  
    14  import "messages-common.proto";
    15  
    16  
    17  /**
    18   * Request: Ask device for public key corresponding to address_n path
    19   * @start
    20   * @next EthereumPublicKey
    21   * @next Failure
    22   */
    23  message EthereumGetPublicKey {
    24      repeated uint32 address_n = 1;                                      // BIP-32 path to derive the key from master node
    25      optional bool show_display = 2;                                     // optionally show on display before sending the result
    26  }
    27  
    28  /**
    29   * Response: Contains public key derived from device private seed
    30   * @end
    31   */
    32  message EthereumPublicKey {
    33      optional hw.trezor.messages.common.HDNodeType node = 1;        // BIP32 public node
    34      optional string xpub = 2;        // serialized form of public node
    35  }
    36  
    37  /**
    38   * Request: Ask device for Ethereum address corresponding to address_n path
    39   * @start
    40   * @next EthereumAddress
    41   * @next Failure
    42   */
    43  message EthereumGetAddress {
    44      repeated uint32 address_n = 1;  // BIP-32 path to derive the key from master node
    45      optional bool show_display = 2; // optionally show on display before sending the result
    46  }
    47  
    48  /**
    49   * Response: Contains an Ethereum address derived from device private seed
    50   * @end
    51   */
    52  message EthereumAddress {
    53      optional bytes  addressBin = 1;    // Ethereum address as 20 bytes (legacy firmwares)
    54      optional string addressHex = 2;    // Ethereum address as hex string (newer firmwares)
    55  }
    56  
    57  /**
    58   * Request: Ask device to sign transaction
    59   * All fields are optional from the protocol's point of view. Each field defaults to value `0` if missing.
    60   * Note: the first at most 1024 bytes of data MUST be transmitted as part of this message.
    61   * @start
    62   * @next EthereumTxRequest
    63   * @next Failure
    64   */
    65  message EthereumSignTx {
    66      repeated uint32 address_n = 1;          // BIP-32 path to derive the key from master node
    67      optional bytes nonce = 2;               // <=256 bit unsigned big endian
    68      optional bytes gas_price = 3;           // <=256 bit unsigned big endian (in wei)
    69      optional bytes gas_limit = 4;           // <=256 bit unsigned big endian
    70      optional bytes toBin = 5;               // recipient address (20 bytes, legacy firmware)
    71      optional string toHex = 11;             // recipient address (hex string, newer firmware)
    72      optional bytes value = 6;               // <=256 bit unsigned big endian (in wei)
    73      optional bytes data_initial_chunk = 7;  // The initial data chunk (<= 1024 bytes)
    74      optional uint32 data_length = 8;        // Length of transaction payload
    75      optional uint32 chain_id = 9;           // Chain Id for EIP 155
    76      optional uint32 tx_type = 10;           // (only for Wanchain)
    77  }
    78  
    79  /**
    80   * Response: Device asks for more data from transaction payload, or returns the signature.
    81   * If data_length is set, device awaits that many more bytes of payload.
    82   * Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present.
    83   * @end
    84   * @next EthereumTxAck
    85   */
    86  message EthereumTxRequest {
    87      optional uint32 data_length = 1;    // Number of bytes being requested (<= 1024)
    88      optional uint32 signature_v = 2;    // Computed signature (recovery parameter, limited to 27 or 28)
    89      optional bytes signature_r = 3;     // Computed signature R component (256 bit)
    90      optional bytes signature_s = 4;     // Computed signature S component (256 bit)
    91  }
    92  
    93  /**
    94   * Request: Transaction payload data.
    95   * @next EthereumTxRequest
    96   */
    97  message EthereumTxAck {
    98      optional bytes data_chunk = 1;  // Bytes from transaction payload (<= 1024 bytes)
    99  }
   100  
   101  /**
   102   * Request: Ask device to sign message
   103   * @start
   104   * @next EthereumMessageSignature
   105   * @next Failure
   106   */
   107  message EthereumSignMessage {
   108      repeated uint32 address_n = 1;  // BIP-32 path to derive the key from master node
   109      optional bytes message = 2;     // message to be signed
   110  }
   111  
   112  /**
   113   * Response: Signed message
   114   * @end
   115   */
   116  message EthereumMessageSignature {
   117      optional bytes addressBin = 1;     // address used to sign the message (20 bytes, legacy firmware)
   118      optional bytes signature = 2;      // signature of the message
   119      optional string addressHex = 3;    // address used to sign the message (hex string, newer firmware)
   120  }
   121  
   122  /**
   123   * Request: Ask device to verify message
   124   * @start
   125   * @next Success
   126   * @next Failure
   127   */
   128  message EthereumVerifyMessage {
   129      optional bytes addressBin = 1;  // address to verify (20 bytes, legacy firmware)
   130      optional bytes signature = 2;   // signature to verify
   131      optional bytes message = 3;     // message to verify
   132      optional string addressHex = 4; // address to verify (hex string, newer firmware)
   133  }