github.com/zhiqiangxu/go-ethereum@v1.9.16-0.20210824055606-be91cfdebc48/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 gas_price = 3; // <=256 bit unsigned big endian (in wei) 67 optional bytes gas_limit = 4; // <=256 bit unsigned big endian 68 optional bytes toBin = 5; // recipient address (20 bytes, legacy firmware) 69 optional string toHex = 11; // recipient address (hex string, newer firmware) 70 optional bytes value = 6; // <=256 bit unsigned big endian (in wei) 71 optional bytes data_initial_chunk = 7; // The initial data chunk (<= 1024 bytes) 72 optional uint32 data_length = 8; // Length of transaction payload 73 optional uint32 chain_id = 9; // Chain Id for EIP 155 74 optional uint32 tx_type = 10; // (only for Wanchain) 75 } 76 77 /** 78 * Response: Device asks for more data from transaction payload, or returns the signature. 79 * If data_length is set, device awaits that many more bytes of payload. 80 * Otherwise, the signature_* fields contain the computed transaction signature. All three fields will be present. 81 * @end 82 * @next EthereumTxAck 83 */ 84 message EthereumTxRequest { 85 optional uint32 data_length = 1; // Number of bytes being requested (<= 1024) 86 optional uint32 signature_v = 2; // Computed signature (recovery parameter, limited to 27 or 28) 87 optional bytes signature_r = 3; // Computed signature R component (256 bit) 88 optional bytes signature_s = 4; // Computed signature S component (256 bit) 89 } 90 91 /** 92 * Request: Transaction payload data. 93 * @next EthereumTxRequest 94 */ 95 message EthereumTxAck { 96 optional bytes data_chunk = 1; // Bytes from transaction payload (<= 1024 bytes) 97 } 98 99 /** 100 * Request: Ask device to sign message 101 * @start 102 * @next EthereumMessageSignature 103 * @next Failure 104 */ 105 message EthereumSignMessage { 106 repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node 107 optional bytes message = 2; // message to be signed 108 } 109 110 /** 111 * Response: Signed message 112 * @end 113 */ 114 message EthereumMessageSignature { 115 optional bytes addressBin = 1; // address used to sign the message (20 bytes, legacy firmware) 116 optional bytes signature = 2; // signature of the message 117 optional string addressHex = 3; // address used to sign the message (hex string, newer firmware) 118 } 119 120 /** 121 * Request: Ask device to verify message 122 * @start 123 * @next Success 124 * @next Failure 125 */ 126 message EthereumVerifyMessage { 127 optional bytes addressBin = 1; // address to verify (20 bytes, legacy firmware) 128 optional bytes signature = 2; // signature to verify 129 optional bytes message = 3; // message to verify 130 optional string addressHex = 4; // address to verify (hex string, newer firmware) 131 }