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