What changed, and why it matters
This commit is purely a code-style cleanup. It adds a protobuf formatter check to the project's build tooling and reformats all .proto definition files. There are no functional changes to the firmware, no protocol changes, and no security fixes or vulnerabilities introduced.
No action required. This is a style-only change and can be treated as routine maintenance.
Security signals we found
No strong security signals were identified.
Evidence from the diff
The commit introduces clang-format rules for Protocol Buffer files (Language: Proto in .clang-format), adds protostyle and protostyle_check Makefile targets, and runs the formatter across all .proto files. The diffs show only whitespace, comment wrapping, import reordering, and option reordering. No message fields are added, removed, or renumbered; no defaults or types change. It is a non-functional style-only change.
Changed components
common/protob/*.proto.clang-formatMakefileInspect captured patch +1208 / −1175
diff --git a/.clang-format b/.clang-format
index 36fabbe4..55f81d47 100644
--- a/.clang-format
+++ b/.clang-format
@@ -10,3 +10,11 @@ IncludeBlocks: Preserve
InsertNewlineAtEOF: true
#Set EOL to LF unconditionally
LineEnding: LF
+
+---
+Language: Proto
+AlignTrailingComments:
+ Kind: Always
+ OverEmptyLines: 1
+ColumnLimit: 120
+IndentWidth: 4
diff --git a/Makefile b/Makefile
index 56d63e32..6fce94fd 100644
--- a/Makefile
+++ b/Makefile
@@ -7,11 +7,11 @@ help: ## show this help
PY_FILES = $(shell find . -type f -name '*.py' | sed 'sO^\./OO' | grep -f ./tools/style.py.include | grep -v -f ./tools/style.py.exclude ) common/protob/pb2py
C_FILES = $(shell find . -type f -name '*.[ch]' | grep -f ./tools/style.c.include | grep -v -f ./tools/style.c.exclude )
+PROTO_FILES = $(shell find common core -type f -name '*.proto')
+style_check: pystyle_check ruststyle_check cstyle_check protostyle_check changelog_check translations_style_check yaml_check docs_summary_check editor_check ## run all style checks
-style_check: pystyle_check ruststyle_check cstyle_check changelog_check translations_style_check yaml_check docs_summary_check editor_check ## run all style checks
-
-style: pystyle ruststyle cstyle changelog_style translations_style ## apply all code styles (C+Rust+Py+Changelog+translation JSON)
+style: pystyle ruststyle cstyle protostyle changelog_style translations_style ## apply all code styles (Python+Rust+C+protobuf+changelog+translation JSON)
pystyle_check: ## run code style check on application sources and tests
flake8 --version
@@ -56,9 +56,11 @@ pystyle: ## apply code style on application sources and tests
make -C python style
changelog_check: ## check changelog format
+ @echo [CHANGELOG-CHECK]
./tools/changelog.py check
changelog_style: ## fix changelog format
+ @echo [CHANGELOG-STYLE]
./tools/changelog.py style
translations_style: ## Format translation files
@@ -70,9 +72,11 @@ translations_style_check: ## Check that translation files are properly formatted
@./core/tools/translations/sort_keys.py check
yaml_check: ## check yaml formatting
+ @echo [YAML-STYLE-CHECK]
yamllint .
editor_check: ## check editorconfig formatting
+ @echo [EDITORCONFIG-STYLE-CHECK]
editorconfig-checker -exclude '.*\.(so|dat|toif|der)|^crypto/aes/'
cstyle_check: ## run code style check on low-level C code
@@ -84,6 +88,15 @@ cstyle: ## apply code style on low-level C code
@echo [CLANG-FORMAT]
@clang-format -i $(C_FILES)
+protostyle: ## Format protobuf definitions
+ @echo [PROTOBUF-STYLE]
+ @clang-format -i $(PROTO_FILES)
+
+protostyle_check: ## Check that protobuf definitions are properly formatted
+ @echo [PROTOBUF-STYLE-CHECK]
+ clang-format --version
+ @./tools/clang-format-check $(PROTO_FILES)
+
defs_check: ## check validity of coin definitions and protobuf files
jsonlint common/defs/*.json common/defs/*/*.json
python3 common/tools/cointool.py check
diff --git a/common/protob/messages-benchmark.proto b/common/protob/messages-benchmark.proto
index cc12f15a..5ec8e722 100644
--- a/common/protob/messages-benchmark.proto
+++ b/common/protob/messages-benchmark.proto
@@ -1,12 +1,13 @@
syntax = "proto2";
package hw.trezor.messages.bitcoin;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageBenchmark";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -15,8 +16,7 @@ option (include_in_bitcoin_only) = true;
* @next Benchmarks
* @next Failure
*/
-message BenchmarkListNames {
-}
+message BenchmarkListNames {}
/**
* Response: Contains the list of names of all supported benchmarks
diff --git a/common/protob/messages-bitcoin.proto b/common/protob/messages-bitcoin.proto
index dfde209c..ba07a258 100644
--- a/common/protob/messages-bitcoin.proto
+++ b/common/protob/messages-bitcoin.proto
@@ -1,38 +1,39 @@
syntax = "proto2";
package hw.trezor.messages.bitcoin;
-// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
-option java_outer_classname = "TrezorMessageBitcoin";
-
import "messages-common.proto";
import "options.proto";
+// Sugar for easier handling in Java
+option java_outer_classname = "TrezorMessageBitcoin";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
+
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
* Type of script which will be used for transaction input
*/
enum InputScriptType {
- SPENDADDRESS = 0; // standard P2PKH address
- SPENDMULTISIG = 1; // P2SH multisig address
- EXTERNAL = 2; // reserved for external inputs (coinjoin)
- SPENDWITNESS = 3; // native SegWit
- SPENDP2SHWITNESS = 4; // SegWit over P2SH (backward compatible)
- SPENDTAPROOT = 5; // Taproot
+ SPENDADDRESS = 0; // standard P2PKH address
+ SPENDMULTISIG = 1; // P2SH multisig address
+ EXTERNAL = 2; // reserved for external inputs (coinjoin)
+ SPENDWITNESS = 3; // native SegWit
+ SPENDP2SHWITNESS = 4; // SegWit over P2SH (backward compatible)
+ SPENDTAPROOT = 5; // Taproot
}
/**
* Type of script which will be used for transaction output
*/
enum OutputScriptType {
- PAYTOADDRESS = 0; // used for all addresses (bitcoin, p2sh, witness)
- PAYTOSCRIPTHASH = 1; // p2sh address (deprecated; use PAYTOADDRESS)
- PAYTOMULTISIG = 2; // only for change output
- PAYTOOPRETURN = 3; // op_return
- PAYTOWITNESS = 4; // only for change output
- PAYTOP2SHWITNESS = 5; // only for change output
- PAYTOTAPROOT = 6; // only for change output
+ PAYTOADDRESS = 0; // used for all addresses (bitcoin, p2sh, witness)
+ PAYTOSCRIPTHASH = 1; // p2sh address (deprecated; use PAYTOADDRESS)
+ PAYTOMULTISIG = 2; // only for change output
+ PAYTOOPRETURN = 3; // op_return
+ PAYTOWITNESS = 4; // only for change output
+ PAYTOP2SHWITNESS = 5; // only for change output
+ PAYTOTAPROOT = 6; // only for change output
}
/**
@@ -47,10 +48,10 @@ enum DecredStakingSpendType {
* Unit to be used when showing amounts on the display
*/
enum AmountUnit {
- BITCOIN = 0; // BTC
- MILLIBITCOIN = 1; // mBTC
- MICROBITCOIN = 2; // uBTC
- SATOSHI = 3; // sat
+ BITCOIN = 0; // BTC
+ MILLIBITCOIN = 1; // mBTC
+ MICROBITCOIN = 2; // uBTC
+ SATOSHI = 3; // sat
}
enum MultisigPubkeysOrder {
@@ -63,18 +64,19 @@ enum MultisigPubkeysOrder {
* @embed
*/
message MultisigRedeemScriptType {
- repeated HDNodePathType pubkeys = 1; // this field is deprecated and will be removed in the future, use nodes together with address_n instead
- repeated bytes signatures = 2; // existing signatures for partially signed input
- required uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending
+ repeated HDNodePathType pubkeys = 1; // this field is deprecated and will be removed in the
+ // future, use nodes together with address_n instead
+ repeated bytes signatures = 2; // existing signatures for partially signed input
+ required uint32 m = 3; // "m" from n, how many valid signatures is necessary for spending
repeated common.HDNodeType nodes = 4;
- repeated uint32 address_n = 5; // path to derive pubkeys from nodes
- optional MultisigPubkeysOrder pubkeys_order = 6 [default=PRESERVED]; // order of pubkeys in script pubkey
+ repeated uint32 address_n = 5; // path to derive pubkeys from nodes
+ optional MultisigPubkeysOrder pubkeys_order = 6 [default = PRESERVED]; // order of pubkeys in script pubkey
/**
- * Structure representing HDNode + Path
- */
+ * Structure representing HDNode + Path
+ */
message HDNodePathType {
- required common.HDNodeType node = 1; // BIP-32 node in deserialized form
- repeated uint32 address_n = 2; // BIP-32 path to derive the key from node
+ required common.HDNodeType node = 1; // BIP-32 node in deserialized form
+ repeated uint32 address_n = 2; // BIP-32 path to derive the key from node
}
}
@@ -85,12 +87,13 @@ message MultisigRedeemScriptType {
* @next Failure
*/
message GetPublicKey {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional string ecdsa_curve_name = 2; // ECDSA curve name to use
- optional bool show_display = 3; // optionally show on display before sending the result
- optional string coin_name = 4 [default='Bitcoin']; // coin to use for verifying
- optional InputScriptType script_type = 5 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
- optional bool ignore_xpub_magic = 6; // ignore SLIP-0132 XPUB magic, use xpub/tpub prefix for all account types
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional string ecdsa_curve_name = 2; // ECDSA curve name to use
+ optional bool show_display = 3; // optionally show on display before sending the result
+ optional string coin_name = 4 [default = 'Bitcoin']; // coin to use for verifying
+ optional InputScriptType script_type = 5
+ [default = SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
+ optional bool ignore_xpub_magic = 6; // ignore SLIP-0132 XPUB magic, use xpub/tpub prefix for all account types
}
/**
@@ -98,10 +101,10 @@ message GetPublicKey {
* @end
*/
message PublicKey {
- required common.HDNodeType node = 1; // BIP-32 public node
- required string xpub = 2; // serialized form of public node
- optional uint32 root_fingerprint = 3; // master root node fingerprint
- optional string descriptor = 4; // BIP-380 descriptor
+ required common.HDNodeType node = 1; // BIP-32 public node
+ required string xpub = 2; // serialized form of public node
+ optional uint32 root_fingerprint = 3; // master root node fingerprint
+ optional string descriptor = 4; // BIP-380 descriptor
}
/**
@@ -111,13 +114,14 @@ message PublicKey {
* @next Failure
*/
message GetAddress {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional string coin_name = 2 [default='Bitcoin']; // coin to use
- optional bool show_display = 3; // optionally show on display before sending the result
- optional MultisigRedeemScriptType multisig = 4; // filled if we are showing a multisig address
- optional InputScriptType script_type = 5 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
- optional bool ignore_xpub_magic = 6; // ignore SLIP-0132 XPUB magic, use xpub/tpub prefix for all account types
- optional bool chunkify = 7; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional string coin_name = 2 [default = 'Bitcoin']; // coin to use
+ optional bool show_display = 3; // optionally show on display before sending the result
+ optional MultisigRedeemScriptType multisig = 4; // filled if we are showing a multisig address
+ optional InputScriptType script_type = 5
+ [default = SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
+ optional bool ignore_xpub_magic = 6; // ignore SLIP-0132 XPUB magic, use xpub/tpub prefix for all account types
+ optional bool chunkify = 7; // display the address in chunks of 4 characters
}
/**
@@ -125,8 +129,8 @@ message GetAddress {
* @end
*/
message Address {
- required string address = 1; // Coin address in Base58 encoding
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Coin address in Base58 encoding
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -136,10 +140,11 @@ message Address {
* @next Failure
*/
message GetOwnershipId {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional string coin_name = 2 [default='Bitcoin']; // coin to use
- optional MultisigRedeemScriptType multisig = 3; // filled if we are dealing with a multisig scriptPubKey
- optional InputScriptType script_type = 4 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional string coin_name = 2 [default = 'Bitcoin']; // coin to use
+ optional MultisigRedeemScriptType multisig = 3; // filled if we are dealing with a multisig scriptPubKey
+ optional InputScriptType script_type = 4
+ [default = SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
}
/**
@@ -147,7 +152,7 @@ message GetOwnershipId {
* @end
*/
message OwnershipId {
- required bytes ownership_id = 1; // ownership identifier
+ required bytes ownership_id = 1; // ownership identifier
}
/**
@@ -157,12 +162,14 @@ message OwnershipId {
* @next Failure
*/
message SignMessage {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes message = 2; // message to be signed
- optional string coin_name = 3 [default='Bitcoin']; // coin to use for signing
- optional InputScriptType script_type = 4 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
- optional bool no_script_type = 5; // don't include script type information in the recovery byte of the signature, same as in Bitcoin Core
- optional bool chunkify = 6; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes message = 2; // message to be signed
+ optional string coin_name = 3 [default = 'Bitcoin']; // coin to use for signing
+ optional InputScriptType script_type = 4
+ [default = SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
+ optional bool no_script_type = 5; // don't include script type information in the recovery byte
+ // of the signature, same as in Bitcoin Core
+ optional bool chunkify = 6; // display the address in chunks of 4 characters
}
/**
@@ -170,8 +177,8 @@ message SignMessage {
* @end
*/
message MessageSignature {
- required string address = 1; // address used to sign the message
- required bytes signature = 2; // signature of the message
+ required string address = 1; // address used to sign the message
+ required bytes signature = 2; // signature of the message
}
/**
@@ -181,11 +188,11 @@ message MessageSignature {
* @next Failure
*/
message VerifyMessage {
- required string address = 1; // address to verify
- required bytes signature = 2; // signature to verify
- required bytes message = 3; // message to verify
- optional string coin_name = 4 [default='Bitcoin']; // coin to use for verifying
- optional bool chunkify = 5; // display the address in chunks of 4 characters
+ required string address = 1; // address to verify
+ required bytes signature = 2; // signature to verify
+ required bytes message = 3; // message to verify
+ optional string coin_name = 4 [default = 'Bitcoin']; // coin to use for verifying
+ optional bool chunkify = 5; // display the address in chunks of 4 characters
}
/**
@@ -195,30 +202,34 @@ message VerifyMessage {
* @next Failure
*/
message SignTx {
- required uint32 outputs_count = 1; // number of transaction outputs
- required uint32 inputs_count = 2; // number of transaction inputs
- optional string coin_name = 3 [default='Bitcoin']; // coin to use
- optional uint32 version = 4 [default=1]; // transaction version
- optional uint32 lock_time = 5 [default=0]; // transaction lock_time
- optional uint32 expiry = 6; // only for Decred and Zcash
- optional bool overwintered = 7 [deprecated=true]; // deprecated in 2.3.2, the field is not needed as it can be derived from `version`
- optional uint32 version_group_id = 8; // only for Zcash, nVersionGroupId
- optional uint32 timestamp = 9; // only for Peercoin
- optional uint32 branch_id = 10; // only for Zcash, BRANCH_ID
- optional AmountUnit amount_unit = 11 [default=BITCOIN]; // show amounts in
- optional bool decred_staking_ticket = 12 [default=false]; // only for Decred, this is signing a ticket purchase
- optional bool serialize = 13 [default=true]; // serialize the full transaction, as opposed to only outputting the signatures
- optional CoinJoinRequest coinjoin_request = 14; // only for preauthorized CoinJoins
- optional bool chunkify = 15; // display the address in chunks of 4 characters
+ required uint32 outputs_count = 1; // number of transaction outputs
+ required uint32 inputs_count = 2; // number of transaction inputs
+ optional string coin_name = 3 [default = 'Bitcoin']; // coin to use
+ optional uint32 version = 4 [default = 1]; // transaction version
+ optional uint32 lock_time = 5 [default = 0]; // transaction lock_time
+ optional uint32 expiry = 6; // only for Decred and Zcash
+ optional bool overwintered = 7
+ [deprecated = true]; // deprecated in 2.3.2, the field is not needed as it can be derived from `version`
+ optional uint32 version_group_id = 8; // only for Zcash, nVersionGroupId
+ optional uint32 timestamp = 9; // only for Peercoin
+ optional uint32 branch_id = 10; // only for Zcash, BRANCH_ID
+ optional AmountUnit amount_unit = 11 [default = BITCOIN]; // show amounts in
+ optional bool decred_staking_ticket = 12 [default = false]; // only for Decred, this is signing a ticket purchase
+ optional bool serialize = 13
+ [default = true]; // serialize the full transaction, as opposed to only outputting the signatures
+ optional CoinJoinRequest coinjoin_request = 14; // only for preauthorized CoinJoins
+ optional bool chunkify = 15; // display the address in chunks of 4 characters
/**
* Signing request for a CoinJoin transaction.
*/
message CoinJoinRequest {
required uint32 fee_rate = 1; // coordination fee rate in units of 10^-6 percent
- required uint64 no_fee_threshold = 2; // PlebsDontPayThreshold in Wasabi, the input amount above which the fee rate applies
+ required uint64 no_fee_threshold = 2; // PlebsDontPayThreshold in Wasabi, the input amount
+ // above which the fee rate applies
required uint64 min_registrable_amount = 3; // minimum registrable output amount
- optional bytes mask_public_key = 4; // ephemeral secp256k1 public key used for masking coinjoin_flags, 33 bytes in compressed form
+ optional bytes mask_public_key = 4; // ephemeral secp256k1 public key used for masking
+ // coinjoin_flags, 33 bytes in compressed form
optional bytes signature = 5; // the trusted party's signature of the CoinJoin request digest
}
}
@@ -237,12 +248,12 @@ message SignTx {
* @next PaymentRequest
*/
message TxRequest {
- optional RequestType request_type = 1; // what should be filled in TxAck message?
- optional TxRequestDetailsType details = 2; // request for tx details
- optional TxRequestSerializedType serialized = 3; // serialized data and request for next
+ optional RequestType request_type = 1; // what should be filled in TxAck message?
+ optional TxRequestDetailsType details = 2; // request for tx details
+ optional TxRequestSerializedType serialized = 3; // serialized data and request for next
/**
- * Type of information required by transaction signing process
- */
+ * Type of information required by transaction signing process
+ */
enum RequestType {
TXINPUT = 0;
TXOUTPUT = 1;
@@ -254,8 +265,8 @@ message TxRequest {
TXPAYMENTREQ = 7;
}
/**
- * Structure representing request details
- */
+ * Structure representing request details
+ */
message TxRequestDetailsType {
optional uint32 request_index = 1; // device expects TxAck message from the computer
optional bytes tx_hash = 2; // tx_hash of requested transaction
@@ -263,12 +274,12 @@ message TxRequest {
optional uint32 extra_data_offset = 4; // offset of requested extra data (only for Dash, Zcash)
}
/**
- * Structure representing serialized data
- */
+ * Structure representing serialized data
+ */
message TxRequestSerializedType {
- optional uint32 signature_index = 1; // 'signature' field contains signed input of this index
- optional bytes signature = 2; // signature of the signature_index input
- optional bytes serialized_tx = 3; // part of serialized and signed transaction
+ optional uint32 signature_index = 1; // 'signature' field contains signed input of this index
+ optional bytes signature = 2; // signature of the signature_index input
+ optional bytes serialized_tx = 3; // part of serialized and signed transaction
}
}
@@ -289,8 +300,8 @@ message TxAck {
optional TransactionType tx = 1;
/**
- * Structure representing transaction
- */
+ * Structure representing transaction
+ */
message TransactionType {
optional uint32 version = 1;
repeated TxInputType inputs = 2;
@@ -299,62 +310,73 @@ message TxAck {
repeated TxOutputType outputs = 5;
optional uint32 inputs_cnt = 6;
optional uint32 outputs_cnt = 7;
- optional bytes extra_data = 8; // only for Dash, Zcash
- optional uint32 extra_data_len = 9; // only for Dash, Zcash
- optional uint32 expiry = 10; // only for Decred and Zcash
- optional bool overwintered = 11 [deprecated=true]; // Zcash only; deprecated in 2.3.2, the field is not needed, it can be derived from `version`
- optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId
- optional uint32 timestamp = 13; // only for Peercoin
- optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID
+ optional bytes extra_data = 8; // only for Dash, Zcash
+ optional uint32 extra_data_len = 9; // only for Dash, Zcash
+ optional uint32 expiry = 10; // only for Decred and Zcash
+ optional bool overwintered = 11 [deprecated = true]; // Zcash only; deprecated in 2.3.2, the field is not
+ // needed, it can be derived from `version`
+ optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId
+ optional uint32 timestamp = 13; // only for Peercoin
+ optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID
/**
- * Structure representing transaction input
- */
+ * Structure representing transaction input
+ */
message TxInputType {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
- required uint32 prev_index = 3; // index of previous output to spend
- optional bytes script_sig = 4; // script signature, unset for tx to sign
- optional uint32 sequence = 5 [default=4294967295]; // sequence (default=0xffffffff)
- optional InputScriptType script_type = 6 [default=SPENDADDRESS]; // defines template of input script
- optional MultisigRedeemScriptType multisig = 7; // Filled if input is going to spend multisig tx
- optional uint64 amount = 8; // amount of previous transaction output (for segwit only)
- optional uint32 decred_tree = 9; // only for Decred, 0 is a normal transaction while 1 is a stake transaction
- // optional uint32 decred_script_version = 10; // only for Decred // deprecated -> only 0 is supported
- // optional bytes prev_block_hash_bip115 = 11; // BIP-115 support dropped
- // optional uint32 prev_block_height_bip115 = 12; // BIP-115 support dropped
- optional bytes witness = 13; // witness data, only set for EXTERNAL inputs
- optional bytes ownership_proof = 14; // SLIP-0019 proof of ownership, only set for EXTERNAL inputs
- optional bytes commitment_data = 15; // optional commitment data for the SLIP-0019 proof of ownership
- optional bytes orig_hash = 16; // tx_hash of the original transaction where this input was spent (used when creating a replacement transaction)
- optional uint32 orig_index = 17; // index of the input in the original transaction (used when creating a replacement transaction)
- optional DecredStakingSpendType decred_staking_spend = 18; // if not None this holds the type of stake spend: revocation or stake generation
- optional bytes script_pubkey = 19; // scriptPubKey of the previous output spent by this input, only set of EXTERNAL inputs
- optional uint32 coinjoin_flags = 20 [default=0]; // bit field of CoinJoin-specific flags
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
+ required uint32 prev_index = 3; // index of previous output to spend
+ optional bytes script_sig = 4; // script signature, unset for tx to sign
+ optional uint32 sequence = 5 [default = 4294967295]; // sequence (default=0xffffffff)
+ optional InputScriptType script_type = 6 [default = SPENDADDRESS]; // defines template of input script
+ optional MultisigRedeemScriptType multisig = 7; // Filled if input is going to spend multisig tx
+ optional uint64 amount = 8; // amount of previous transaction output (for segwit only)
+ optional uint32 decred_tree = 9; // only for Decred, 0 is a normal transaction
+ // while 1 is a stake transaction
+ // optional uint32 decred_script_version = 10; // only for Decred // deprecated -> only 0 is supported
+ // optional bytes prev_block_hash_bip115 = 11; // BIP-115 support dropped
+ // optional uint32 prev_block_height_bip115 = 12;// BIP-115 support dropped
+ optional bytes witness = 13; // witness data, only set for EXTERNAL inputs
+ optional bytes ownership_proof = 14; // SLIP-0019 proof of ownership, only set for EXTERNAL inputs
+ optional bytes commitment_data = 15; // optional commitment data for the SLIP-0019 proof of ownership
+ optional bytes orig_hash = 16; // tx_hash of the original transaction where this input was spent (used when
+ // creating a replacement transaction)
+ optional uint32 orig_index = 17; // index of the input in the original transaction
+ // (used when creating a replacement transaction)
+ optional DecredStakingSpendType decred_staking_spend = 18; // if not None this holds the type of stake
+ // spend: revocation or stake generation
+ optional bytes script_pubkey = 19; // scriptPubKey of the previous output spent by this
+ // input, only set of EXTERNAL inputs
+ optional uint32 coinjoin_flags = 20 [default = 0]; // bit field of CoinJoin-specific flags
}
/**
- * Structure representing compiled transaction output
- */
+ * Structure representing compiled transaction output
+ */
message TxOutputBinType {
required uint64 amount = 1;
required bytes script_pubkey = 2;
- optional uint32 decred_script_version = 3; // only for Decred, currently only 0 is supported
+ optional uint32 decred_script_version = 3; // only for Decred, currently only 0 is supported
}
/**
- * Structure representing transaction output
- */
+ * Structure representing transaction output
+ */
message TxOutputType {
- optional string address = 1; // target coin address in Base58 encoding
- repeated uint32 address_n = 2; // BIP-32 path to derive the key from master node; has higher priority than "address"
- required uint64 amount = 3; // amount to spend in satoshis
- optional OutputScriptType script_type = 4 [default=PAYTOADDRESS]; // output script type
- optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be PAYTOMULTISIG
- optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN, amount must be 0
- // optional uint32 decred_script_version = 7; // only for Decred // deprecated -> only 0 is supported
+ optional string address = 1; // target coin address in Base58 encoding
+ repeated uint32 address_n = 2; // BIP-32 path to derive the key from master node; has
+ // higher priority than "address"
+ required uint64 amount = 3; // amount to spend in satoshis
+ optional OutputScriptType script_type = 4 [default = PAYTOADDRESS]; // output script type
+ optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be
+ // PAYTOMULTISIG
+ optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN,
+ // amount must be 0
+ // optional uint32 decred_script_version = 7; // only for Decred // deprecated -> only 0 is supported
// optional bytes block_hash_bip115 = 8; // BIP-115 support dropped
// optional uint32 block_height_bip115 = 9; // BIP-115 support dropped
- optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was present (used when creating a replacement transaction)
- optional uint32 orig_index = 11; // index of the output in the original transaction (used when creating a replacement transaction)
- optional uint32 payment_req_index = 12; // index of the PaymentRequest containing this output
+ optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was present (used
+ // when creating a replacement transaction)
+ optional uint32 orig_index = 11; // index of the output in the original transaction
+ // (used when creating a replacement transaction)
+ optional uint32 payment_req_index = 12; // index of the PaymentRequest containing this output
}
}
}
@@ -366,40 +388,46 @@ message TxAck {
* @embed
*/
message TxInput {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
- required uint32 prev_index = 3; // index of previous output to spend
- optional bytes script_sig = 4; // script signature, only set for EXTERNAL inputs
- optional uint32 sequence = 5 [default=0xffffffff]; // sequence
- optional InputScriptType script_type = 6 [default=SPENDADDRESS]; // defines template of input script
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
+ required uint32 prev_index = 3; // index of previous output to spend
+ optional bytes script_sig = 4; // script signature, only set for EXTERNAL inputs
+ optional uint32 sequence = 5 [default = 0xffffffff]; // sequence
+ optional InputScriptType script_type = 6 [default = SPENDADDRESS]; // defines template of input script
optional MultisigRedeemScriptType multisig = 7; // Filled if input is going to spend multisig tx
required uint64 amount = 8; // amount of previous transaction output
- optional uint32 decred_tree = 9; // only for Decred, 0 is a normal transaction while 1 is a stake transaction
- reserved 10, 11, 12; // fields which are in use, or have been in the past, in TxInputType
- optional bytes witness = 13; // witness data, only set for EXTERNAL inputs
- optional bytes ownership_proof = 14; // SLIP-0019 proof of ownership, only set for EXTERNAL inputs
- optional bytes commitment_data = 15; // optional commitment data for the SLIP-0019 proof of ownership
- optional bytes orig_hash = 16; // tx_hash of the original transaction where this input was spent (used when creating a replacement transaction)
- optional uint32 orig_index = 17; // index of the input in the original transaction (used when creating a replacement transaction)
- optional DecredStakingSpendType decred_staking_spend = 18; // if not None this holds the type of stake spend: revocation or stake generation
- optional bytes script_pubkey = 19; // scriptPubKey of the previous output spent by this input, only set of EXTERNAL inputs
- optional uint32 coinjoin_flags = 20 [default=0]; // bit field of CoinJoin-specific flags
+ optional uint32 decred_tree = 9; // only for Decred, 0 is a normal transaction while 1 is a stake transaction
+ reserved 10, 11, 12; // fields which are in use, or have been in the past, in TxInputType
+ optional bytes witness = 13; // witness data, only set for EXTERNAL inputs
+ optional bytes ownership_proof = 14; // SLIP-0019 proof of ownership, only set for EXTERNAL inputs
+ optional bytes commitment_data = 15; // optional commitment data for the SLIP-0019 proof of ownership
+ optional bytes orig_hash = 16; // tx_hash of the original transaction where this input was
+ // spent (used when creating a replacement transaction)
+ optional uint32 orig_index = 17; // index of the input in the original transaction (used when
+ // creating a replacement transaction)
+ optional DecredStakingSpendType decred_staking_spend =
+ 18; // if not None this holds the type of stake spend: revocation or stake generation
+ optional bytes script_pubkey =
+ 19; // scriptPubKey of the previous output spent by this input, only set of EXTERNAL inputs
+ optional uint32 coinjoin_flags = 20 [default = 0]; // bit field of CoinJoin-specific flags
}
/** Data type for transaction output to be signed.
* @embed
*/
message TxOutput {
- optional string address = 1; // destination address in Base58 encoding; script_type must be PAYTOADDRESS
- repeated uint32 address_n = 2; // BIP-32 path to derive the destination (used for change addresses)
- required uint64 amount = 3; // amount to spend in satoshis
- optional OutputScriptType script_type = 4 [default=PAYTOADDRESS]; // output script type
- optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be PAYTOMULTISIG
- optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN, amount must be 0
- reserved 7, 8, 9; // fields which are in use, or have been in the past, in TxOutputType
- optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was present (used when creating a replacement transaction)
- optional uint32 orig_index = 11; // index of the output in the original transaction (used when creating a replacement transaction)
- optional uint32 payment_req_index = 12; // index of the PaymentRequest containing this output
+ optional string address = 1; // destination address in Base58 encoding; script_type must be PAYTOADDRESS
+ repeated uint32 address_n = 2; // BIP-32 path to derive the destination (used for change addresses)
+ required uint64 amount = 3; // amount to spend in satoshis
+ optional OutputScriptType script_type = 4 [default = PAYTOADDRESS]; // output script type
+ optional MultisigRedeemScriptType multisig = 5; // defines multisig address; script_type must be PAYTOMULTISIG
+ optional bytes op_return_data = 6; // defines op_return data; script_type must be PAYTOOPRETURN, amount must be 0
+ reserved 7, 8, 9; // fields which are in use, or have been in the past, in TxOutputType
+ optional bytes orig_hash = 10; // tx_hash of the original transaction where this output was
+ // present (used when creating a replacement transaction)
+ optional uint32 orig_index = 11; // index of the output in the original transaction (used when
+ // creating a replacement transaction)
+ optional uint32 payment_req_index = 12; // index of the PaymentRequest containing this output
}
/** Data type for metadata about previous transaction which contains the UTXO being spent.
@@ -410,11 +438,11 @@ message PrevTx {
required uint32 lock_time = 4;
required uint32 inputs_count = 6;
required uint32 outputs_count = 7;
- optional uint32 extra_data_len = 9 [default=0]; // only for Dash, Zcash
- optional uint32 expiry = 10; // only for Decred and Zcash
- optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId
- optional uint32 timestamp = 13; // only for Peercoin
- optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID
+ optional uint32 extra_data_len = 9 [default = 0]; // only for Dash, Zcash
+ optional uint32 expiry = 10; // only for Decred and Zcash
+ optional uint32 version_group_id = 12; // only for Zcash, nVersionGroupId
+ optional uint32 timestamp = 13; // only for Peercoin
+ optional uint32 branch_id = 14; // only for Zcash, BRANCH_ID
// fields which are in use, or have been in the past, in TransactionType
reserved 2, 3, 5, 8, 11;
@@ -426,11 +454,11 @@ message PrevTx {
* @embed
*/
message PrevInput {
- required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
- required uint32 prev_index = 3; // index of previous output to spend
- required bytes script_sig = 4; // script signature
- required uint32 sequence = 5; // sequence
- optional uint32 decred_tree = 9; // only for Decred
+ required bytes prev_hash = 2; // hash of previous transaction output to spend by this input
+ required uint32 prev_index = 3; // index of previous output to spend
+ required bytes script_sig = 4; // script signature
+ required uint32 sequence = 5; // sequence
+ optional uint32 decred_tree = 9; // only for Decred
// fields that are in use, or have been in the past, in TxInputType
reserved 1, 6, 7, 8, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19;
@@ -440,9 +468,9 @@ message PrevInput {
* @embed
*/
message PrevOutput {
- required uint64 amount = 1; // amount sent to this output
- required bytes script_pubkey = 2; // scriptPubkey of this output
- optional uint32 decred_script_version = 3; // only for Decred
+ required uint64 amount = 1; // amount sent to this output
+ required bytes script_pubkey = 2; // scriptPubkey of this output
+ optional uint32 decred_script_version = 3; // only for Decred
}
/**
@@ -514,7 +542,6 @@ message TxAckPrevInput {
message TxAckPrevInputWrapper {
required PrevInput input = 2;
-
}
}
@@ -562,13 +589,15 @@ message TxAckPrevExtraData {
* @next Failure
*/
message GetOwnershipProof {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional string coin_name = 2 [default='Bitcoin']; // coin to use
- optional InputScriptType script_type = 3 [default=SPENDWITNESS]; // used to distinguish between various scriptPubKey types
- optional MultisigRedeemScriptType multisig = 4; // filled if proof is for a multisig address
- optional bool user_confirmation = 5 [default=false]; // show a confirmation dialog and set the "user confirmation" bit in the proof
- repeated bytes ownership_ids = 6; // list of ownership identifiers in case of multisig
- optional bytes commitment_data = 7 [default='']; // additional data to which the proof should commit
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional string coin_name = 2 [default = 'Bitcoin']; // coin to use
+ optional InputScriptType script_type = 3
+ [default = SPENDWITNESS]; // used to distinguish between various scriptPubKey types
+ optional MultisigRedeemScriptType multisig = 4; // filled if proof is for a multisig address
+ optional bool user_confirmation = 5
+ [default = false]; // show a confirmation dialog and set the "user confirmation" bit in the proof
+ repeated bytes ownership_ids = 6; // list of ownership identifiers in case of multisig
+ optional bytes commitment_data = 7 [default ='']; // additional data to which the proof should commit
}
/**
@@ -576,8 +605,8 @@ message GetOwnershipProof {
* @end
*/
message OwnershipProof {
- required bytes ownership_proof = 1; // SLIP-0019 proof of ownership
- required bytes signature = 2; // signature of the proof
+ required bytes ownership_proof = 1; // SLIP-0019 proof of ownership
+ required bytes signature = 2; // signature of the proof
}
/**
@@ -587,12 +616,15 @@ message OwnershipProof {
* @next Failure
*/
message AuthorizeCoinJoin {
- required string coordinator = 1; // coordinator identifier to approve as a prefix in commitment data (max. 36 ASCII characters)
- required uint64 max_rounds = 2; // maximum number of rounds that Trezor is authorized to take part in
- required uint32 max_coordinator_fee_rate = 3; // maximum coordination fee rate in units of 10^-6 percent
- required uint32 max_fee_per_kvbyte = 4; // maximum mining fee rate in units of satoshis per 1000 vbytes
- repeated uint32 address_n = 5; // prefix of the BIP-32 path leading to the account (m / purpose' / coin_type' / account')
- optional string coin_name = 6 [default='Bitcoin']; // coin to use
- optional InputScriptType script_type = 7 [default=SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
- optional AmountUnit amount_unit = 8 [default=BITCOIN]; // show amounts in
+ required string coordinator = 1; // coordinator identifier to approve as a prefix in commitment
+ // data (max. 36 ASCII characters)
+ required uint64 max_rounds = 2; // maximum number of rounds that Trezor is authorized to take part in
+ required uint32 max_coordinator_fee_rate = 3; // maximum coordination fee rate in units of 10^-6 percent
+ required uint32 max_fee_per_kvbyte = 4; // maximum mining fee rate in units of satoshis per 1000 vbytes
+ repeated uint32 address_n = 5; // prefix of the BIP-32 path leading to the account (m /
+ // purpose' / coin_type' / account')
+ optional string coin_name = 6 [default = 'Bitcoin']; // coin to use
+ optional InputScriptType script_type = 7
+ [default = SPENDADDRESS]; // used to distinguish between various address formats (non-segwit, segwit, etc.)
+ optional AmountUnit amount_unit = 8 [default = BITCOIN]; // show amounts in
}
diff --git a/common/protob/messages-ble.proto b/common/protob/messages-ble.proto
index d4760e8a..a7bcd6e2 100644
--- a/common/protob/messages-ble.proto
+++ b/common/protob/messages-ble.proto
@@ -1,15 +1,15 @@
syntax = "proto2";
package hw.trezor.messages.ble;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageBle";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
-
/**
* Request: erases BLE bond(s).
*
@@ -22,8 +22,6 @@ option (include_in_bitcoin_only) = true;
* @next Failure
*/
message BleUnpair {
- optional bool all = 1; // whether to erase bonds for all devices
- optional bytes addr = 2; // 6-byte MAC address to unpair
+ optional bool all = 1; // whether to erase bonds for all devices
+ optional bytes addr = 2; // 6-byte MAC address to unpair
}
-
-
diff --git a/common/protob/messages-bootloader.proto b/common/protob/messages-bootloader.proto
index 57cff1c7..49dea48b 100644
--- a/common/protob/messages-bootloader.proto
+++ b/common/protob/messages-bootloader.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.bootloader;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageBootloader";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask device to erase its firmware (so it can be replaced via FirmwareUpload)
@@ -11,7 +11,7 @@ option java_outer_classname = "TrezorMessageBootloader";
* @next FirmwareRequest
*/
message FirmwareErase {
- optional uint32 length = 1; // length of new firmware
+ optional uint32 length = 1; // length of new firmware
}
/**
@@ -19,8 +19,8 @@ message FirmwareErase {
* @next FirmwareUpload
*/
message FirmwareRequest {
- required uint32 offset = 1; // offset of requested firmware chunk
- required uint32 length = 2; // length of requested firmware chunk
+ required uint32 offset = 1; // offset of requested firmware chunk
+ required uint32 length = 2; // length of requested firmware chunk
}
/**
@@ -30,8 +30,8 @@ message FirmwareRequest {
* @next Failure
*/
message FirmwareUpload {
- required bytes payload = 1; // firmware to be loaded into device
- optional bytes hash = 2; // hash of the payload
+ required bytes payload = 1; // firmware to be loaded into device
+ optional bytes hash = 2; // hash of the payload
}
/**
@@ -40,5 +40,5 @@ message FirmwareUpload {
* @next Failure
*/
message ProdTestT1 {
- optional bytes payload = 1; // payload to be used in prodtest
+ optional bytes payload = 1; // payload to be used in prodtest
}
diff --git a/common/protob/messages-cardano.proto b/common/protob/messages-cardano.proto
index d854f840..b275ceae 100644
--- a/common/protob/messages-cardano.proto
+++ b/common/protob/messages-cardano.proto
@@ -1,11 +1,11 @@
syntax = "proto2";
package hw.trezor.messages.cardano;
+import "messages-common.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageCardano";
-
-import "messages-common.proto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
enum CardanoDerivationType {
LEDGER = 0;
@@ -47,8 +47,8 @@ enum CardanoNativeScriptHashDisplayFormat {
}
enum CardanoTxOutputSerializationFormat {
- ARRAY_LEGACY = 0; // legacy_transaction_output in CDDL
- MAP_BABBAGE = 1; // post_alonzo_transaction_output in CDDL
+ ARRAY_LEGACY = 0; // legacy_transaction_output in CDDL
+ MAP_BABBAGE = 1; // post_alonzo_transaction_output in CDDL
}
enum CardanoCertificateType {
@@ -129,7 +129,7 @@ message CardanoNativeScript {
*/
message CardanoGetNativeScriptHash {
required CardanoNativeScript script = 1;
- required CardanoNativeScriptHashDisplayFormat display_format = 2; // display hash as bech32 or policy id
+ required CardanoNativeScriptHashDisplayFormat display_format = 2; // display hash as bech32 or policy id
required CardanoDerivationType derivation_type = 3;
}
@@ -150,13 +150,14 @@ message CardanoNativeScriptHash {
* @embed
*/
message CardanoAddressParametersType {
- required CardanoAddressType address_type = 1; // one of the CardanoAddressType-s
- repeated uint32 address_n = 2; // BIP-32-style path to derive the spending key from master node
- repeated uint32 address_n_staking = 3; // BIP-32-style path to derive staking key from master node
- optional bytes staking_key_hash = 4; // staking key can be derived from address_n_staking, or
- // can be sent directly e.g. if it doesn't belong to
- // the same account as address_n
- optional CardanoBlockchainPointerType certificate_pointer = 5; // a pointer to the staking key registration certificate
+ required CardanoAddressType address_type = 1; // one of the CardanoAddressType-s
+ repeated uint32 address_n = 2; // BIP-32-style path to derive the spending key from master node
+ repeated uint32 address_n_staking = 3; // BIP-32-style path to derive staking key from master node
+ optional bytes staking_key_hash = 4; // staking key can be derived from address_n_staking, or
+ // can be sent directly e.g. if it doesn't belong to
+ // the same account as address_n
+ optional CardanoBlockchainPointerType certificate_pointer = 5; // a pointer to the staking key registration
+ // certificate
optional bytes script_payment_hash = 6;
optional bytes script_staking_hash = 7;
}
@@ -169,12 +170,12 @@ message CardanoAddressParametersType {
*/
message CardanoGetAddress {
// repeated uint32 address_n = 1; // moved to address_parameters
- optional bool show_display = 2 [default=false]; // optionally prompt for confirmation on Trezor display
- required uint32 protocol_magic = 3; // network's protocol magic - needed for Byron addresses on testnets
- required uint32 network_id = 4; // network id - mainnet or testnet
- required CardanoAddressParametersType address_parameters = 5; // parameters used to derive the address
+ optional bool show_display = 2 [default = false]; // optionally prompt for confirmation on Trezor display
+ required uint32 protocol_magic = 3; // network's protocol magic - needed for Byron addresses on testnets
+ required uint32 network_id = 4; // network id - mainnet or testnet
+ required CardanoAddressParametersType address_parameters = 5; // parameters used to derive the address
required CardanoDerivationType derivation_type = 6;
- optional bool chunkify = 7; // display the address in chunks of 4 characters
+ optional bool chunkify = 7; // display the address in chunks of 4 characters
}
/**
@@ -182,8 +183,8 @@ message CardanoGetAddress {
* @end
*/
message CardanoAddress {
- required string address = 1; // Base58 cardano address
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Base58 cardano address
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -193,8 +194,8 @@ message CardanoAddress {
* @next Failure
*/
message CardanoGetPublicKey {
- 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
+ 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
required CardanoDerivationType derivation_type = 3;
}
@@ -203,8 +204,8 @@ message CardanoGetPublicKey {
* @end
*/
message CardanoPublicKey {
- required string xpub = 1; // Xpub key
- required hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 public node
+ required string xpub = 1; // Xpub key
+ required hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 public node
}
/**
@@ -215,12 +216,12 @@ message CardanoPublicKey {
*/
message CardanoSignTxInit {
required CardanoTxSigningMode signing_mode = 1;
- required uint32 protocol_magic = 2; // network's protocol magic
- required uint32 network_id = 3; // network id - mainnet or testnet
+ required uint32 protocol_magic = 2; // network's protocol magic
+ required uint32 network_id = 3; // network id - mainnet or testnet
required uint32 inputs_count = 4;
required uint32 outputs_count = 5;
- required uint64 fee = 6; // transaction fee - added in shelley
- optional uint64 ttl = 7; // transaction ttl - added in shelley
+ required uint64 fee = 6; // transaction fee - added in shelley
+ optional uint64 ttl = 7; // transaction ttl - added in shelley
required uint32 certificates_count = 8;
required uint32 withdrawals_count = 9;
required bool has_auxiliary_data = 10;
@@ -228,16 +229,16 @@ message CardanoSignTxInit {
required uint32 witness_requests_count = 12;
required uint32 minting_asset_groups_count = 13;
required CardanoDerivationType derivation_type = 14;
- optional bool include_network_id = 15 [default=false]; // network id included as tx body item
+ optional bool include_network_id = 15 [default = false]; // network id included as tx body item
optional bytes script_data_hash = 16;
required uint32 collateral_inputs_count = 17;
required uint32 required_signers_count = 18;
- optional bool has_collateral_return = 19 [default=false];
+ optional bool has_collateral_return = 19 [default = false];
optional uint64 total_collateral = 20;
- optional uint32 reference_inputs_count = 21 [default=0];
- optional bool chunkify = 22; // display the address in chunks of 4 characters
- optional bool tag_cbor_sets = 23 [default=false]; // use tag 258 for sets in cbor
- optional common.PaymentRequest payment_req = 24; // SLIP-24 payment request
+ optional uint32 reference_inputs_count = 21 [default = 0];
+ optional bool chunkify = 22; // display the address in chunks of 4 characters
+ optional bool tag_cbor_sets = 23 [default = false]; // use tag 258 for sets in cbor
+ optional common.PaymentRequest payment_req = 24; // SLIP-24 payment request
}
/**
@@ -245,8 +246,8 @@ message CardanoSignTxInit {
* @next CardanoTxItemAck
*/
message CardanoTxInput {
- required bytes prev_hash = 1; // hash of previous transaction output to spend by this input
- required uint32 prev_index = 2; // index of previous output to spend
+ required bytes prev_hash = 1; // hash of previous transaction output to spend by this input
+ required uint32 prev_index = 2; // index of previous output to spend
}
/**
@@ -254,14 +255,14 @@ message CardanoTxInput {
* @next CardanoTxItemAck
*/
message CardanoTxOutput {
- optional string address = 1; // target coin address in bech32 or base58
- optional CardanoAddressParametersType address_parameters = 2; // parameters used to derive the address
- required uint64 amount = 3; // amount to spend
+ optional string address = 1; // target coin address in bech32 or base58
+ optional CardanoAddressParametersType address_parameters = 2; // parameters used to derive the address
+ required uint64 amount = 3; // amount to spend
required uint32 asset_groups_count = 4;
optional bytes datum_hash = 5;
- optional CardanoTxOutputSerializationFormat format = 6 [default=ARRAY_LEGACY];
- optional uint32 inline_datum_size = 7 [default=0]; // 0 means no inline datum
- optional uint32 reference_script_size = 8 [default=0]; // 0 means no reference script
+ optional CardanoTxOutputSerializationFormat format = 6 [default = ARRAY_LEGACY];
+ optional uint32 inline_datum_size = 7 [default = 0]; // 0 means no inline datum
+ optional uint32 reference_script_size = 8 [default = 0]; // 0 means no reference script
}
/**
@@ -269,7 +270,7 @@ message CardanoTxOutput {
* @next CardanoTxItemAck
*/
message CardanoAssetGroup {
- required bytes policy_id = 1; // asset group policy id
+ required bytes policy_id = 1; // asset group policy id
required uint32 tokens_count = 2;
}
@@ -278,9 +279,9 @@ message CardanoAssetGroup {
* @next CardanoTxItemAck
*/
message CardanoToken {
- required bytes asset_name_bytes = 1; // asset name as bytestring (may be either ascii string or hash)
- optional uint64 amount = 2; // asset amount
- optional sint64 mint_amount = 3; // mint amount (can also be negative in which case the tokens are burnt)
+ required bytes asset_name_bytes = 1; // asset name as bytestring (may be either ascii string or hash)
+ optional uint64 amount = 2; // asset amount
+ optional sint64 mint_amount = 3; // mint amount (can also be negative in which case the tokens are burnt)
}
/**
@@ -288,7 +289,7 @@ message CardanoToken {
* @next CardanoTxItemAck
*/
message CardanoTxInlineDatumChunk {
- required bytes data = 1; // expected maximum chunk size is 1024 bytes
+ required bytes data = 1; // expected maximum chunk size is 1024 bytes
}
/**
@@ -296,7 +297,7 @@ message CardanoTxInlineDatumChunk {
* @next CardanoTxItemAck
*/
message CardanoTxReferenceScriptChunk {
- required bytes data = 1; // expected maximum chunk size is 1024 bytes
+ required bytes data = 1; // expected maximum chunk size is 1024 bytes
}
/**
@@ -304,8 +305,8 @@ message CardanoTxReferenceScriptChunk {
* @next CardanoTxItemAck
*/
message CardanoPoolOwner {
- repeated uint32 staking_key_path = 1; // BIP-32-style path to derive staking key of the owner
- optional bytes staking_key_hash = 2; // owner's staking key if it is an external owner
+ repeated uint32 staking_key_path = 1; // BIP-32-style path to derive staking key of the owner
+ optional bytes staking_key_hash = 2; // owner's staking key if it is an external owner
}
/**
@@ -313,11 +314,11 @@ message CardanoPoolOwner {
* @next CardanoTxItemAck
*/
message CardanoPoolRelayParameters {
- required CardanoPoolRelayType type = 1; // pool relay type
- optional bytes ipv4_address = 2; // ipv4 address of the relay given as 4 bytes
- optional bytes ipv6_address = 3; // ipv6 address of the relay given as 16 bytes
- optional string host_name = 4; // relay host name given as URL, at most 64 characters
- optional uint32 port = 5; // relay port number in the range 0-65535
+ required CardanoPoolRelayType type = 1; // pool relay type
+ optional bytes ipv4_address = 2; // ipv4 address of the relay given as 4 bytes
+ optional bytes ipv6_address = 3; // ipv6 address of the relay given as 16 bytes
+ optional string host_name = 4; // relay host name given as URL, at most 64 characters
+ optional uint32 port = 5; // relay port number in the range 0-65535
}
/**
@@ -325,8 +326,8 @@ message CardanoPoolRelayParameters {
* @embed
*/
message CardanoPoolMetadataType {
- required string url = 1; // stake pool url hosting metadata, at most 64 characters
- required bytes hash = 2; // stake pool metadata hash
+ required string url = 1; // stake pool url hosting metadata, at most 64 characters
+ required bytes hash = 2; // stake pool metadata hash
}
/**
@@ -334,24 +335,25 @@ message CardanoPoolMetadataType {
* @embed
*/
message CardanoPoolParametersType {
- required bytes pool_id = 1; // stake pool cold public key hash (28 bytes)
- required bytes vrf_key_hash = 2; // VRF key hash (32 bytes)
- required uint64 pledge = 3; // pledge amount in lovelace
- required uint64 cost = 4; // cost in lovelace
- required uint64 margin_numerator = 5; // pool margin numerator
- required uint64 margin_denominator = 6; // pool margin denominator
- required string reward_account = 7; // bech32 reward address where the pool receives rewards
- // repeated CardanoPoolOwner owners = 8; // legacy pool owners list - support for pre-tx-streaming firmwares dropped
- // repeated CardanoPoolRelayParameters relays = 9; // legacy pool relays list - support for pre-tx-streaming firmwares dropped
- optional CardanoPoolMetadataType metadata = 10; // pool metadata
- required uint32 owners_count = 11; // number of pool owners
- required uint32 relays_count = 12; // number of pool relays
+ required bytes pool_id = 1; // stake pool cold public key hash (28 bytes)
+ required bytes vrf_key_hash = 2; // VRF key hash (32 bytes)
+ required uint64 pledge = 3; // pledge amount in lovelace
+ required uint64 cost = 4; // cost in lovelace
+ required uint64 margin_numerator = 5; // pool margin numerator
+ required uint64 margin_denominator = 6; // pool margin denominator
+ required string reward_account = 7; // bech32 reward address where the pool receives rewards
+ // repeated CardanoPoolOwner owners = 8; // legacy pool owners list - support for pre-tx-streaming firmwares dropped
+ // repeated CardanoPoolRelayParameters relays = 9; // legacy pool relays list - support for pre-tx-streaming
+ // firmwares dropped
+ optional CardanoPoolMetadataType metadata = 10; // pool metadata
+ required uint32 owners_count = 11; // number of pool owners
+ required uint32 relays_count = 12; // number of pool relays
}
/**
* DRep delegation parameters
* @embed
-*/
+ */
message CardanoDRep {
required CardanoDRepType type = 1; // drep type
optional bytes key_hash = 2; // drep key hash
@@ -363,14 +365,14 @@ message CardanoDRep {
* @next CardanoTxItemAck
*/
message CardanoTxCertificate {
- required CardanoCertificateType type = 1; // certificate type
- repeated uint32 path = 2; // stake credential key path
- optional bytes pool = 3; // pool hash
- optional CardanoPoolParametersType pool_parameters = 4; // used for stake pool registration certificate
- optional bytes script_hash = 5; // stake credential script hash
- optional bytes key_hash = 6; // stake credential key hash
- optional uint64 deposit = 7; // used for stake key registration certificate
- optional CardanoDRep drep = 8; // used for vote delegation certificate
+ required CardanoCertificateType type = 1; // certificate type
+ repeated uint32 path = 2; // stake credential key path
+ optional bytes pool = 3; // pool hash
+ optional CardanoPoolParametersType pool_parameters = 4; // used for stake pool registration certificate
+ optional bytes script_hash = 5; // stake credential script hash
+ optional bytes key_hash = 6; // stake credential key hash
+ optional uint64 deposit = 7; // used for stake key registration certificate
+ optional CardanoDRep drep = 8; // used for vote delegation certificate
}
/**
@@ -378,10 +380,10 @@ message CardanoTxCertificate {
* @next CardanoTxItemAck
*/
message CardanoTxWithdrawal {
- repeated uint32 path = 1; // stake credential key path
+ repeated uint32 path = 1; // stake credential key path
required uint64 amount = 2;
- optional bytes script_hash = 3; // stake credential script hash
- optional bytes key_hash = 4; // stake credential key hash
+ optional bytes script_hash = 3; // stake credential script hash
+ optional bytes key_hash = 4; // stake credential key hash
}
/**
@@ -396,14 +398,15 @@ message CardanoCVoteRegistrationDelegation {
* @embed
*/
message CardanoCVoteRegistrationParametersType {
- optional bytes vote_public_key = 1; // mutually exclusive with delegations
+ optional bytes vote_public_key = 1; // mutually exclusive with delegations
repeated uint32 staking_path = 2;
- optional CardanoAddressParametersType payment_address_parameters = 3; // mutually exclusive with payment_address
+ optional CardanoAddressParametersType payment_address_parameters = 3; // mutually exclusive with payment_address
required uint64 nonce = 4;
- optional CardanoCVoteRegistrationFormat format = 5 [default=CIP15];
- repeated CardanoCVoteRegistrationDelegation delegations = 6; // mutually exclusive with vote_public_key; max 32 delegations
+ optional CardanoCVoteRegistrationFormat format = 5 [default = CIP15];
+ repeated CardanoCVoteRegistrationDelegation delegations = 6; // mutually exclusive with vote_public_key;
+ // max 32 delegations
optional uint64 voting_purpose = 7;
- optional string payment_address = 8; // mutually exclusive with payment_address_parameters
+ optional string payment_address = 8; // mutually exclusive with payment_address_parameters
}
/**
@@ -470,8 +473,7 @@ message CardanoTxReferenceInput {
* @next CardanoTxRequiredSigner
* @next CardanoTxReferenceInput
*/
-message CardanoTxItemAck {
-}
+message CardanoTxItemAck {}
/**
* Response: Device-generated supplement for the auxiliary data
@@ -508,8 +510,7 @@ message CardanoTxWitnessResponse {
* @next CardanoTxBodyHash
* @next CardanoSignTxFinished
*/
-message CardanoTxHostAck {
-}
+message CardanoTxHostAck {}
/**
* Response: Hash of the serialized transaction body
@@ -523,8 +524,7 @@ message CardanoTxBodyHash {
* Response: Confirm the successful completion of the signing process
* @end
*/
-message CardanoSignTxFinished {
-}
+message CardanoSignTxFinished {}
/**
* Request: Ask device to sign a message containing arbitrary data
@@ -533,11 +533,11 @@ message CardanoSignTxFinished {
* @next CardanoMessageSignature
*/
message CardanoSignMessageInit {
- optional uint32 protocol_magic = 1; // network's protocol magic
- optional uint32 network_id = 2; // network id - mainnet or testnet
- repeated uint32 signing_path = 3; // BIP-32-style path to derive the signing key from master node
- required uint32 payload_size = 4; // size of the payload to be signed
- required bool prefer_hex_display = 5; // whether to decode payload as hex even if valid ascii
+ optional uint32 protocol_magic = 1; // network's protocol magic
+ optional uint32 network_id = 2; // network id - mainnet or testnet
+ repeated uint32 signing_path = 3; // BIP-32-style path to derive the signing key from master node
+ required uint32 payload_size = 4; // size of the payload to be signed
+ required bool prefer_hex_display = 5; // whether to decode payload as hex even if valid ascii
optional CardanoAddressParametersType address_parameters = 6;
required CardanoDerivationType derivation_type = 7;
}
@@ -547,8 +547,8 @@ message CardanoSignMessageInit {
* @next CardanoMessageDataResponse
*/
message CardanoMessageDataRequest {
- required uint32 length = 1; // size of data chunk to read
- required uint32 offset = 2; // offset from start of payload
+ required uint32 length = 1; // size of data chunk to read
+ required uint32 offset = 2; // offset from start of payload
}
/**
@@ -560,13 +560,12 @@ message CardanoMessageDataResponse {
required bytes data = 1; // the requested data chunk
}
-
/**
* Response: Contains signature for message and address used in signed headers
* @end
*/
message CardanoMessageSignature {
- required bytes signature = 1; // signature for structure containing payload and protected headers
- required bytes address = 2; // value of the address field in protected headers
- required bytes pub_key = 3; // public key given by signing path
+ required bytes signature = 1; // signature for structure containing payload and protected headers
+ required bytes address = 2; // value of the address field in protected headers
+ required bytes pub_key = 3; // public key given by signing path
}
diff --git a/common/protob/messages-common.proto b/common/protob/messages-common.proto
index 6e6300b8..c52730f2 100644
--- a/common/protob/messages-common.proto
+++ b/common/protob/messages-common.proto
@@ -1,12 +1,13 @@
syntax = "proto2";
package hw.trezor.messages.common;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageCommon";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -14,7 +15,7 @@ option (include_in_bitcoin_only) = true;
* @end
*/
message Success {
- optional string message = 1 [default=""]; // human readable description of action or request-specific payload
+ optional string message = 1 [default = ""]; // human readable description of action or request-specific payload
}
/**
@@ -57,14 +58,15 @@ message ButtonRequest {
optional ButtonRequestType code = 1; // enum identifier of the screen (deprecated)
optional uint32 pages = 2; // if the screen is paginated, number of pages
- // this existed briefly: https://github.com/trezor/trezor-firmware/commit/1012ee8497b241e8ca559e386d936fa549bc0357
+ // this existed briefly:
+ // https://github.com/trezor/trezor-firmware/commit/1012ee8497b241e8ca559e386d936fa549bc0357
reserved 3;
- optional string name = 4; // name of the screen
+ optional string name = 4; // name of the screen
/**
- * Type of button request
- */
+ * Type of button request
+ */
enum ButtonRequestType {
ButtonRequest_Other = 1;
ButtonRequest_FeeOverThreshold = 2;
@@ -79,7 +81,7 @@ message ButtonRequest {
ButtonRequest_PublicKey = 11;
ButtonRequest_MnemonicWordCount = 12;
ButtonRequest_MnemonicInput = 13;
- _Deprecated_ButtonRequest_PassphraseType = 14 [deprecated=true];
+ _Deprecated_ButtonRequest_PassphraseType = 14 [deprecated = true];
ButtonRequest_UnknownDerivationPath = 15;
ButtonRequest_RecoveryHomepage = 16;
ButtonRequest_Success = 17;
@@ -93,8 +95,7 @@ message ButtonRequest {
* Request: Computer agrees to wait for HW button press
* @auxend
*/
-message ButtonAck {
-}
+message ButtonAck {}
/**
* Response: Device is asking computer to show PIN matrix and awaits PIN encoded using this matrix scheme
@@ -104,8 +105,8 @@ message ButtonAck {
message PinMatrixRequest {
optional PinMatrixRequestType type = 1;
/**
- * Type of PIN request
- */
+ * Type of PIN request
+ */
enum PinMatrixRequestType {
PinMatrixRequestType_Current = 1;
PinMatrixRequestType_NewFirst = 2;
@@ -120,7 +121,7 @@ message PinMatrixRequest {
* @auxend
*/
message PinMatrixAck {
- required string pin = 1; // matrix encoded PIN entered by user
+ required string pin = 1; // matrix encoded PIN entered by user
}
/**
@@ -129,7 +130,7 @@ message PinMatrixAck {
* @next PassphraseAck
*/
message PassphraseRequest {
- optional bool _on_device = 1 [deprecated=true]; // <2.3.0
+ optional bool _on_device = 1 [deprecated = true]; // <2.3.0
}
/**
@@ -138,8 +139,8 @@ message PassphraseRequest {
*/
message PassphraseAck {
optional string passphrase = 1;
- optional bytes _state = 2 [deprecated=true]; // <2.3.0
- optional bool on_device = 3; // user wants to enter passphrase on the device
+ optional bytes _state = 2 [deprecated = true]; // <2.3.0
+ optional bool on_device = 3; // user wants to enter passphrase on the device
}
/**
@@ -149,7 +150,7 @@ message PassphraseAck {
*/
message Deprecated_PassphraseStateRequest {
option deprecated = true;
- optional bytes state = 1; // actual device state
+ optional bytes state = 1; // actual device state
}
/**
@@ -180,13 +181,15 @@ message HDNodeType {
* @embed
*/
message PaymentRequest {
- optional bytes nonce = 1; // the nonce used in the signature computation
- required string recipient_name = 2; // merchant's name
- repeated PaymentRequestMemo memos = 3; // any memos that were signed as part of the request
- reserved 4; // this existed briefly. obsoleted by this change: https://github.com/satoshilabs/slips/commit/08d36aa61722275a21617ac6a713e31ec23fdec4
- optional bytes amount = 6; // the sum of the external output amounts requested, encoded in little endian on either 8 or 32 bytes
- // required for non-CoinJoin transactions; do not set this for fiat amounts (BUY crypto with fiat)
- required bytes signature = 5; // the trusted party's signature of the paymentRequestDigest
+ optional bytes nonce = 1; // the nonce used in the signature computation
+ required string recipient_name = 2; // merchant's name
+ repeated PaymentRequestMemo memos = 3; // any memos that were signed as part of the request
+ reserved 4; // this existed briefly. obsoleted by this change:
+ // https://github.com/satoshilabs/slips/commit/08d36aa61722275a21617ac6a713e31ec23fdec4
+ optional bytes amount = 6; // the sum of the external output amounts requested, encoded in little endian on either
+ // 8 or 32 bytes required for non-CoinJoin transactions; do not set this for fiat
+ // amounts (BUY crypto with fiat)
+ required bytes signature = 5; // the trusted party's signature of the paymentRequestDigest
message PaymentRequestMemo {
optional TextMemo text_memo = 1;
@@ -196,25 +199,26 @@ message PaymentRequest {
}
message TextMemo {
- required string text = 1; // plain-text note explaining the purpose of the payment request
+ required string text = 1; // plain-text note explaining the purpose of the payment request
}
message TextDetailsMemo {
- required string title = 1; // plain-text heading
- required string text = 2; // plain-text note containing additional details about the payment
+ required string title = 1; // plain-text heading
+ required string text = 2; // plain-text note containing additional details about the payment
}
message RefundMemo {
- required string address = 1; // the address where the payment should be refunded if necessary
- repeated uint32 address_n = 2; // BIP-32 path to derive the key from the master node
- required bytes mac = 3; // the MAC returned by GetAddress
+ required string address = 1; // the address where the payment should be refunded if necessary
+ repeated uint32 address_n = 2; // BIP-32 path to derive the key from the master node
+ required bytes mac = 3; // the MAC returned by GetAddress
}
message CoinPurchaseMemo {
- required uint32 coin_type = 1; // the SLIP-0044 coin type of the address
- required string amount = 2; // the amount the address will receive as a human-readable string including units, e.g. "0.025 BTC"
- required string address = 3; // the address where the coin purchase will be delivered
- repeated uint32 address_n = 4; // BIP-32 path to derive the key from the master node
- required bytes mac = 5; // the MAC returned by GetAddress
+ required uint32 coin_type = 1; // the SLIP-0044 coin type of the address
+ required string amount = 2; // the amount the address will receive as a human-readable
+ // string including units, e.g. "0.025 BTC"
+ required string address = 3; // the address where the coin purchase will be delivered
+ repeated uint32 address_n = 4; // BIP-32 path to derive the key from the master node
+ required bytes mac = 5; // the MAC returned by GetAddress
}
}
diff --git a/common/protob/messages-crypto.proto b/common/protob/messages-crypto.proto
index 9acaf7e4..7b363c1a 100644
--- a/common/protob/messages-crypto.proto
+++ b/common/protob/messages-crypto.proto
@@ -1,13 +1,14 @@
syntax = "proto2";
package hw.trezor.messages.crypto;
-// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
-option java_outer_classname = "TrezorMessageCrypto";
-
import "messages-common.proto";
import "options.proto";
+// Sugar for easier handling in Java
+option java_outer_classname = "TrezorMessageCrypto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
+
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -17,13 +18,13 @@ option (include_in_bitcoin_only) = true;
* @next Failure
*/
message CipherKeyValue {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required string key = 2; // key component of key:value
- required bytes value = 3; // value component of key:value
- optional bool encrypt = 4; // are we encrypting (True) or decrypting (False)?
- optional bool ask_on_encrypt = 5; // should we ask on encrypt operation?
- optional bool ask_on_decrypt = 6; // should we ask on decrypt operation?
- optional bytes iv = 7; // initialization vector (will be computed if not set)
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required string key = 2; // key component of key:value
+ required bytes value = 3; // value component of key:value
+ optional bool encrypt = 4; // are we encrypting (True) or decrypting (False)?
+ optional bool ask_on_encrypt = 5; // should we ask on encrypt operation?
+ optional bool ask_on_decrypt = 6; // should we ask on decrypt operation?
+ optional bytes iv = 7; // initialization vector (will be computed if not set)
}
/**
@@ -31,7 +32,7 @@ message CipherKeyValue {
* @end
*/
message CipheredKeyValue {
- required bytes value = 1; // ciphered/deciphered value
+ required bytes value = 1; // ciphered/deciphered value
}
/**
@@ -39,12 +40,12 @@ message CipheredKeyValue {
* @embed
*/
message IdentityType {
- optional string proto = 1; // proto part of URI
- optional string user = 2; // user part of URI
- optional string host = 3; // host part of URI
- optional string port = 4; // port part of URI
- optional string path = 5; // path part of URI
- optional uint32 index = 6 [default=0]; // identity index
+ optional string proto = 1; // proto part of URI
+ optional string user = 2; // user part of URI
+ optional string host = 3; // host part of URI
+ optional string port = 4; // port part of URI
+ optional string path = 5; // path part of URI
+ optional uint32 index = 6 [default = 0]; // identity index
}
/**
@@ -54,10 +55,10 @@ message IdentityType {
* @next Failure
*/
message SignIdentity {
- required IdentityType identity = 1; // identity
- optional bytes challenge_hidden = 2 [default=""]; // non-visible challenge
- optional string challenge_visual = 3 [default=""]; // challenge shown on display (e.g. date+time)
- optional string ecdsa_curve_name = 4; // ECDSA curve name to use
+ required IdentityType identity = 1; // identity
+ optional bytes challenge_hidden = 2 [default = ""]; // non-visible challenge
+ optional string challenge_visual = 3 [default = ""]; // challenge shown on display (e.g. date+time)
+ optional string ecdsa_curve_name = 4; // ECDSA curve name to use
}
/**
@@ -77,9 +78,9 @@ message SignedIdentity {
* @next Failure
*/
message GetECDHSessionKey {
- required IdentityType identity = 1; // identity
- required bytes peer_public_key = 2; // peer's public key
- optional string ecdsa_curve_name = 3; // ECDSA curve name to use
+ required IdentityType identity = 1; // identity
+ required bytes peer_public_key = 2; // peer's public key
+ optional string ecdsa_curve_name = 3; // ECDSA curve name to use
}
/**
@@ -87,8 +88,8 @@ message GetECDHSessionKey {
* @end
*/
message ECDHSessionKey {
- required bytes session_key = 1; // ECDH session key
- optional bytes public_key = 2; // identity public key
+ required bytes session_key = 1; // ECDH session key
+ optional bytes public_key = 2; // identity public key
}
/**
diff --git a/common/protob/messages-debug.proto b/common/protob/messages-debug.proto
index 3f144e99..0df4378c 100644
--- a/common/protob/messages-debug.proto
+++ b/common/protob/messages-debug.proto
@@ -1,14 +1,15 @@
syntax = "proto2";
package hw.trezor.messages.debug;
-// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
-option java_outer_classname = "TrezorMessageDebug";
-
import "messages-common.proto";
import "messages-management.proto";
import "options.proto";
+// Sugar for easier handling in Java
+option java_outer_classname = "TrezorMessageDebug";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
+
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -17,12 +18,12 @@ option (include_in_bitcoin_only) = true;
* @next DebugLinkLayout
*/
message DebugLinkDecision {
- optional DebugButton button = 1; // button press
+ optional DebugButton button = 1; // button press
optional DebugSwipeDirection swipe = 2; // swipe direction
- optional string input = 3; // keyboard input
+ optional string input = 3; // keyboard input
/**
- * Structure representing swipe direction
- */
+ * Structure representing swipe direction
+ */
enum DebugSwipeDirection {
UP = 0;
DOWN = 1;
@@ -31,8 +32,8 @@ message DebugLinkDecision {
}
/**
- * Structure representing button presses
- */
+ * Structure representing button presses
+ */
enum DebugButton {
NO = 0;
YES = 1;
@@ -40,8 +41,8 @@ message DebugLinkDecision {
}
/**
- * Structure representing button presses of UI Caesar
- */
+ * Structure representing button presses of UI Caesar
+ */
// TODO: probably delete the middle_btn as it is not a physical one
enum DebugPhysicalButton {
LEFT_BTN = 0;
@@ -51,7 +52,7 @@ message DebugLinkDecision {
optional uint32 x = 4; // touch X coordinate
optional uint32 y = 5; // touch Y coordinate
- optional bool wait = 6 [deprecated=true]; // wait for layout change
+ optional bool wait = 6 [deprecated = true]; // wait for layout change
optional uint32 hold_ms = 7; // touch hold duration
optional DebugPhysicalButton physical_button = 8; // physical button press
@@ -92,8 +93,8 @@ message DebugLinkReseedRandom {
* @next Success
*/
message DebugLinkRecordScreen {
- optional string target_directory = 1; // empty or missing to stop recording
- optional uint32 refresh_index = 2 [default=0]; // which index to give the screenshots (after emulator restarts)
+ optional string target_directory = 1; // empty or missing to stop recording
+ optional uint32 refresh_index = 2 [default = 0]; // which index to give the screenshots (after emulator restarts)
}
/**
@@ -116,14 +117,14 @@ message DebugLinkGetState {
}
// Trezor T < 2.6.0 only - wait until mnemonic words are shown
- optional bool wait_word_list = 1 [deprecated=true];
+ optional bool wait_word_list = 1 [deprecated = true];
// Trezor T < 2.6.0 only - wait until reset word position is requested
- optional bool wait_word_pos = 2 [deprecated=true];
+ optional bool wait_word_pos = 2 [deprecated = true];
// trezor-core only - wait until current layout changes
// changed in 2.6.4: multiple wait types instead of true/false.
- optional DebugWaitType wait_layout = 3 [default=IMMEDIATE];
+ optional DebugWaitType wait_layout = 3 [default = IMMEDIATE];
// Responds immediately with an empty `DebugLinkState` (used for client-side synchronization).
- optional bool return_empty_state = 4 [default=false];
+ optional bool return_empty_state = 4 [default = false];
}
/**
@@ -131,19 +132,20 @@ message DebugLinkGetState {
* @end
*/
message DebugLinkState {
- optional bytes layout = 1; // raw buffer of display
- optional string pin = 2; // current PIN, blank if PIN is not set/enabled
- optional string matrix = 3; // current PIN matrix
- optional bytes mnemonic_secret = 4; // current mnemonic secret
- optional common.HDNodeType node = 5; // current BIP-32 node
- optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase?
- optional string reset_word = 7; // word on device display during ResetDevice workflow
- optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow
- optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow
- optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting during RecoveryDevice workflow
- optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow
- optional management.BackupType mnemonic_type = 12; // current mnemonic type (BIP-39/SLIP-39)
- repeated string tokens = 13; // current layout represented as a list of string tokens
+ optional bytes layout = 1; // raw buffer of display
+ optional string pin = 2; // current PIN, blank if PIN is not set/enabled
+ optional string matrix = 3; // current PIN matrix
+ optional bytes mnemonic_secret = 4; // current mnemonic secret
+ optional common.HDNodeType node = 5; // current BIP-32 node
+ optional bool passphrase_protection = 6; // is node/mnemonic encrypted using passphrase?
+ optional string reset_word = 7; // word on device display during ResetDevice workflow
+ optional bytes reset_entropy = 8; // current entropy during ResetDevice workflow
+ optional string recovery_fake_word = 9; // (fake) word on display during RecoveryDevice workflow
+ optional uint32 recovery_word_pos = 10; // index of mnemonic word the device is expecting
+ // during RecoveryDevice workflow
+ optional uint32 reset_word_pos = 11; // index of mnemonic word the device is expecting during ResetDevice workflow
+ optional management.BackupType mnemonic_type = 12; // current mnemonic type (BIP-39/SLIP-39)
+ repeated string tokens = 13; // current layout represented as a list of string tokens
}
/**
@@ -151,30 +153,29 @@ message DebugLinkState {
* @start
* @next DebugLinkPairingInfo
*/
- message DebugLinkGetPairingInfo {
- optional bytes channel_id = 1; // ID of the THP channel to get pairing info from
- optional bytes handshake_hash = 2; // handshake hash of the THP channel
- optional bytes nfc_secret_host = 3; // host's NFC secret (In case of NFC pairing)
+message DebugLinkGetPairingInfo {
+ optional bytes channel_id = 1; // ID of the THP channel to get pairing info from
+ optional bytes handshake_hash = 2; // handshake hash of the THP channel
+ optional bytes nfc_secret_host = 3; // host's NFC secret (In case of NFC pairing)
}
- /**
+/**
* Response: Device pairing info
* @end
*/
- message DebugLinkPairingInfo {
- optional bytes channel_id = 1; // ID of the THP channel the pairing info is from
- optional bytes handshake_hash = 2; // handshake hash of the THP channel
- optional uint32 code_entry_code = 3; // CodeEntry pairing code
- optional bytes code_qr_code = 4; // QrCode pairing code
- optional bytes nfc_secret_trezor = 5; // NFC secret used in NFC pairing
+message DebugLinkPairingInfo {
+ optional bytes channel_id = 1; // ID of the THP channel the pairing info is from
+ optional bytes handshake_hash = 2; // handshake hash of the THP channel
+ optional uint32 code_entry_code = 3; // CodeEntry pairing code
+ optional bytes code_qr_code = 4; // QrCode pairing code
+ optional bytes nfc_secret_trezor = 5; // NFC secret used in NFC pairing
}
/**
* Request: Ask device to restart
* @start
*/
-message DebugLinkStop {
-}
+message DebugLinkStop {}
/**
* Response: Device wants host to log event
@@ -228,7 +229,6 @@ message DebugLinkFlashErase {
optional uint32 sector = 1;
}
-
/**
* Request: Erase the SD card
* @start
@@ -240,7 +240,6 @@ message DebugLinkEraseSdCard {
// if false, it will be all 0xFF bytes.
}
-
/**
* Request: Start or stop tracking layout changes
* @start
@@ -252,7 +251,6 @@ message DebugLinkWatchLayout {
// if false, stop.
}
-
/**
* Request: Remove all the previous debug event state
* @start
@@ -262,23 +260,19 @@ message DebugLinkResetDebugEvents {
option deprecated = true;
}
-
/**
* Request: Set Optiga's security even counter to maximum
* @start
* @next Success
*/
-message DebugLinkOptigaSetSecMax {
-}
-
+message DebugLinkOptigaSetSecMax {}
/**
* Request: Get GC heap information.
* @start
* @next DebugLinkGcInfo
*/
-message DebugLinkGetGcInfo {
-}
+message DebugLinkGetGcInfo {}
/**
* Response: GC heap information details.
@@ -288,15 +282,14 @@ message DebugLinkGcInfo {
repeated DebugLinkGcInfoItem items = 1;
/**
- * Key-value pair.
- */
+ * Key-value pair.
+ */
message DebugLinkGcInfoItem {
required string name = 1;
required uint64 value = 2;
}
}
-
/**
* Request: Set logging filter string.
* @start
diff --git a/common/protob/messages-definitions.proto b/common/protob/messages-definitions.proto
index 27562869..ec181148 100644
--- a/common/protob/messages-definitions.proto
+++ b/common/protob/messages-definitions.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.definitions;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageDefinitions";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Definitions type enum.
@@ -55,7 +55,7 @@ message EthereumTokenInfo {
* @embed
*/
message SolanaTokenInfo {
- required bytes mint = 1; // token mint - unique token id
+ required bytes mint = 1; // token mint - unique token id
required string symbol = 2;
required string name = 3;
}
diff --git a/common/protob/messages-eos.proto b/common/protob/messages-eos.proto
index ff4095ad..7a565cb8 100644
--- a/common/protob/messages-eos.proto
+++ b/common/protob/messages-eos.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.eos;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageEos";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask device for Eos public key corresponding to address_n path
@@ -12,9 +12,9 @@ option java_outer_classname = "TrezorMessageEos";
* @next Failure
*/
message EosGetPublicKey {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node 44'/194'/0'
- optional bool show_display = 2; // optionally show on display before sending the result
- optional bool chunkify = 3; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node 44'/194'/0'
+ optional bool show_display = 2; // optionally show on display before sending the result
+ optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
@@ -22,8 +22,8 @@ message EosGetPublicKey {
* @end
*/
message EosPublicKey {
- required string wif_public_key = 1; // EOS pub key in Base58 encoding
- required bytes raw_public_key = 2; // Raw public key
+ required string wif_public_key = 1; // EOS pub key in Base58 encoding
+ required bytes raw_public_key = 2; // Raw public key
}
/**
@@ -33,22 +33,24 @@ message EosPublicKey {
* @next Failure
*/
message EosSignTx {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node 44'/194'/0'
- required bytes chain_id = 2; // 256-bit long chain id
- required EosTxHeader header = 3; // EOS transaction header
- required uint32 num_actions = 4; // number of actions
- optional bool chunkify = 5; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node 44'/194'/0'
+ required bytes chain_id = 2; // 256-bit long chain id
+ required EosTxHeader header = 3; // EOS transaction header
+ required uint32 num_actions = 4; // number of actions
+ optional bool chunkify = 5; // display the address in chunks of 4 characters
/**
* Structure representing EOS transaction header
*/
message EosTxHeader {
- required uint32 expiration = 1; // time at which transaction expires
- required uint32 ref_block_num = 2; // 16-bit specifies a block num in the last 2^16 blocks.
- required uint32 ref_block_prefix = 3; // specifies the lower 32 bits of the blockid at get_ref_blocknum
- required uint32 max_net_usage_words = 4; // upper limit on total network bandwidth (in 8 byte words) billed for this transaction
- required uint32 max_cpu_usage_ms = 5; // 8-bit upper limit on the total CPU time billed for this transaction
- required uint32 delay_sec = 6; // number of seconds to delay this transaction for during which it may be canceled.
+ required uint32 expiration = 1; // time at which transaction expires
+ required uint32 ref_block_num = 2; // 16-bit specifies a block num in the last 2^16 blocks.
+ required uint32 ref_block_prefix = 3; // specifies the lower 32 bits of the blockid at get_ref_blocknum
+ required uint32 max_net_usage_words = 4; // upper limit on total network bandwidth (in 8
+ // byte words) billed for this transaction
+ required uint32 max_cpu_usage_ms = 5; // 8-bit upper limit on the total CPU time billed for this transaction
+ required uint32 delay_sec = 6; // number of seconds to delay this
+ // transaction for during which it may be canceled.
}
}
@@ -88,7 +90,7 @@ message EosTxActionAck {
*/
message EosAsset {
required sint64 amount = 1;
- required uint64 symbol = 2; // Lowest 8 bits used for precision.
+ required uint64 symbol = 2; // Lowest 8 bits used for precision.
}
/**
@@ -104,8 +106,8 @@ message EosTxActionAck {
*/
message EosAuthorizationKey {
required uint32 type = 1;
- optional bytes key = 2; // Explicit public key bytes; when present, address_n must be empty
- repeated uint32 address_n = 3; // BIP-32 path to derive key; when filled out, key must not be present
+ optional bytes key = 2; // Explicit public key bytes; when present, address_n must be empty
+ repeated uint32 address_n = 3; // BIP-32 path to derive key; when filled out, key must not be present
required uint32 weight = 4;
}
@@ -139,8 +141,8 @@ message EosTxActionAck {
* Structure representing the common part of every action
*/
message EosActionCommon {
- required uint64 account = 1; // Contract name
- required uint64 name = 2; // Action name
+ required uint64 account = 1; // Contract name
+ required uint64 name = 2; // Action name
repeated EosPermissionLevel authorization = 3;
}
@@ -148,7 +150,7 @@ message EosTxActionAck {
* Structure representing transfer data structure
*/
message EosActionTransfer {
- required uint64 sender = 1; // Asset sender
+ required uint64 sender = 1; // Asset sender
required uint64 receiver = 2;
required EosAsset quantity = 3;
required string memo = 4;
@@ -160,9 +162,9 @@ message EosTxActionAck {
message EosActionDelegate {
required uint64 sender = 1;
required uint64 receiver = 2;
- required EosAsset net_quantity = 3; // Asset format '1.0000 EOS'
- required EosAsset cpu_quantity = 4; // Asset format '1.0000 EOS'
- required bool transfer = 5; // Transfer delegated tokens or not.
+ required EosAsset net_quantity = 3; // Asset format '1.0000 EOS'
+ required EosAsset cpu_quantity = 4; // Asset format '1.0000 EOS'
+ required bool transfer = 5; // Transfer delegated tokens or not.
}
/**
@@ -171,8 +173,8 @@ message EosTxActionAck {
message EosActionUndelegate {
required uint64 sender = 1;
required uint64 receiver = 2;
- required EosAsset net_quantity = 3; // Asset format '1.0000 EOS'
- required EosAsset cpu_quantity = 4; // Asset format '1.0000 EOS'
+ required EosAsset net_quantity = 3; // Asset format '1.0000 EOS'
+ required EosAsset cpu_quantity = 4; // Asset format '1.0000 EOS'
}
/**
@@ -188,7 +190,7 @@ message EosTxActionAck {
message EosActionBuyRam {
required uint64 payer = 1;
required uint64 receiver = 2;
- required EosAsset quantity = 3; // Asset format '1.0000 EOS'
+ required EosAsset quantity = 3; // Asset format '1.0000 EOS'
}
/**
@@ -197,7 +199,7 @@ message EosTxActionAck {
message EosActionBuyRamBytes {
required uint64 payer = 1;
required uint64 receiver = 2;
- required uint32 bytes = 3; // Number of bytes
+ required uint32 bytes = 3; // Number of bytes
}
/**
@@ -205,16 +207,16 @@ message EosTxActionAck {
*/
message EosActionSellRam {
required uint64 account = 1;
- required uint64 bytes = 2; // Number of bytes
+ required uint64 bytes = 2; // Number of bytes
}
/**
* Structure representing voting. Currently, there could be up to 30 producers.
*/
message EosActionVoteProducer {
- required uint64 voter = 1; // Voter account
- required uint64 proxy = 2; // Proxy voter account
- repeated uint64 producers = 3; // List of producers
+ required uint64 voter = 1; // Voter account
+ required uint64 proxy = 2; // Proxy voter account
+ repeated uint64 producers = 3; // List of producers
}
/**
@@ -279,5 +281,5 @@ message EosTxActionAck {
* @end
*/
message EosSignedTx {
- required string signature = 1; // Computed signature
+ required string signature = 1; // Computed signature
}
diff --git a/common/protob/messages-ethereum-eip712.proto b/common/protob/messages-ethereum-eip712.proto
index 95e515ff..f7248a0c 100644
--- a/common/protob/messages-ethereum-eip712.proto
+++ b/common/protob/messages-ethereum-eip712.proto
@@ -1,18 +1,16 @@
syntax = "proto2";
package hw.trezor.messages.ethereum_eip712;
-// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
-option java_outer_classname = "TrezorMessageEthereumEIP712";
-
import "messages-ethereum.proto";
+// Sugar for easier handling in Java
+option java_outer_classname = "TrezorMessageEthereumEIP712";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
// Separated from messages-ethereum.proto as it is not implemented on T1 side
// and defining all the messages and fields could be even impossible as recursive
// messages are used here
-
/**
* Request: Ask device to sign typed data
* @start
@@ -22,11 +20,13 @@ import "messages-ethereum.proto";
* @next Failure
*/
message EthereumSignTypedData {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required string primary_type = 2; // name of the root message struct
- optional bool metamask_v4_compat = 3 [default=true]; // use MetaMask v4 (see https://github.com/MetaMask/eth-sig-util/issues/106)
- optional ethereum.EthereumDefinitions definitions = 4; // network and/or token definitions
- optional bytes show_message_hash = 5; // hash of the typed data to be signed (if set, user will be asked to confirm before signing)
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required string primary_type = 2; // name of the root message struct
+ optional bool metamask_v4_compat = 3 [default = true]; // use MetaMask v4, see
+ // https://github.com/MetaMask/eth-sig-util/issues/106
+ optional ethereum.EthereumDefinitions definitions = 4; // network and/or token definitions
+ optional bytes show_message_hash = 5; // hash of the typed data to be signed (if set, user will
+ // be asked to confirm before signing)
}
/**
@@ -34,7 +34,7 @@ message EthereumSignTypedData {
* @next EthereumTypedDataStructAck
*/
message EthereumTypedDataStructRequest {
- required string name = 1; // name of the requested struct
+ required string name = 1; // name of the requested struct
}
/**
@@ -51,11 +51,11 @@ message EthereumTypedDataStructAck {
message EthereumFieldType {
required EthereumDataType data_type = 1;
- optional uint32 size = 2; // for integer types: size in bytes (uint8 has size 1, uint256 has size 32)
- // for bytes types: size in bytes, or unset for dynamic
- // for arrays: size in elements, or unset for dynamic
- // for structs: number of members
- // for string, bool and address: unset
+ optional uint32 size = 2; // for integer types: size in bytes (uint8 has size 1, uint256 has size 32)
+ // for bytes types: size in bytes, or unset for dynamic
+ // for arrays: size in elements, or unset for dynamic
+ // for structs: number of members
+ // for string, bool and address: unset
optional EthereumFieldType entry_type = 3; // for array types, type of single entry
optional string struct_name = 4; // for structs: its name
}
@@ -77,7 +77,7 @@ message EthereumTypedDataStructAck {
* @next EthereumTypedDataValueAck
*/
message EthereumTypedDataValueRequest {
- repeated uint32 member_path = 1; // member path requested by device
+ repeated uint32 member_path = 1; // member path requested by device
}
/**
diff --git a/common/protob/messages-ethereum.proto b/common/protob/messages-ethereum.proto
index 5262b97b..664a62f9 100644
--- a/common/protob/messages-ethereum.proto
+++ b/common/protob/messages-ethereum.proto
@@ -1,11 +1,11 @@
syntax = "proto2";
package hw.trezor.messages.ethereum;
+import "messages-common.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageEthereum";
-
-import "messages-common.proto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask device for public key corresponding to address_n path
@@ -14,8 +14,8 @@ import "messages-common.proto";
* @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
+ 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
}
/**
@@ -23,8 +23,8 @@ message EthereumGetPublicKey {
* @end
*/
message EthereumPublicKey {
- required hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node
- required string xpub = 2; // serialized form of public node
+ required hw.trezor.messages.common.HDNodeType node = 1; // BIP32 public node
+ required string xpub = 2; // serialized form of public node
}
/**
@@ -34,10 +34,10 @@ message EthereumPublicKey {
* @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
- optional bytes encoded_network = 3; // encoded Ethereum network, see external-definitions.md for details
- optional bool chunkify = 4; // display the address in chunks of 4 characters
+ 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
+ optional bytes encoded_network = 3; // encoded Ethereum network, see external-definitions.md for details
+ optional bool chunkify = 4; // display the address in chunks of 4 characters
}
/**
@@ -45,9 +45,9 @@ message EthereumGetAddress {
* @end
*/
message EthereumAddress {
- optional bytes _old_address = 1 [deprecated=true]; // trezor <1.8.0, <2.1.0 - raw bytes of Ethereum address
- optional string address = 2; // Ethereum address as hex-encoded string
- optional bytes mac = 3; // Address authentication code
+ optional bytes _old_address = 1 [deprecated = true]; // trezor <1.8.0, <2.1.0 - raw bytes of Ethereum address
+ optional string address = 2; // Ethereum address as hex-encoded string
+ optional bytes mac = 3; // Address authentication code
}
/**
@@ -60,19 +60,19 @@ message EthereumAddress {
* @next Failure
*/
message EthereumSignTx {
- 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
- optional EthereumDefinitions definitions = 12; // network and/or token definitions for tx
- optional bool chunkify = 13; // display the address in chunks of 4 characters
- optional common.PaymentRequest payment_req = 14; // SLIP-24 payment request
+ 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
+ optional EthereumDefinitions definitions = 12; // network and/or token definitions for tx
+ optional bool chunkify = 13; // display the address in chunks of 4 characters
+ optional common.PaymentRequest payment_req = 14; // SLIP-24 payment request
}
/**
@@ -83,20 +83,20 @@ message EthereumSignTx {
* @next Failure
*/
message EthereumSignTxEIP1559 {
- 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)
- optional bytes data_initial_chunk = 8 [default='']; // The initial data chunk (<= 1024 bytes)
- 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
- optional EthereumDefinitions definitions = 12; // network and/or token definitions for tx
- optional bool chunkify = 13; // display the address in chunks of 4 characters
- optional common.PaymentRequest payment_req = 14; // SLIP-24 payment request
+ 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)
+ optional bytes data_initial_chunk = 8 [default ='']; // The initial data chunk (<= 1024 bytes)
+ 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
+ optional EthereumDefinitions definitions = 12; // network and/or token definitions for tx
+ optional bool chunkify = 13; // display the address in chunks of 4 characters
+ optional common.PaymentRequest payment_req = 14; // SLIP-24 payment request
message EthereumAccessList {
required string address = 1;
@@ -112,10 +112,10 @@ message EthereumSignTxEIP1559 {
* @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)
+ 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)
}
/**
@@ -133,10 +133,10 @@ message EthereumTxAck {
* @next Failure
*/
message EthereumSignMessage {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes message = 2; // message to be signed
- optional bytes encoded_network = 3; // encoded Ethereum network, see external-definitions.md for details
- optional bool chunkify = 4; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes message = 2; // message to be signed
+ optional bytes encoded_network = 3; // encoded Ethereum network, see external-definitions.md for details
+ optional bool chunkify = 4; // display the address in chunks of 4 characters
}
/**
@@ -144,8 +144,8 @@ message EthereumSignMessage {
* @end
*/
message EthereumMessageSignature {
- required bytes signature = 2; // signature of the message
- required string address = 3; // address used to sign the message
+ required bytes signature = 2; // signature of the message
+ required string address = 3; // address used to sign the message
}
/**
@@ -155,10 +155,10 @@ message EthereumMessageSignature {
* @next Failure
*/
message EthereumVerifyMessage {
- required bytes signature = 2; // signature to verify
- required bytes message = 3; // message to verify
- required string address = 4; // address to verify
- optional bool chunkify = 5; // display the address in chunks of 4 characters
+ required bytes signature = 2; // signature to verify
+ required bytes message = 3; // message to verify
+ required string address = 4; // address to verify
+ optional bool chunkify = 5; // display the address in chunks of 4 characters
}
/**
@@ -168,10 +168,10 @@ message EthereumVerifyMessage {
* @next Failure
*/
message EthereumSignTypedHash {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes domain_separator_hash = 2; // Hash of domainSeparator of typed data to be signed
- optional bytes message_hash = 3; // Hash of the data of typed data to be signed (empty if domain-only data)
- optional bytes encoded_network = 4; // encoded Ethereum network, see external-definitions.md for details
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes domain_separator_hash = 2; // Hash of domainSeparator of typed data to be signed
+ optional bytes message_hash = 3; // Hash of the data of typed data to be signed (empty if domain-only data)
+ optional bytes encoded_network = 4; // encoded Ethereum network, see external-definitions.md for details
}
/**
@@ -179,8 +179,8 @@ message EthereumSignTypedHash {
* @end
*/
message EthereumTypedDataSignature {
- required bytes signature = 1; // signature of the typed data
- required string address = 2; // address used to sign the typed data
+ required bytes signature = 1; // signature of the typed data
+ required string address = 2; // address used to sign the typed data
}
/**
@@ -188,6 +188,6 @@ message EthereumTypedDataSignature {
* @embed
*/
message EthereumDefinitions {
- optional bytes encoded_network = 1; // encoded ethereum network
- optional bytes encoded_token = 2; // encoded ethereum token
+ optional bytes encoded_network = 1; // encoded ethereum network
+ optional bytes encoded_token = 2; // encoded ethereum token
}
diff --git a/common/protob/messages-evolu.proto b/common/protob/messages-evolu.proto
index 27db7a76..74e7c67d 100644
--- a/common/protob/messages-evolu.proto
+++ b/common/protob/messages-evolu.proto
@@ -1,12 +1,13 @@
syntax = "proto2";
package hw.trezor.messages.evolu;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageEvolu";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -16,7 +17,7 @@ option (include_in_bitcoin_only) = true;
* @next EvoluNode
*/
message EvoluGetNode {
- required bytes proof_of_delegated_identity = 1;
+ required bytes proof_of_delegated_identity = 1;
}
/**
@@ -56,8 +57,8 @@ message EvoluRegistrationRequest {
* @next Failure
*/
message EvoluGetDelegatedIdentityKey {
- optional bytes thp_credential = 1; // THP credential so that we can display the host on the device
- reserved 2; // host_static_public_key is deprecated, the key stored in the channel cache is used instead
+ optional bytes thp_credential = 1; // THP credential so that we can display the host on the device
+ reserved 2; // host_static_public_key is deprecated, the key stored in the channel cache is used instead
}
/**
@@ -65,5 +66,5 @@ message EvoluGetDelegatedIdentityKey {
* @end
*/
message EvoluDelegatedIdentityKey {
- required bytes private_key = 1; // nist256p1 private key
+ required bytes private_key = 1; // nist256p1 private key
}
diff --git a/common/protob/messages-management.proto b/common/protob/messages-management.proto
index f140075a..23ee3c82 100644
--- a/common/protob/messages-management.proto
+++ b/common/protob/messages-management.proto
@@ -1,23 +1,24 @@
syntax = "proto2";
package hw.trezor.messages.management;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageManagement";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
* Type of the mnemonic backup given/received by the device during reset/recovery.
*/
enum BackupType {
- Bip39 = 0; // also called "Single Backup", see BIP-0039
- Slip39_Basic = 1; // also called "Shamir Backup", see SLIP-0039
- Slip39_Advanced = 2; // also called "Super Shamir" or "Shamir with Groups", see SLIP-0039#two-level-scheme
- Slip39_Single_Extendable = 3; // extendable single-share Shamir backup
- Slip39_Basic_Extendable = 4; // extendable multi-share Shamir backup
+ Bip39 = 0; // also called "Single Backup", see BIP-0039
+ Slip39_Basic = 1; // also called "Shamir Backup", see SLIP-0039
+ Slip39_Advanced = 2; // also called "Super Shamir" or "Shamir with Groups", see SLIP-0039#two-level-scheme
+ Slip39_Single_Extendable = 3; // extendable single-share Shamir backup
+ Slip39_Basic_Extendable = 4; // extendable multi-share Shamir backup
Slip39_Advanced_Extendable = 5; // extendable multi-share Shamir backup with groups
}
@@ -33,7 +34,7 @@ enum SafetyCheckLevel {
/**
* Allowed display rotation angles (in degrees from North)
*/
- enum DisplayRotation {
+enum DisplayRotation {
North = 0;
East = 90;
South = 180;
@@ -44,9 +45,9 @@ enum SafetyCheckLevel {
* Format of the homescreen image
*/
enum HomescreenFormat {
- Toif = 1; // full-color toif
- Jpeg = 2; // jpeg
- ToiG = 3; // greyscale toif
+ Toif = 1; // full-color toif
+ Jpeg = 2; // jpeg
+ ToiG = 3; // greyscale toif
}
/**
@@ -55,8 +56,8 @@ enum HomescreenFormat {
* @next Features
*/
message Initialize {
- optional bytes session_id = 1; // assumed device session id; Trezor clears caches if it is different or empty
- optional bool _skip_passphrase = 2 [deprecated=true]; // removed as part of passphrase redesign
+ optional bytes session_id = 1; // assumed device session id; Trezor clears caches if it is different or empty
+ optional bool _skip_passphrase = 2 [deprecated = true]; // removed as part of passphrase redesign
optional bool derive_cardano = 3; // whether to derive Cardano Icarus root keys in this session
}
@@ -65,75 +66,77 @@ message Initialize {
* @start
* @next Features
*/
-message GetFeatures {
-}
+message GetFeatures {}
/**
* Response: Reports various information about the device
* @end
*/
message Features {
- optional string vendor = 1; // name of the manufacturer, e.g. "trezor.io"
- required uint32 major_version = 2; // major version of the firmware/bootloader, e.g. 1
- required uint32 minor_version = 3; // minor version of the firmware/bootloader, e.g. 0
- required uint32 patch_version = 4; // patch version of the firmware/bootloader, e.g. 0
- optional uint32 build_version = 61; // build version of the firmware/bootloader, e.g. 0
- optional bool bootloader_mode = 5; // is device in bootloader mode?
- optional string device_id = 6; // device's unique identifier
- optional bool pin_protection = 7; // is device protected by PIN?
- optional bool passphrase_protection = 8; // is node/mnemonic encrypted using passphrase?
- optional string language = 9; // device language
- optional string label = 10; // device description label
- optional bool initialized = 12; // does device contain seed?
- optional bytes revision = 13; // SCM revision of firmware
- optional bytes bootloader_hash = 14; // hash of the bootloader
- optional bool imported = 15; // was storage imported from an external source?
- optional bool unlocked = 16; // is the device unlocked? called "pin_cached" previously
- optional bool _passphrase_cached = 17 [deprecated=true]; // is passphrase already cached in session?
- optional bool firmware_present = 18; // is firmware loaded?
+ optional string vendor = 1; // name of the manufacturer, e.g. "trezor.io"
+ required uint32 major_version = 2; // major version of the firmware/bootloader, e.g. 1
+ required uint32 minor_version = 3; // minor version of the firmware/bootloader, e.g. 0
+ required uint32 patch_version = 4; // patch version of the firmware/bootloader, e.g. 0
+ optional uint32 build_version = 61; // build version of the firmware/bootloader, e.g. 0
+ optional bool bootloader_mode = 5; // is device in bootloader mode?
+ optional string device_id = 6; // device's unique identifier
+ optional bool pin_protection = 7; // is device protected by PIN?
+ optional bool passphrase_protection = 8; // is node/mnemonic encrypted using passphrase?
+ optional string language = 9; // device language
+ optional string label = 10; // device description label
+ optional bool initialized = 12; // does device contain seed?
+ optional bytes revision = 13; // SCM revision of firmware
+ optional bytes bootloader_hash = 14; // hash of the bootloader
+ optional bool imported = 15; // was storage imported from an external source?
+ optional bool unlocked = 16; // is the device unlocked? called "pin_cached" previously
+ optional bool _passphrase_cached = 17 [deprecated = true]; // is passphrase already cached in session?
+ optional bool firmware_present = 18; // is firmware loaded?
optional BackupAvailability backup_availability = 19; // does storage need backup? is repeated backup unlocked?
- optional uint32 flags = 20; // device flags (equals to Storage.flags)
- optional string model = 21; // device hardware model
- optional uint32 fw_major = 22; // reported firmware version if in bootloader mode
- optional uint32 fw_minor = 23; // reported firmware version if in bootloader mode
- optional uint32 fw_patch = 24; // reported firmware version if in bootloader mode
- optional uint32 fw_build = 62; // reported firmware version if in bootloader mode
- optional string fw_vendor = 25; // reported firmware vendor if in bootloader mode
- // optional bytes fw_vendor_keys = 26; // obsoleted, use fw_vendor
- optional bool unfinished_backup = 27; // report unfinished backup (equals to Storage.unfinished_backup)
- optional bool no_backup = 28; // report no backup (equals to Storage.no_backup)
+ optional uint32 flags = 20; // device flags (equals to Storage.flags)
+ optional string model = 21; // device hardware model
+ optional uint32 fw_major = 22; // reported firmware version if in bootloader mode
+ optional uint32 fw_minor = 23; // reported firmware version if in bootloader mode
+ optional uint32 fw_patch = 24; // reported firmware version if in bootloader mode
+ optional uint32 fw_build = 62; // reported firmware version if in bootloader mode
+ optional string fw_vendor = 25; // reported firmware vendor if in bootloader mode
+ // optional bytes fw_vendor_keys = 26; // obsoleted, use fw_vendor
+ optional bool unfinished_backup = 27; // report unfinished backup (equals to Storage.unfinished_backup)
+ optional bool no_backup = 28; // report no backup (equals to Storage.no_backup)
optional RecoveryStatus recovery_status = 29; // whether or not we are in recovery mode and of what kind
- repeated Capability capabilities = 30; // list of supported capabilities
- optional BackupType backup_type = 31; // type of device backup (BIP-39 / SLIP-39 basic / SLIP-39 advanced)
- optional bool sd_card_present = 32; // is SD card present
- optional bool sd_protection = 33; // is SD Protect enabled
- optional bool wipe_code_protection = 34; // is wipe code protection enabled
+ repeated Capability capabilities = 30; // list of supported capabilities
+ optional BackupType backup_type = 31; // type of device backup (BIP-39 / SLIP-39 basic / SLIP-39 advanced)
+ optional bool sd_card_present = 32; // is SD card present
+ optional bool sd_protection = 33; // is SD Protect enabled
+ optional bool wipe_code_protection = 34; // is wipe code protection enabled
optional bytes session_id = 35;
- optional bool passphrase_always_on_device = 36; // device enforces passphrase entry on Trezor
- optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path namespace enforcement
- optional uint32 auto_lock_delay_ms = 38; // number of milliseconds after which the device locks itself
- optional DisplayRotation display_rotation = 39; // rotation of display (in degrees from North)
- optional bool experimental_features = 40; // are experimental message types enabled?
- optional bool busy = 41; // is the device busy, showing "Do not disconnect"?
- optional HomescreenFormat homescreen_format = 42; // format of the homescreen, 1 = TOIf, 2 = jpg, 3 = TOIG
- optional bool hide_passphrase_from_host = 43; // should we hide the passphrase when it comes from host?
- optional string internal_model = 44; // internal model name
- optional uint32 unit_color = 45; // color of the unit/device
- optional bool unit_btconly = 46; // unit/device is intended as bitcoin only
- optional uint32 homescreen_width = 47; // homescreen width in pixels
- optional uint32 homescreen_height = 48; // homescreen height in pixels
- optional bool bootloader_locked = 49; // bootloader is locked
- optional bool language_version_matches = 50 [default=true]; // translation blob version matches firmware version
- optional uint32 unit_packaging = 51; // unit/device packaging version
- optional bool haptic_feedback = 52; // haptic feedback is enabled
- optional RecoveryType recovery_type = 53; // what type of recovery we are in. NB: this works in conjunction with recovery_status
- optional uint32 optiga_sec = 54; // Optiga's security event counter.
- optional uint32 soc = 55; // Battery state of charge (0 - 100%)
- optional bool firmware_corrupted = 56; // true if the firmware is corrupted
- optional uint32 auto_lock_delay_battery_ms = 57; // number of milliseconds after which the battery-powered device locks itself
- optional bool led = 58; // RGB LED settings
- optional bool usb_connected = 59; // USB connected
- optional bool wireless_connected = 60; // Wireless charger connected
+ optional bool passphrase_always_on_device = 36; // device enforces passphrase entry on Trezor
+ optional SafetyCheckLevel safety_checks = 37; // safety check level, set to Prompt to limit path
+ // namespace enforcement
+ optional uint32 auto_lock_delay_ms = 38; // number of milliseconds after which the device locks itself
+ optional DisplayRotation display_rotation = 39; // rotation of display (in degrees from North)
+ optional bool experimental_features = 40; // are experimental message types enabled?
+ optional bool busy = 41; // is the device busy, showing "Do not disconnect"?
+ optional HomescreenFormat homescreen_format = 42; // format of the homescreen, 1 = TOIf, 2 = jpg, 3 = TOIG
+ optional bool hide_passphrase_from_host = 43; // should we hide the passphrase when it comes from host?
+ optional string internal_model = 44; // internal model name
+ optional uint32 unit_color = 45; // color of the unit/device
+ optional bool unit_btconly = 46; // unit/device is intended as bitcoin only
+ optional uint32 homescreen_width = 47; // homescreen width in pixels
+ optional uint32 homescreen_height = 48; // homescreen height in pixels
+ optional bool bootloader_locked = 49; // bootloader is locked
+ optional bool language_version_matches = 50 [default = true]; // translation blob version matches firmware version
+ optional uint32 unit_packaging = 51; // unit/device packaging version
+ optional bool haptic_feedback = 52; // haptic feedback is enabled
+ optional RecoveryType recovery_type = 53; // what type of recovery we are in
+ // NB: this works in conjunction with recovery_status
+ optional uint32 optiga_sec = 54; // Optiga's security event counter.
+ optional uint32 soc = 55; // Battery state of charge (0 - 100%)
+ optional bool firmware_corrupted = 56; // true if the firmware is corrupted
+ optional uint32 auto_lock_delay_battery_ms = 57; // number of milliseconds after which
+ // the battery-powered device locks itself
+ optional bool led = 58; // RGB LED settings
+ optional bool usb_connected = 59; // USB connected
+ optional bool wireless_connected = 60; // Wireless charger connected
enum BackupAvailability {
/// Device is already backed up, or a previous backup has failed.
@@ -145,9 +148,9 @@ message Features {
}
enum RecoveryStatus {
- Nothing = 0; // we are not in recovery mode
- Recovery = 1; // we are in "Normal" or "DryRun" recovery
- Backup = 2; // we are in repeated backup mode
+ Nothing = 0; // we are not in recovery mode
+ Recovery = 1; // we are in "Normal" or "DryRun" recovery
+ Backup = 2; // we are in repeated backup mode
}
enum Capability {
@@ -169,7 +172,8 @@ message Features {
Capability_U2F = 14;
Capability_Shamir = 15 [(bitcoin_only) = true];
Capability_ShamirGroups = 16 [(bitcoin_only) = true];
- Capability_PassphraseEntry = 17 [(bitcoin_only) = true]; // the device is capable of passphrase entry directly on the device
+ Capability_PassphraseEntry = 17 [(bitcoin_only) = true]; // the device is capable of passphrase entry
+ // directly on the device
Capability_Solana = 18;
Capability_Translations = 19 [(bitcoin_only) = true];
Capability_Brightness = 20 [(bitcoin_only) = true];
@@ -185,8 +189,7 @@ message Features {
* @start
* @next Success
*/
-message LockDevice {
-}
+message LockDevice {}
/**
* Request: Show a "Do not disconnect" dialog instead of the standard homescreen.
@@ -194,7 +197,8 @@ message LockDevice {
* @next Success
*/
message SetBusy {
- optional uint32 expiry_ms = 1; // The time in milliseconds after which the dialog will automatically disappear. Overrides any previously set expiry. If not set, then the dialog is hidden.
+ optional uint32 expiry_ms = 1; // The time in milliseconds after which the dialog will automatically disappear.
+ // Overrides any previously set expiry. If not set, then the dialog is hidden.
}
/**
@@ -204,8 +208,7 @@ message SetBusy {
* @start
* @next Success
*/
-message EndSession {
-}
+message EndSession {}
/**
* Request: change some property of the device, e.g. label or homescreen
@@ -215,20 +218,22 @@ message EndSession {
* @next Failure
*/
message ApplySettings {
- optional string language = 1 [deprecated=true];
+ optional string language = 1 [deprecated = true];
optional string label = 2;
optional bool use_passphrase = 3;
- optional bytes homescreen = 4; // homescreen image in single array, deprecated for 14
- optional uint32 _passphrase_source = 5 [deprecated=true]; // ASK = 0; DEVICE = 1; HOST = 2;
+ optional bytes homescreen = 4; // homescreen image in single array, deprecated for 14
+ optional uint32 _passphrase_source = 5 [deprecated = true]; // ASK = 0; DEVICE = 1; HOST = 2;
optional uint32 auto_lock_delay_ms = 6;
- optional DisplayRotation display_rotation = 7; // rotation of display (in degrees from North)
- optional bool passphrase_always_on_device = 8; // do not prompt for passphrase, enforce device entry
- optional SafetyCheckLevel safety_checks = 9; // Safety check level, set to Prompt to limit path namespace enforcement
- optional bool experimental_features = 10; // enable experimental message types
- optional bool hide_passphrase_from_host = 11; // do not show passphrase coming from host
- optional bool haptic_feedback = 13; // enable haptic feedback
- optional uint32 homescreen_length = 14; // byte length of new homescreen, device will request chunks
- optional uint32 auto_lock_delay_battery_ms = 15; // time in ms after which device locks when on battery or wireless charger
+ optional DisplayRotation display_rotation = 7; // rotation of display (in degrees from North)
+ optional bool passphrase_always_on_device = 8; // do not prompt for passphrase, enforce device entry
+ optional SafetyCheckLevel safety_checks = 9; // Safety check level,
+ // set to Prompt to limit path namespace enforcement
+ optional bool experimental_features = 10; // enable experimental message types
+ optional bool hide_passphrase_from_host = 11; // do not show passphrase coming from host
+ optional bool haptic_feedback = 13; // enable haptic feedback
+ optional uint32 homescreen_length = 14; // byte length of new homescreen, device will request chunks
+ optional uint32 auto_lock_delay_battery_ms = 15; // time in ms after which device locks when on battery
+ // or wireless charger
}
/**
@@ -258,9 +263,9 @@ message ChangeLanguage {
* @end
* @next DataChunkAck
*/
- message DataChunkRequest {
- required uint32 data_length = 1; // Number of bytes being requested
- required uint32 data_offset = 2; // Offset of the first byte being requested
+message DataChunkRequest {
+ required uint32 data_length = 1; // Number of bytes being requested
+ required uint32 data_offset = 2; // Offset of the first byte being requested
}
/**
@@ -289,7 +294,7 @@ message ApplyFlags {
* @next Failure
*/
message ChangePin {
- optional bool remove = 1; // is PIN removal requested?
+ optional bool remove = 1; // is PIN removal requested?
}
/**
@@ -299,7 +304,7 @@ message ChangePin {
* @next Failure
*/
message ChangeWipeCode {
- optional bool remove = 1; // is wipe code removal requested?
+ optional bool remove = 1; // is wipe code removal requested?
}
/**
@@ -311,8 +316,8 @@ message ChangeWipeCode {
message SdProtect {
required SdProtectOperationType operation = 1;
/**
- * Structure representing SD card protection operation
- */
+ * Structure representing SD card protection operation
+ */
enum SdProtectOperationType {
DISABLE = 0;
ENABLE = 1;
@@ -326,8 +331,8 @@ message SdProtect {
* @next Success
*/
message Ping {
- optional string message = 1 [default=""]; // message to send back in Success message
- optional bool button_protection = 2; // ask for button press
+ optional string message = 1 [default = ""]; // message to send back in Success message
+ optional bool button_protection = 2; // ask for button press
}
/**
@@ -335,8 +340,7 @@ message Ping {
* @start
* @next Failure
*/
-message Cancel {
-}
+message Cancel {}
/**
* Request: Request a sample of random data generated by hardware RNG. May be used for testing.
@@ -345,7 +349,7 @@ message Cancel {
* @next Failure
*/
message GetEntropy {
- required uint32 size = 1; // size of requested entropy
+ required uint32 size = 1; // size of requested entropy
}
/**
@@ -353,7 +357,7 @@ message GetEntropy {
* @end
*/
message Entropy {
- required bytes entropy = 1; // chunk of random generated bytes
+ required bytes entropy = 1; // chunk of random generated bytes
}
/**
@@ -363,7 +367,7 @@ message Entropy {
* @next Failure
*/
message GetFirmwareHash {
- optional bytes challenge = 1; // Blake2s key up to 32 bytes in length.
+ optional bytes challenge = 1; // Blake2s key up to 32 bytes in length.
}
/**
@@ -389,10 +393,16 @@ message AuthenticateDevice {
* @end
*/
message AuthenticityProof {
- repeated bytes optiga_certificates = 1; // A certificate chain starting with the Optiga device certificate, followed by intermediate CA certificates, the last of which is signed by Trezor company's root CA.
- required bytes optiga_signature = 2; // A DER-encoded signature of "\0x13AuthenticateDevice:" + length-prefixed challenge that should be verified using the Optiga device certificate.
- repeated bytes tropic_certificates = 3; // A certificate chain starting with the Tropic device certificate, followed by intermediate CA certificates, the last of which is signed by Trezor company's root CA.
- optional bytes tropic_signature = 4; // A DER-encoded signature of "\0x13AuthenticateDevice:" + length-prefixed challenge that should be verified using the Tropic device certificate.
+ repeated bytes optiga_certificates = 1; // A certificate chain starting with the Optiga device certificate,
+ // followed by intermediate CA certificates, the last of which is signed by
+ // Trezor company's root CA.
+ required bytes optiga_signature = 2; // A DER-encoded signature of "\x13AuthenticateDevice:" + length-prefixed
+ // challenge that should be verified using the Optiga device certificate.
+ repeated bytes tropic_certificates = 3; // A certificate chain starting with the Tropic device certificate,
+ // followed by intermediate CA certificates, the last of which is signed by
+ // Trezor company's root CA.
+ optional bytes tropic_signature = 4; // A DER-encoded signature of "\x13AuthenticateDevice:" + length-prefixed
+ // challenge that should be verified using the Tropic device certificate.
}
/**
@@ -401,8 +411,7 @@ message AuthenticityProof {
* @next Success
* @next Failure
*/
-message WipeDevice {
-}
+message WipeDevice {}
/**
* Request: Load seed and related internal settings from the computer
@@ -411,16 +420,16 @@ message WipeDevice {
* @next Failure
*/
message LoadDevice {
- repeated string mnemonics = 1; // seed encoded as mnemonic (12, 18 or 24 words for BIP39, 20 or 33 for SLIP39)
- optional string pin = 3; // set PIN protection
- optional bool passphrase_protection = 4; // enable master node encryption using passphrase
- optional string language = 5 [deprecated=true]; // deprecated (use ChangeLanguage)
- optional string label = 6; // device label
- optional bool skip_checksum = 7; // do not test mnemonic for valid BIP-39 checksum
- optional uint32 u2f_counter = 8; // U2F counter
- optional bool needs_backup = 9; // set "needs backup" flag
- optional bool no_backup = 10; // indicate that no backup is going to be made
- optional bool unfinished_backup = 11; // indicate that backup process has failed
+ repeated string mnemonics = 1; // seed encoded as mnemonic (12, 18 or 24 words for BIP39, 20 or 33 for SLIP39)
+ optional string pin = 3; // set PIN protection
+ optional bool passphrase_protection = 4; // enable master node encryption using passphrase
+ optional string language = 5 [deprecated = true]; // deprecated (use ChangeLanguage)
+ optional string label = 6; // device label
+ optional bool skip_checksum = 7; // do not test mnemonic for valid BIP-39 checksum
+ optional uint32 u2f_counter = 8; // U2F counter
+ optional bool needs_backup = 9; // set "needs backup" flag
+ optional bool no_backup = 10; // indicate that no backup is going to be made
+ optional bool unfinished_backup = 11; // indicate that backup process has failed
}
/**
@@ -430,17 +439,17 @@ message LoadDevice {
* @next Failure
*/
message ResetDevice {
- reserved 1; // unused display_random
- optional uint32 strength = 2 [default=256]; // strength of seed in bits
- optional bool passphrase_protection = 3; // enable master node encryption using passphrase
- optional bool pin_protection = 4; // enable PIN protection
- optional string language = 5 [deprecated=true]; // deprecated (use ChangeLanguage)
- optional string label = 6; // device label
- optional uint32 u2f_counter = 7; // U2F counter
- optional bool skip_backup = 8; // postpone seed backup to BackupDevice workflow
- optional bool no_backup = 9; // indicate that no backup is going to be made
- optional BackupType backup_type = 10 [default=Bip39]; // type of the mnemonic backup
- optional bool entropy_check = 11; // run with entropy check protocol
+ reserved 1; // unused display_random
+ optional uint32 strength = 2 [default = 256]; // strength of seed in bits
+ optional bool passphrase_protection = 3; // enable master node encryption using passphrase
+ optional bool pin_protection = 4; // enable PIN protection
+ optional string language = 5 [deprecated = true]; // deprecated (use ChangeLanguage)
+ optional string label = 6; // device label
+ optional uint32 u2f_counter = 7; // U2F counter
+ optional bool skip_backup = 8; // postpone seed backup to BackupDevice workflow
+ optional bool no_backup = 9; // indicate that no backup is going to be made
+ optional BackupType backup_type = 10 [default = Bip39]; // type of the mnemonic backup
+ optional bool entropy_check = 11; // run with entropy check protocol
}
/**
@@ -472,7 +481,7 @@ message EntropyRequest {
* @next EntropyCheckReady
*/
message EntropyAck {
- required bytes entropy = 1; // 256 bits (32 bytes) of the host's random data
+ required bytes entropy = 1; // 256 bits (32 bytes) of the host's random data
}
/**
@@ -480,16 +489,16 @@ message EntropyAck {
* @next EntropyCheckContinue
* @next GetPublicKey
*/
-message EntropyCheckReady {
-}
+message EntropyCheckReady {}
/**
- * Request: Proceed with the next phase of the entropy check protocol, asking Trezor to either reveal its internal entropy or to finish and store the seed.
+ * Request: Proceed with the next phase of the entropy check protocol, asking Trezor to either reveal its internal
+ * entropy or to finish and store the seed.
* @next Success
* @next EntropyRequest
*/
message EntropyCheckContinue {
- optional bool finish = 1 [default=false]; // finish the entropy check protocol, store the seed
+ optional bool finish = 1 [default = false]; // finish the entropy check protocol, store the seed
}
/**
@@ -499,16 +508,16 @@ message EntropyCheckContinue {
* @next WordRequest
*/
message RecoveryDevice {
- optional uint32 word_count = 1; // number of words in BIP-39 mnemonic (T1 only)
- optional bool passphrase_protection = 2; // enable master node encryption using passphrase
- optional bool pin_protection = 3; // enable PIN protection
- optional string language = 4 [deprecated=true]; // deprecated (use ChangeLanguage)
- optional string label = 5; // device label
- optional bool enforce_wordlist = 6; // enforce BIP-39 wordlist during the process (T1 only)
- reserved 7; // unused recovery method
- optional RecoveryDeviceInputMethod input_method = 8; // supported recovery input method (T1 only)
- optional uint32 u2f_counter = 9; // U2F counter
- optional RecoveryType type = 10 [default=NormalRecovery]; // the type of recovery to perform
+ optional uint32 word_count = 1; // number of words in BIP-39 mnemonic (T1 only)
+ optional bool passphrase_protection = 2; // enable master node encryption using passphrase
+ optional bool pin_protection = 3; // enable PIN protection
+ optional string language = 4 [deprecated = true]; // deprecated (use ChangeLanguage)
+ optional string label = 5; // device label
+ optional bool enforce_wordlist = 6; // enforce BIP-39 wordlist during the process (T1 only)
+ reserved 7; // unused recovery method
+ optional RecoveryDeviceInputMethod input_method = 8; // supported recovery input method (T1 only)
+ optional uint32 u2f_counter = 9; // U2F counter
+ optional RecoveryType type = 10 [default = NormalRecovery]; // the type of recovery to perform
/**
* Type of recovery procedure. These should be used as bitmask, e.g.,
* `RecoveryDeviceInputMethod_ScrambledWords | RecoveryDeviceInputMethod_Matrix`
@@ -519,15 +528,15 @@ message RecoveryDevice {
*/
enum RecoveryDeviceInputMethod {
// use powers of two when extending this field
- ScrambledWords = 0; // words in scrambled order
- Matrix = 1; // matrix recovery type
+ ScrambledWords = 0; // words in scrambled order
+ Matrix = 1; // matrix recovery type
}
}
enum RecoveryType {
- NormalRecovery = 0; // recovery from seedphrase on an uninitialized device
- DryRun = 1; // mnemonic validation
- UnlockRepeatedBackup = 2; // unlock SLIP-39 repeated backup
+ NormalRecovery = 0; // recovery from seedphrase on an uninitialized device
+ DryRun = 1; // mnemonic validation
+ UnlockRepeatedBackup = 2; // unlock SLIP-39 repeated backup
}
/**
@@ -538,8 +547,8 @@ enum RecoveryType {
message WordRequest {
required WordRequestType type = 1;
/**
- * Type of Recovery Word request
- */
+ * Type of Recovery Word request
+ */
enum WordRequestType {
WordRequestType_Plain = 0;
WordRequestType_Matrix9 = 1;
@@ -554,7 +563,7 @@ message WordRequest {
* @next Failure
*/
message WordAck {
- required string word = 1; // one word of mnemonic on asked position
+ required string word = 1; // one word of mnemonic on asked position
}
/**
@@ -571,8 +580,7 @@ message SetU2FCounter {
* @start
* @next NextU2FCounter
*/
-message GetNextU2FCounter {
-}
+message GetNextU2FCounter {}
/**
* Request: Set U2F counter
@@ -588,8 +596,7 @@ message NextU2FCounter {
* @next PreauthorizedRequest
* @next Failure
*/
-message DoPreauthorized {
-}
+message DoPreauthorized {}
/**
* Request: Device awaits a preauthorized operation.
@@ -597,8 +604,7 @@ message DoPreauthorized {
* @next SignTx
* @next GetOwnershipProof
*/
-message PreauthorizedRequest {
-}
+message PreauthorizedRequest {}
/**
* Request: Cancel any outstanding authorization in the current session.
@@ -606,8 +612,7 @@ message PreauthorizedRequest {
* @next Success
* @next Failure
*/
-message CancelAuthorization {
-}
+message CancelAuthorization {}
/**
* Request: Reboot firmware to bootloader
@@ -617,7 +622,7 @@ message CancelAuthorization {
*/
message RebootToBootloader {
// Action to be performed after rebooting to bootloader
- optional BootCommand boot_command = 1 [default=STOP_AND_WAIT];
+ optional BootCommand boot_command = 1 [default = STOP_AND_WAIT];
// Firmware header to be flashed after rebooting to bootloader
optional bytes firmware_header = 2;
// Deprecated (length of language blob to be installed before upgrading firmware)
@@ -636,15 +641,14 @@ message RebootToBootloader {
* @start
* @next Nonce
*/
-message GetNonce {
-}
+message GetNonce {}
/**
* Response: Contains a random nonce
* @end
*/
message Nonce {
- required bytes nonce = 1; // a 32-byte random value generated by Trezor
+ required bytes nonce = 1; // a 32-byte random value generated by Trezor
}
/**
@@ -654,8 +658,8 @@ message Nonce {
* @next Failure
*/
message UnlockPath {
- repeated uint32 address_n = 1; // prefix of the BIP-32 path leading to the account (m / purpose')
- optional bytes mac = 2; // the MAC returned by UnlockedPathRequest
+ repeated uint32 address_n = 1; // prefix of the BIP-32 path leading to the account (m / purpose')
+ optional bytes mac = 2; // the MAC returned by UnlockedPathRequest
}
/**
@@ -666,7 +670,7 @@ message UnlockPath {
* @next GetAddress
*/
message UnlockedPathRequest {
- required bytes mac = 1; // authentication code for future UnlockPath calls
+ required bytes mac = 1; // authentication code for future UnlockPath calls
}
/**
@@ -674,8 +678,7 @@ message UnlockedPathRequest {
* @start
* @next Success
*/
-message ShowDeviceTutorial {
-}
+message ShowDeviceTutorial {}
/**
* Request: Unlocks bootloader, !irreversible!
@@ -683,8 +686,7 @@ message ShowDeviceTutorial {
* @next Success
* @next Failure
*/
-message UnlockBootloader {
-}
+message UnlockBootloader {}
/**
* Request: Set device brightness
@@ -695,19 +697,17 @@ message SetBrightness {
optional uint32 value = 1; // if not specified, let the user choose
}
-
/**
* Request: Get unit serial number
* @start
* @next SerialNumber
*/
- message GetSerialNumber {
- }
+message GetSerialNumber {}
- /**
+/**
* Response: contains unit serial number
* @end
*/
- message SerialNumber {
+message SerialNumber {
required string serial_number = 1;
- }
+}
diff --git a/common/protob/messages-monero.proto b/common/protob/messages-monero.proto
index ea0401ee..0e9c680f 100644
--- a/common/protob/messages-monero.proto
+++ b/common/protob/messages-monero.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.monero;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageMonero";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
enum MoneroNetworkType {
MAINNET = 0;
@@ -18,12 +18,13 @@ enum MoneroNetworkType {
*/
message MoneroTransactionSourceEntry {
repeated MoneroOutputEntry outputs = 1; // all outputs including decoys (forms the ring)
- optional uint64 real_output = 2; // index denoting which item in `outputs` is our real output (not a decoy)
- optional bytes real_out_tx_key = 3; // tx key located in the real output's tx
+ optional uint64 real_output = 2; // index denoting which item in `outputs` is our real output (not a decoy)
+ optional bytes real_out_tx_key = 3; // tx key located in the real output's tx
repeated bytes real_out_additional_tx_keys = 4; // additional tx keys if applicable
- optional uint64 real_output_in_tx_index = 5; // index of our real output in the tx (aka which output was it in the transaction)
+ optional uint64 real_output_in_tx_index = 5; // index of our real output in the tx
+ // (aka which output was it in the transaction)
optional uint64 amount = 6;
- optional bool rct = 7; // is RingCT used (true for newer UTXOs)
+ optional bool rct = 7; // is RingCT used (true for newer UTXOs)
optional bytes mask = 8;
optional MoneroMultisigKLRki multisig_kLRki = 9;
optional uint32 subaddr_minor = 10; // minor subaddr index UTXO was sent to
@@ -67,12 +68,12 @@ message MoneroTransactionDestinationEntry {
* @embed
*/
message MoneroTransactionRsigData {
- optional uint32 rsig_type = 1; // range signature (aka proof) type
+ optional uint32 rsig_type = 1; // range signature (aka proof) type
optional uint32 offload_type = 2;
- repeated uint64 grouping = 3; // aggregation scheme for BP
+ repeated uint64 grouping = 3; // aggregation scheme for BP
- optional bytes mask = 4; // mask vector
- optional bytes rsig = 5; // range sig data, all of it or partial (based on rsig_parts)
+ optional bytes mask = 4; // mask vector
+ optional bytes rsig = 5; // range sig data, all of it or partial (based on rsig_parts)
repeated bytes rsig_parts = 6;
optional uint32 bp_version = 7; // Bulletproof version
}
@@ -84,13 +85,13 @@ message MoneroTransactionRsigData {
* @next Failure
*/
message MoneroGetAddress {
- 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
- optional MoneroNetworkType network_type = 3 [default=MAINNET]; // Network type
- optional uint32 account = 4; // Major subaddr index
- optional uint32 minor = 5; // Minor subaddr index
- optional bytes payment_id = 6; // Payment ID for integrated address
- optional bool chunkify = 7; // display the address in chunks of 4 characters
+ 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
+ optional MoneroNetworkType network_type = 3 [default = MAINNET]; // Network type
+ optional uint32 account = 4; // Major subaddr index
+ optional uint32 minor = 5; // Minor subaddr index
+ optional bytes payment_id = 6; // Payment ID for integrated address
+ optional bool chunkify = 7; // display the address in chunks of 4 characters
}
/**
@@ -108,8 +109,8 @@ message MoneroAddress {
* @next Failure
*/
message MoneroGetWatchKey {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional MoneroNetworkType network_type = 2 [default=MAINNET]; // Network type
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional MoneroNetworkType network_type = 2 [default = MAINNET]; // Network type
}
/**
@@ -129,7 +130,7 @@ message MoneroWatchKey {
message MoneroTransactionInitRequest {
optional uint32 version = 1;
repeated uint32 address_n = 2;
- optional MoneroNetworkType network_type = 3 [default=MAINNET]; // Network type
+ optional MoneroNetworkType network_type = 3 [default = MAINNET]; // Network type
optional MoneroTransactionData tsx_data = 4;
/**
* Structure representing Monero initial transaction information
@@ -177,7 +178,7 @@ message MoneroTransactionSetInputRequest {
* @next MoneroTransactionInputViniRequest
*/
message MoneroTransactionSetInputAck {
- optional bytes vini = 1; // xmrtypes.TxinToKey
+ optional bytes vini = 1; // xmrtypes.TxinToKey
optional bytes vini_hmac = 2;
optional bytes pseudo_out = 3;
optional bytes pseudo_out_hmac = 4;
@@ -191,7 +192,7 @@ message MoneroTransactionSetInputAck {
*/
message MoneroTransactionInputViniRequest {
optional MoneroTransactionSourceEntry src_entr = 1;
- optional bytes vini = 2; // xmrtypes.TxinToKey
+ optional bytes vini = 2; // xmrtypes.TxinToKey
optional bytes vini_hmac = 3;
optional bytes pseudo_out = 4;
optional bytes pseudo_out_hmac = 5;
@@ -203,15 +204,13 @@ message MoneroTransactionInputViniRequest {
* @next MoneroTransactionInputViniRequest
* @next MoneroTransactionAllInputsSetRequest
*/
-message MoneroTransactionInputViniAck {
-}
+message MoneroTransactionInputViniAck {}
/**
* Request: Sub request of MoneroTransactionSign. Sent after all inputs have been sent. Useful for rangesig offloading.
* @next MoneroTransactionAllInputsSetAck
*/
-message MoneroTransactionAllInputsSetRequest {
-}
+message MoneroTransactionAllInputsSetRequest {}
/**
* Response: Response to after all inputs have been set.
@@ -279,7 +278,7 @@ message MoneroTransactionAllOutSetAck {
*/
message MoneroTransactionSignInputRequest {
optional MoneroTransactionSourceEntry src_entr = 1;
- optional bytes vini = 2; // xmrtypes.TxinToKey
+ optional bytes vini = 2; // xmrtypes.TxinToKey
optional bytes vini_hmac = 3;
optional bytes pseudo_out = 4;
optional bytes pseudo_out_hmac = 5;
@@ -302,11 +301,11 @@ message MoneroTransactionSignInputAck {
* Request: Sub request of MoneroTransactionSign. Final message of the protocol after all UTXOs are signed
* @next MoneroTransactionFinalAck
*/
-message MoneroTransactionFinalRequest {
-}
+message MoneroTransactionFinalRequest {}
/**
- * Response: Contains transaction metadata and encryption keys needed for further transaction operations (e.g. multisig, send proof).
+ * Response: Contains transaction metadata and encryption keys needed for further transaction operations (e.g. multisig,
+ * send proof).
* @end
*/
message MoneroTransactionFinalAck {
@@ -325,8 +324,8 @@ message MoneroTransactionFinalAck {
message MoneroKeyImageExportInitRequest {
required uint64 num = 1;
required bytes hash = 2;
- repeated uint32 address_n = 3; // BIP-32 path to derive the key from master node
- optional MoneroNetworkType network_type = 4 [default=MAINNET]; // network type
+ repeated uint32 address_n = 3; // BIP-32 path to derive the key from master node
+ optional MoneroNetworkType network_type = 4 [default = MAINNET]; // network type
repeated MoneroSubAddressIndicesList subs = 5;
/**
* Structure representing Monero list of sub-addresses
@@ -341,8 +340,7 @@ message MoneroKeyImageExportInitRequest {
* Response: Response to key image sync initialization.
* @next MoneroKeyImageSyncStepRequest
*/
-message MoneroKeyImageExportInitAck {
-}
+message MoneroKeyImageExportInitAck {}
/**
* Request: Sub request of MoneroKeyImageSync. Contains batch of the UTXO to export key image for.
@@ -383,8 +381,7 @@ message MoneroKeyImageSyncStepAck {
* Request: Sub request of MoneroKeyImageSync. Final message of the sync protocol.
* @next MoneroKeyImageSyncFinalAck
*/
-message MoneroKeyImageSyncFinalRequest {
-}
+message MoneroKeyImageSyncFinalRequest {}
/**
* Response: Response to key image sync step. Contains encryption keys for exported key images.
@@ -399,15 +396,15 @@ message MoneroKeyImageSyncFinalAck {
* @next MoneroGetTxKeyAck
*/
message MoneroGetTxKeyRequest {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional MoneroNetworkType network_type = 2 [default=MAINNET]; // network type
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional MoneroNetworkType network_type = 2 [default = MAINNET]; // network type
required bytes salt1 = 3;
required bytes salt2 = 4;
required bytes tx_enc_keys = 5;
required bytes tx_prefix_hash = 6;
- optional uint32 reason = 7; // reason to display for user. e.g., tx_proof
- optional bytes view_public_key = 8; // addr for derivation
+ optional uint32 reason = 7; // reason to display for user. e.g., tx_proof
+ optional bytes view_public_key = 8; // addr for derivation
}
/**
@@ -425,8 +422,8 @@ message MoneroGetTxKeyAck {
* @next MoneroLiveRefreshStartAck
*/
message MoneroLiveRefreshStartRequest {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional MoneroNetworkType network_type = 2 [default=MAINNET]; // network type
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional MoneroNetworkType network_type = 2 [default = MAINNET]; // network type
}
/**
@@ -434,9 +431,7 @@ message MoneroLiveRefreshStartRequest {
* @next MoneroLiveRefreshStepRequest
* @next MoneroLiveRefreshFinalRequest
*/
-message MoneroLiveRefreshStartAck {
-
-}
+message MoneroLiveRefreshStartAck {}
/**
* Request: Request to compute a single key image during live sync
@@ -464,17 +459,13 @@ message MoneroLiveRefreshStepAck {
* Request: Request terminating live refresh mode.
* @next MoneroLiveRefreshFinishedAck
*/
-message MoneroLiveRefreshFinalRequest {
-
-}
+message MoneroLiveRefreshFinalRequest {}
/**
* Response: Response on termination of live refresh mode.
* @end
*/
-message MoneroLiveRefreshFinalAck {
-
-}
+message MoneroLiveRefreshFinalAck {}
/**
* Request: Universal Monero protocol implementation diagnosis request.
diff --git a/common/protob/messages-nem.proto b/common/protob/messages-nem.proto
index 74bb3418..5ec8e7af 100644
--- a/common/protob/messages-nem.proto
+++ b/common/protob/messages-nem.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.nem;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageNem";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask device for NEM address corresponding to address_n path
@@ -12,10 +12,10 @@ option java_outer_classname = "TrezorMessageNem";
* @next Failure
*/
message NEMGetAddress {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional uint32 network = 2 [default=0x68]; // Network ID (0x68 = Mainnet, 0x98 = Testnet, 0x60 = Mijin)
- optional bool show_display = 3; // Optionally show on display before sending the result
- optional bool chunkify = 4; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional uint32 network = 2 [default = 0x68]; // Network ID (0x68 = Mainnet, 0x98 = Testnet, 0x60 = Mijin)
+ optional bool show_display = 3; // Optionally show on display before sending the result
+ optional bool chunkify = 4; // display the address in chunks of 4 characters
}
/**
@@ -23,7 +23,7 @@ message NEMGetAddress {
* @end
*/
message NEMAddress {
- required string address = 1; // NEM address in Base32 encoding
+ required string address = 1; // NEM address in Base32 encoding
}
/**
@@ -33,40 +33,40 @@ message NEMAddress {
* @next Failure
*/
message NEMSignTx {
- required NEMTransactionCommon transaction = 1; // Common part of transaction
- optional NEMTransactionCommon multisig = 2; // Common part of inner transaction for multisig transactions
- optional NEMTransfer transfer = 3; // Transfer transaction part
- optional bool cosigning = 4; // Whether cosigning or initiating the multisig transaction
- optional NEMProvisionNamespace provision_namespace = 5; // Provision namespace part
- optional NEMMosaicCreation mosaic_creation = 6; // Mosaic definition creation part
- optional NEMMosaicSupplyChange supply_change = 7; // Mosaic supply change part
- optional NEMAggregateModification aggregate_modification = 8; // Aggregate modification part
- optional NEMImportanceTransfer importance_transfer = 9; // Importance transfer part
- optional bool chunkify = 10; // display the address in chunks of 4 characters
+ required NEMTransactionCommon transaction = 1; // Common part of transaction
+ optional NEMTransactionCommon multisig = 2; // Common part of inner transaction for multisig transactions
+ optional NEMTransfer transfer = 3; // Transfer transaction part
+ optional bool cosigning = 4; // Whether cosigning or initiating the multisig transaction
+ optional NEMProvisionNamespace provision_namespace = 5; // Provision namespace part
+ optional NEMMosaicCreation mosaic_creation = 6; // Mosaic definition creation part
+ optional NEMMosaicSupplyChange supply_change = 7; // Mosaic supply change part
+ optional NEMAggregateModification aggregate_modification = 8; // Aggregate modification part
+ optional NEMImportanceTransfer importance_transfer = 9; // Importance transfer part
+ optional bool chunkify = 10; // display the address in chunks of 4 characters
/**
- * Structure representing the common part for NEM transactions
- */
+ * Structure representing the common part for NEM transactions
+ */
message NEMTransactionCommon {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- optional uint32 network = 2 [default=0x68]; // Network ID (0x68 = Mainnet, 0x98 = Testnet, 0x60 = Mijin)
- required uint32 timestamp = 3; // Number of seconds elapsed since the creation of the nemesis block
- required uint64 fee = 4; // Fee for the transaction
- required uint32 deadline = 5; // Deadline of the transaction
- optional bytes signer = 6; // Public key of the account (for multisig transactions)
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ optional uint32 network = 2 [default = 0x68]; // Network ID (0x68 = Mainnet, 0x98 = Testnet, 0x60 = Mijin)
+ required uint32 timestamp = 3; // Number of seconds elapsed since the creation of the nemesis block
+ required uint64 fee = 4; // Fee for the transaction
+ required uint32 deadline = 5; // Deadline of the transaction
+ optional bytes signer = 6; // Public key of the account (for multisig transactions)
}
/**
- * Structure representing the transfer transaction part for NEM transactions
- */
+ * Structure representing the transfer transaction part for NEM transactions
+ */
message NEMTransfer {
- required string recipient = 1; // Address of the recipient
- required uint64 amount = 2; // Amount of micro NEM that is transferred
- optional bytes payload = 3; // Actual message data (unencrypted)
- optional bytes public_key = 4; // Public key of the recipient (for encrypted payloads)
- repeated NEMMosaic mosaics = 5; // Attached mosaics
+ required string recipient = 1; // Address of the recipient
+ required uint64 amount = 2; // Amount of micro NEM that is transferred
+ optional bytes payload = 3; // Actual message data (unencrypted)
+ optional bytes public_key = 4; // Public key of the recipient (for encrypted payloads)
+ repeated NEMMosaic mosaics = 5; // Attached mosaics
/**
- * Structure representing the mosaic attachment for NEM transfer transactions
- */
+ * Structure representing the mosaic attachment for NEM transfer transactions
+ */
message NEMMosaic {
required string namespace = 1; // Fully qualified name of the namespace
required string mosaic = 2; // Name of the mosaic definition
@@ -74,8 +74,8 @@ message NEMSignTx {
}
}
/**
- * Structure representing the provision namespace part for NEM transactions
- */
+ * Structure representing the provision namespace part for NEM transactions
+ */
message NEMProvisionNamespace {
required string namespace = 1; // New part concatenated to the parent
optional string parent = 2; // Parent namespace (for child namespaces)
@@ -83,34 +83,34 @@ message NEMSignTx {
required uint64 fee = 4; // Rental fee
}
/**
- * Structure representing the mosaic definition creation part for NEM transactions
- */
+ * Structure representing the mosaic definition creation part for NEM transactions
+ */
message NEMMosaicCreation {
- required NEMMosaicDefinition definition = 1; // Mosaic definition
- required string sink = 2; // Creation fee sink address
- required uint64 fee = 3; // Creation fee
+ required NEMMosaicDefinition definition = 1; // Mosaic definition
+ required string sink = 2; // Creation fee sink address
+ required uint64 fee = 3; // Creation fee
/**
- * Structure representing a mosaic definition
- */
+ * Structure representing a mosaic definition
+ */
message NEMMosaicDefinition {
- optional string name = 1; // User-friendly name of the mosaic (for whitelisted mosaics)
- optional string ticker = 2; // Ticker of the mosaic (for whitelisted mosaics)
- required string namespace = 3; // Fully qualified name of the namespace
- required string mosaic = 4; // Name of the mosaic definition
- optional uint32 divisibility = 5; // Number of decimal places that a mosaic can be divided into
- optional NEMMosaicLevy levy = 6; // Levy type
- optional uint64 fee = 7; // Levy fee (interpretation depends on levy type)
- optional string levy_address = 8; // Levy address
- optional string levy_namespace = 9; // Fully qualified name of the namespace of the levy mosaic
- optional string levy_mosaic = 10; // Name of the levy mosaic
- optional uint64 supply = 11; // Initial supply to create, always given in entire units
- optional bool mutable_supply = 12; // Mutable supply
- optional bool transferable = 13; // Mosaic allows transfers among accounts other than the creator
- required string description = 14; // Mosaic description
- repeated uint32 networks = 15; // Networks that the mosaic is valid on (for whitelisted mosaics)
+ optional string name = 1; // User-friendly name of the mosaic (for whitelisted mosaics)
+ optional string ticker = 2; // Ticker of the mosaic (for whitelisted mosaics)
+ required string namespace = 3; // Fully qualified name of the namespace
+ required string mosaic = 4; // Name of the mosaic definition
+ optional uint32 divisibility = 5; // Number of decimal places that a mosaic can be divided into
+ optional NEMMosaicLevy levy = 6; // Levy type
+ optional uint64 fee = 7; // Levy fee (interpretation depends on levy type)
+ optional string levy_address = 8; // Levy address
+ optional string levy_namespace = 9; // Fully qualified name of the namespace of the levy mosaic
+ optional string levy_mosaic = 10; // Name of the levy mosaic
+ optional uint64 supply = 11; // Initial supply to create, always given in entire units
+ optional bool mutable_supply = 12; // Mutable supply
+ optional bool transferable = 13; // Mosaic allows transfers among accounts other than the creator
+ required string description = 14; // Mosaic description
+ repeated uint32 networks = 15; // Networks that the mosaic is valid on (for whitelisted mosaics)
/**
- * Type of levy which will be used for mosaic
- */
+ * Type of levy which will be used for mosaic
+ */
enum NEMMosaicLevy {
MosaicLevy_Absolute = 1;
MosaicLevy_Percentile = 2;
@@ -118,36 +118,36 @@ message NEMSignTx {
}
}
/**
- * Structure representing the mosaic supply change part for NEM transactions
- */
+ * Structure representing the mosaic supply change part for NEM transactions
+ */
message NEMMosaicSupplyChange {
required string namespace = 1; // Fully qualified name of the namespace
required string mosaic = 2; // Name of the mosaic definition
required NEMSupplyChangeType type = 3; // Type of supply change
required uint64 delta = 4; // Supply delta
/**
- * Type of supply change which will be applied to mosaic
- */
+ * Type of supply change which will be applied to mosaic
+ */
enum NEMSupplyChangeType {
SupplyChange_Increase = 1;
SupplyChange_Decrease = 2;
}
}
/**
- * Structure representing the aggregate modification part for NEM transactions
- */
+ * Structure representing the aggregate modification part for NEM transactions
+ */
message NEMAggregateModification {
repeated NEMCosignatoryModification modifications = 1; // Cosignatory modifications
optional sint32 relative_change = 2; // Relative change of the minimum cosignatories
/**
- * Structure representing the cosignatory modification for aggregate modification transactions
- */
+ * Structure representing the cosignatory modification for aggregate modification transactions
+ */
message NEMCosignatoryModification {
required NEMModificationType type = 1; // Type of cosignatory modification
required bytes public_key = 2; // Public key of the cosignatory
/**
- * Type of cosignatory modification
- */
+ * Type of cosignatory modification
+ */
enum NEMModificationType {
CosignatoryModification_Add = 1;
CosignatoryModification_Delete = 2;
@@ -155,14 +155,14 @@ message NEMSignTx {
}
}
/**
- * Structure representing the importance transfer part for NEM transactions
- */
+ * Structure representing the importance transfer part for NEM transactions
+ */
message NEMImportanceTransfer {
- required NEMImportanceTransferMode mode = 1; // Mode of importance transfer
- required bytes public_key = 2; // Public key of the remote account
+ required NEMImportanceTransferMode mode = 1; // Mode of importance transfer
+ required bytes public_key = 2; // Public key of the remote account
/**
- * Mode of importance transfer
- */
+ * Mode of importance transfer
+ */
enum NEMImportanceTransferMode {
ImportanceTransfer_Activate = 1;
ImportanceTransfer_Deactivate = 2;
@@ -175,8 +175,8 @@ message NEMSignTx {
* @end
*/
message NEMSignedTx {
- required bytes data = 1; // Transaction data
- required bytes signature = 2; // Signature for the transaction
+ required bytes data = 1; // Transaction data
+ required bytes signature = 2; // Signature for the transaction
}
/**
@@ -197,5 +197,5 @@ message NEMDecryptMessage {
* @end
*/
message NEMDecryptedMessage {
- required bytes payload = 1; // Actual message data (unencrypted)
+ required bytes payload = 1; // Actual message data (unencrypted)
}
diff --git a/common/protob/messages-nostr.proto b/common/protob/messages-nostr.proto
index f8b5a599..2d170954 100644
--- a/common/protob/messages-nostr.proto
+++ b/common/protob/messages-nostr.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.nostr;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageNostr";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask the device for the Nostr public key
@@ -11,7 +11,7 @@ option java_outer_classname = "TrezorMessageNostr";
* @next NostrPubkey
*/
message NostrGetPubkey {
- repeated uint32 address_n = 1; // used to derive the key
+ repeated uint32 address_n = 1; // used to derive the key
}
/**
@@ -19,7 +19,7 @@ message NostrGetPubkey {
* @end
*/
message NostrPubkey {
- required bytes pubkey = 1; // pubkey derived from the seed
+ required bytes pubkey = 1; // pubkey derived from the seed
}
/**
@@ -42,7 +42,7 @@ message NostrTag {
* @next Failure
*/
message NostrSignEvent {
- repeated uint32 address_n = 1; // used to derive the key
+ repeated uint32 address_n = 1; // used to derive the key
// Nostr event fields, except the ones that are calculated by the signer
// See NIP-01: https://github.com/nostr-protocol/nips/blob/master/01.md
@@ -58,7 +58,7 @@ message NostrSignEvent {
* @end
*/
message NostrEventSignature {
- required bytes pubkey = 1; // pubkey used to sign the event
- required bytes id = 2; // ID of the event
- required bytes signature = 3; // signature of the event
+ required bytes pubkey = 1; // pubkey used to sign the event
+ required bytes id = 2; // ID of the event
+ required bytes signature = 3; // signature of the event
}
diff --git a/common/protob/messages-ripple.proto b/common/protob/messages-ripple.proto
index ba107dc0..1bc5bc85 100644
--- a/common/protob/messages-ripple.proto
+++ b/common/protob/messages-ripple.proto
@@ -1,11 +1,11 @@
syntax = "proto2";
package hw.trezor.messages.ripple;
+import "messages-common.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageRipple";
-
-import "messages-common.proto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Address at the specified index
@@ -13,9 +13,9 @@ import "messages-common.proto";
* @next RippleAddress
*/
message RippleGetAddress {
- repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index'
- optional bool show_display = 2; // optionally show on display before sending the result
- optional bool chunkify = 3; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index'
+ optional bool show_display = 2; // optionally show on display before sending the result
+ optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
@@ -23,8 +23,8 @@ message RippleGetAddress {
* @end
*/
message RippleAddress {
- required string address = 1; // Address in Ripple format (base58 of a pubkey with checksum)
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Address in Ripple format (base58 of a pubkey with checksum)
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -33,14 +33,15 @@ message RippleAddress {
* @next RippleSignedTx
*/
message RippleSignTx {
- repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index'
- required uint64 fee = 2; // fee (in drops) for the transaction
- optional uint32 flags = 3 [default=0]; // transaction flags
- required uint32 sequence = 4; // transaction sequence number
- optional uint32 last_ledger_sequence = 5; // see https://developers.ripple.com/reliable-transaction-submission.html#lastledgersequence
- required RipplePayment payment = 6; // Payment transaction type
- optional bool chunkify = 7; // display the address in chunks of 4 characters
- optional common.PaymentRequest payment_req = 8; // SLIP-24 payment request
+ repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/144'/index'
+ required uint64 fee = 2; // fee (in drops) for the transaction
+ optional uint32 flags = 3 [default = 0]; // transaction flags
+ required uint32 sequence = 4; // transaction sequence number
+ optional uint32 last_ledger_sequence = 5; // see
+ // https://developers.ripple.com/reliable-transaction-submission.html#lastledgersequence
+ required RipplePayment payment = 6; // Payment transaction type
+ optional bool chunkify = 7; // display the address in chunks of 4 characters
+ optional common.PaymentRequest payment_req = 8; // SLIP-24 payment request
/**
* Payment transaction type
@@ -49,9 +50,9 @@ message RippleSignTx {
* - see https://developers.ripple.com/payment.html
*/
message RipplePayment {
- required uint64 amount = 1; // only XRP is supported at the moment so this an integer
- required string destination = 2; // destination account address
- optional uint32 destination_tag = 3; // destination tag to identify payments
+ required uint64 amount = 1; // only XRP is supported at the moment so this an integer
+ required string destination = 2; // destination account address
+ optional uint32 destination_tag = 3; // destination tag to identify payments
}
}
diff --git a/common/protob/messages-solana.proto b/common/protob/messages-solana.proto
index c33591d2..0eef808e 100644
--- a/common/protob/messages-solana.proto
+++ b/common/protob/messages-solana.proto
@@ -14,8 +14,8 @@ option java_package = "com.satoshilabs.trezor.lib.protobuf";
* @next Failure
*/
message SolanaGetPublicKey {
- 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
+ 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
}
/**
@@ -33,9 +33,9 @@ message SolanaPublicKey {
* @next Failure
*/
message SolanaGetAddress {
- 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
- optional bool chunkify = 3; // display the address in chunks of 4 characters
+ 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
+ optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
@@ -43,8 +43,8 @@ message SolanaGetAddress {
* @end
*/
message SolanaAddress {
- required string address = 1; // Solana address as Base58 encoded string
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Solana address as Base58 encoded string
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -72,10 +72,10 @@ message SolanaTxAdditionalInfo {
* @next Failure
*/
message SolanaSignTx {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key to sign with
- required bytes serialized_tx = 2; // serialized tx to be signed
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key to sign with
+ required bytes serialized_tx = 2; // serialized tx to be signed
optional SolanaTxAdditionalInfo additional_info = 3;
- optional common.PaymentRequest payment_req = 4; // SLIP-24 payment request
+ optional common.PaymentRequest payment_req = 4; // SLIP-24 payment request
}
/**
@@ -83,5 +83,5 @@ message SolanaSignTx {
* @end
*/
message SolanaTxSignature {
- required bytes signature = 1; // tx signature
+ required bytes signature = 1; // tx signature
}
diff --git a/common/protob/messages-stellar.proto b/common/protob/messages-stellar.proto
index acd606b7..71593829 100644
--- a/common/protob/messages-stellar.proto
+++ b/common/protob/messages-stellar.proto
@@ -1,11 +1,11 @@
syntax = "proto2";
package hw.trezor.messages.stellar;
+import "messages-common.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageStellar";
-
-import "messages-common.proto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
// https://github.com/stellar/stellar-core/blob/02d26858069de7c0eefe065056fb0a19bf72ea56/src/xdr/Stellar-ledger-entries.x#L25-L31
enum StellarAssetType {
@@ -20,9 +20,8 @@ enum StellarAssetType {
*/
message StellarAsset {
required StellarAssetType type = 1;
- optional string code = 2; // for non-native assets, string describing the code
- optional string issuer = 3; // issuing address
-
+ optional string code = 2; // for non-native assets, string describing the code
+ optional string issuer = 3; // issuing address
}
/**
@@ -31,9 +30,9 @@ message StellarAsset {
* @next StellarAddress
*/
message StellarGetAddress {
- repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
- optional bool show_display = 2; // optionally show on display before sending the result
- optional bool chunkify = 3; // display the address in chunks of 4 characters
+ repeated uint32 address_n = 1; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
+ optional bool show_display = 2; // optionally show on display before sending the result
+ optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
@@ -41,8 +40,8 @@ message StellarGetAddress {
* @end
*/
message StellarAddress {
- required string address = 1; // Address in Stellar format (base32 of a pubkey with checksum)
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Address in Stellar format (base32 of a pubkey with checksum)
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -51,19 +50,19 @@ message StellarAddress {
* @next StellarTxOpRequest
*/
message StellarSignTx {
- repeated uint32 address_n = 2; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
- required string network_passphrase = 3; // passphrase for signing messages on the destination network
- required string source_account = 4; // source account address
- required uint32 fee = 5; // Fee (in stroops) for the transaction
- required uint64 sequence_number = 6; // transaction sequence number
- required uint32 timebounds_start = 8; // unix timestamp (client must truncate this to 32 bytes)
- required uint32 timebounds_end = 9; // unix timestamp (client must truncate this to 32 bytes)
- required StellarMemoType memo_type = 10; // type of memo attached to the transaction
- optional string memo_text = 11; // up to 28 characters (4 bytes are for length)
- optional uint64 memo_id = 12; // 8-byte uint64
- optional bytes memo_hash = 13; // 32 bytes representing a hash
- required uint32 num_operations = 14; // number of operations in this transaction
- optional common.PaymentRequest payment_req = 15; // SLIP-24 payment request
+ repeated uint32 address_n = 2; // BIP-32 path. For compatibility with other wallets, must be m/44'/148'/index'
+ required string network_passphrase = 3; // passphrase for signing messages on the destination network
+ required string source_account = 4; // source account address
+ required uint32 fee = 5; // Fee (in stroops) for the transaction
+ required uint64 sequence_number = 6; // transaction sequence number
+ required uint32 timebounds_start = 8; // unix timestamp (client must truncate this to 32 bits)
+ required uint32 timebounds_end = 9; // unix timestamp (client must truncate this to 32 bits)
+ required StellarMemoType memo_type = 10; // type of memo attached to the transaction
+ optional string memo_text = 11; // up to 28 characters (4 bytes are for length)
+ optional uint64 memo_id = 12; // 8-byte uint64
+ optional bytes memo_hash = 13; // 32 bytes representing a hash
+ required uint32 num_operations = 14; // number of operations in this transaction
+ optional common.PaymentRequest payment_req = 15; // SLIP-24 payment request
// https://github.com/stellar/stellar-core/blob/02d26858069de7c0eefe065056fb0a19bf72ea56/src/xdr/Stellar-transaction.x#L506-L513
enum StellarMemoType {
@@ -91,8 +90,7 @@ message StellarSignTx {
* @next StellarManageDataOp
* @next StellarBumpSequenceOp
*/
-message StellarTxOpRequest {
-}
+message StellarTxOpRequest {}
/**
* Request: ask device to confirm this operation type
@@ -100,10 +98,10 @@ message StellarTxOpRequest {
* @next StellarSignedTx
*/
message StellarPaymentOp {
- optional string source_account = 1; // (optional) source account address
- required string destination_account = 2; // destination account address
- required StellarAsset asset = 3; // asset involved in the operation
- required sint64 amount = 4; // amount of the given asset to pay
+ optional string source_account = 1; // (optional) source account address
+ required string destination_account = 2; // destination account address
+ required StellarAsset asset = 3; // asset involved in the operation
+ required sint64 amount = 4; // amount of the given asset to pay
}
/**
@@ -112,9 +110,9 @@ message StellarPaymentOp {
* @next StellarSignedTx
*/
message StellarCreateAccountOp {
- optional string source_account = 1; // (optional) source account address
- required string new_account = 2; // account address to create
- required sint64 starting_balance = 3; // initial starting balance for the new account
+ optional string source_account = 1; // (optional) source account address
+ required string new_account = 2; // account address to create
+ required sint64 starting_balance = 3; // initial starting balance for the new account
}
/**
@@ -144,7 +142,7 @@ message StellarPathPaymentStrictSendOp {
required string destination_account = 4; // recipient of the payment
required StellarAsset destination_asset = 5; // what they end up with
required sint64 destination_min = 6; // the minimum amount of dest asset to be received
- repeated StellarAsset paths = 7; //additional hops it must go through to get there
+ repeated StellarAsset paths = 7; // additional hops it must go through to get there
}
/**
@@ -153,13 +151,13 @@ message StellarPathPaymentStrictSendOp {
* @next StellarSignedTx
*/
message StellarManageSellOfferOp {
- optional string source_account = 1; // (optional) source account address
+ optional string source_account = 1; // (optional) source account address
required StellarAsset selling_asset = 2;
required StellarAsset buying_asset = 3;
required sint64 amount = 4;
- required uint32 price_n = 5; // Price numerator
- required uint32 price_d = 6; // Price denominator
- required uint64 offer_id = 7; // Offer ID for updating an existing offer
+ required uint32 price_n = 5; // Price numerator
+ required uint32 price_d = 6; // Price denominator
+ required uint64 offer_id = 7; // Offer ID for updating an existing offer
}
/**
@@ -168,13 +166,13 @@ message StellarManageSellOfferOp {
* @next StellarSignedTx
*/
message StellarManageBuyOfferOp {
- optional string source_account = 1; // (optional) source account address
+ optional string source_account = 1; // (optional) source account address
required StellarAsset selling_asset = 2;
required StellarAsset buying_asset = 3;
required sint64 amount = 4;
- required uint32 price_n = 5; // Price numerator
- required uint32 price_d = 6; // Price denominator
- required uint64 offer_id = 7; // Offer ID for updating an existing offer
+ required uint32 price_n = 5; // Price numerator
+ required uint32 price_d = 6; // Price denominator
+ required uint64 offer_id = 7; // Offer ID for updating an existing offer
}
/**
@@ -183,12 +181,12 @@ message StellarManageBuyOfferOp {
* @next StellarSignedTx
*/
message StellarCreatePassiveSellOfferOp {
- optional string source_account = 1; // (optional) source account address
+ optional string source_account = 1; // (optional) source account address
required StellarAsset selling_asset = 2;
required StellarAsset buying_asset = 3;
required sint64 amount = 4;
- required uint32 price_n = 5; // Price numerator
- required uint32 price_d = 6; // Price denominator
+ required uint32 price_n = 5; // Price numerator
+ required uint32 price_d = 6; // Price denominator
}
/**
@@ -224,7 +222,7 @@ message StellarSetOptionsOp {
* @next StellarSignedTx
*/
message StellarChangeTrustOp {
- optional string source_account = 1; // (optional) source account address
+ optional string source_account = 1; // (optional) source account address
required StellarAsset asset = 2;
required uint64 limit = 3;
}
@@ -235,10 +233,10 @@ message StellarChangeTrustOp {
* @next StellarSignedTx
*/
message StellarAllowTrustOp {
- optional string source_account = 1; // (optional) source account address
- required string trusted_account = 2; // The account being allowed to hold the asset
+ optional string source_account = 1; // (optional) source account address
+ required string trusted_account = 2; // The account being allowed to hold the asset
required StellarAssetType asset_type = 3;
- optional string asset_code = 4; // human-readable asset code
+ optional string asset_code = 4; // human-readable asset code
required bool is_authorized = 5;
}
@@ -248,8 +246,8 @@ message StellarAllowTrustOp {
* @next StellarSignedTx
*/
message StellarAccountMergeOp {
- optional string source_account = 1; // (optional) source account address
- required string destination_account = 2; // destination account address
+ optional string source_account = 1; // (optional) source account address
+ required string destination_account = 2; // destination account address
}
/**
@@ -258,9 +256,9 @@ message StellarAccountMergeOp {
* @next StellarSignedTx
*/
message StellarManageDataOp {
- optional string source_account = 1; // (optional) source account address
+ optional string source_account = 1; // (optional) source account address
required string key = 2;
- optional bytes value = 3; // 64 bytes of arbitrary data
+ optional bytes value = 3; // 64 bytes of arbitrary data
}
/**
@@ -269,8 +267,8 @@ message StellarManageDataOp {
* @next StellarSignedTx
*/
message StellarBumpSequenceOp {
- optional string source_account = 1; // (optional) source account address
- required uint64 bump_to = 2; // new sequence number
+ optional string source_account = 1; // (optional) source account address
+ required uint64 bump_to = 2; // new sequence number
}
/**
@@ -279,8 +277,8 @@ message StellarBumpSequenceOp {
* @next StellarSignedTx
*/
message StellarClaimClaimableBalanceOp {
- optional string source_account = 1; // (optional) source account address
- required bytes balance_id = 2; // balance id, 4 bytes of type flag, 32 bytes of data
+ optional string source_account = 1; // (optional) source account address
+ required bytes balance_id = 2; // balance id, 4 bytes of type flag, 32 bytes of data
}
/**
diff --git a/common/protob/messages-telemetry.proto b/common/protob/messages-telemetry.proto
index c97348ab..b15cc35b 100644
--- a/common/protob/messages-telemetry.proto
+++ b/common/protob/messages-telemetry.proto
@@ -1,12 +1,13 @@
syntax = "proto2";
package hw.trezor.messages.telemetry;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageTelemetry";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -15,8 +16,7 @@ option (include_in_bitcoin_only) = true;
* @next Telemetry
* @next Failure
*/
-message TelemetryGet {
-}
+message TelemetryGet {}
/**
* Response: Reports telemetry data
diff --git a/common/protob/messages-tezos.proto b/common/protob/messages-tezos.proto
index 1e392bb1..26595b4d 100644
--- a/common/protob/messages-tezos.proto
+++ b/common/protob/messages-tezos.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.tezos;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageTezos";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: Ask device for Tezos address corresponding to address_n path
@@ -12,9 +12,9 @@ option java_outer_classname = "TrezorMessageTezos";
* @next Failure
*/
message TezosGetAddress {
- 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
- optional bool chunkify = 3; // display the address in chunks of 4 characters
+ 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
+ optional bool chunkify = 3; // display the address in chunks of 4 characters
}
/**
@@ -22,8 +22,8 @@ message TezosGetAddress {
* @end
*/
message TezosAddress {
- required string address = 1; // Coin address in Base58 encoding
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Coin address in Base58 encoding
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -32,9 +32,9 @@ message TezosAddress {
* @next TezosPublicKey
*/
message TezosGetPublicKey {
- 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
- optional bool chunkify = 3; // display the public key in chunks of 4 characters
+ 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
+ optional bool chunkify = 3; // display the public key in chunks of 4 characters
}
/**
@@ -42,7 +42,7 @@ message TezosGetPublicKey {
* @end
*/
message TezosPublicKey {
- required string public_key = 1; // b58 encoded Tezos public key with prefix
+ required string public_key = 1; // b58 encoded Tezos public key with prefix
}
/**
@@ -51,23 +51,22 @@ message TezosPublicKey {
* @next TezosSignedTx
*/
message TezosSignTx {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
required bytes branch = 2;
-
- optional TezosRevealOp reveal = 3; // Tezos reveal operation (may be bundled with other op)
- optional TezosTransactionOp transaction = 4; // Tezos transaction operation
- optional TezosOriginationOp origination = 5; // Tezos origination operation
- optional TezosDelegationOp delegation = 6; // Tezos delegation operation
- optional TezosProposalOp proposal = 7; // Tezos proposal operation
- optional TezosBallotOp ballot = 8; // Tezos ballot operation
- optional bool chunkify = 9; // display the address in chunks of 4 characters
+ optional TezosRevealOp reveal = 3; // Tezos reveal operation (may be bundled with other op)
+ optional TezosTransactionOp transaction = 4; // Tezos transaction operation
+ optional TezosOriginationOp origination = 5; // Tezos origination operation
+ optional TezosDelegationOp delegation = 6; // Tezos delegation operation
+ optional TezosProposalOp proposal = 7; // Tezos proposal operation
+ optional TezosBallotOp ballot = 8; // Tezos ballot operation
+ optional bool chunkify = 9; // display the address in chunks of 4 characters
/*
* Tezos contract ID
*/
message TezosContractID {
required TezosContractType tag = 1;
- required bytes hash = 2; // Implicit = 21B, originated = 20B + 1B padding
+ required bytes hash = 2; // Implicit = 21B, originated = 20B + 1B padding
/*
* Type of Tezos Contract type
*/
@@ -143,7 +142,7 @@ message TezosSignTx {
* Structure representing information for proposal
*/
message TezosProposalOp {
- required bytes source = 1; //Contains only public_key_hash, not to be confused with TezosContractID
+ required bytes source = 1; // Contains only public_key_hash, not to be confused with TezosContractID
required uint64 period = 2;
repeated bytes proposals = 4;
}
@@ -151,7 +150,7 @@ message TezosSignTx {
* Structure representing information for ballot
*/
message TezosBallotOp {
- required bytes source = 1; //Contains only public_key_hash, not to be confused with TezosContractID
+ required bytes source = 1; // Contains only public_key_hash, not to be confused with TezosContractID
required uint64 period = 2;
required bytes proposal = 3;
required TezosBallotType ballot = 4;
@@ -169,7 +168,7 @@ message TezosSignTx {
* @end
*/
message TezosSignedTx {
- required string signature = 1; // Tezos b58 encoded transaction signature with prefix
- required bytes sig_op_contents = 2; // operation_bytes + signed operation_bytes
- required string operation_hash = 3; // b58 encoded hashed operation contents with prefix
+ required string signature = 1; // Tezos b58 encoded transaction signature with prefix
+ required bytes sig_op_contents = 2; // operation_bytes + signed operation_bytes
+ required string operation_hash = 3; // b58 encoded hashed operation contents with prefix
}
diff --git a/common/protob/messages-thp.proto b/common/protob/messages-thp.proto
index 2667d341..361c8c51 100644
--- a/common/protob/messages-thp.proto
+++ b/common/protob/messages-thp.proto
@@ -1,29 +1,27 @@
syntax = "proto2";
package hw.trezor.messages.thp;
+import "options.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageThp";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
-
/**
* Mapping between Trezor wire identifier (uint) and a Thp protobuf message
*/
enum ThpMessageType {
option (wire_enum) = true;
-
- reserved 0 to 19; // Values reserved by other messages, see messages.proto
+ reserved 0 to 19; // values reserved by other messages, see messages.proto
ThpMessageType_Cancel = 20;
reserved 21 to 25;
ThpMessageType_ButtonRequest = 26;
ThpMessageType_ButtonAck = 27;
reserved 28 to 999;
-
- reserved 1000; // MessageType_ThpCreateNewSession
+ reserved 1000; // MessageType_ThpCreateNewSession
reserved 1001 to 1007; // never appeared in a release, reserved for future use
ThpMessageType_ThpPairingRequest = 1008;
ThpMessageType_ThpPairingRequestApproved = 1009;
@@ -34,21 +32,20 @@ enum ThpMessageType {
ThpMessageType_ThpCredentialResponse = 1017;
ThpMessageType_ThpEndRequest = 1018;
ThpMessageType_ThpEndResponse = 1019;
- reserved 1020 to 1023; // reserved for future use
+ reserved 1020 to 1023; // never appeared in a release, reserved for future use
ThpMessageType_ThpCodeEntryCommitment = 1024;
ThpMessageType_ThpCodeEntryChallenge = 1025;
ThpMessageType_ThpCodeEntryCpaceTrezor = 1026;
ThpMessageType_ThpCodeEntryCpaceHostTag = 1027;
ThpMessageType_ThpCodeEntrySecret = 1028;
- reserved 1029 to 1031; // reserved for future use
+ reserved 1029 to 1031; // never appeared in a release, reserved for future use
ThpMessageType_ThpQrCodeTag = 1032;
ThpMessageType_ThpQrCodeSecret = 1033;
- reserved 1034 to 1039; // reserved for future use
+ reserved 1034 to 1039; // never appeared in a release, reserved for future use
ThpMessageType_ThpNfcTagHost = 1040;
ThpMessageType_ThpNfcTagTrezor = 1041;
- reserved 1042 to 1099; // reserved for future use
-
- reserved 1100 to 2147483647; // Values reserved by other messages, see messages.proto
+ reserved 1042 to 1099; // never appeared in a release, reserved for future use
+ reserved 1100 to 2147483647; // values reserved by other messages, see messages.proto
}
/**
@@ -56,28 +53,30 @@ enum ThpMessageType {
* @embed
*/
enum ThpPairingMethod {
- SkipPairing = 1; // Trust without MITM protection.
- CodeEntry = 2; // User types code diplayed on Trezor into the host application.
- QrCode = 3; // User scans code displayed on Trezor into host application.
- NFC = 4; // Trezor and host application exchange authentication secrets via NFC.
+ SkipPairing = 1; // Trust without MITM protection.
+ CodeEntry = 2; // User rewrites code displayed on Trezor into the host application.
+ QrCode = 3; // User scans QR-code displayed on Trezor into the host application.
+ NFC = 4; // Trezor and host application exchange authentication secrets via NFC.
}
/**
* @embed
*/
message ThpDeviceProperties {
- required string internal_model = 1; // Internal model name e.g. "T2B1".
- optional uint32 model_variant = 2 [default=0]; // Encodes the device properties such as color.
- required uint32 protocol_version_major = 3; // The major version of the communication protocol used by the firmware.
- required uint32 protocol_version_minor = 4; // The minor version of the communication protocol used by the firmware.
- repeated ThpPairingMethod pairing_methods = 5; // The pairing methods supported by the Trezor.
+ required string internal_model = 1; // Internal model name, e.g. "T2B1".
+ optional uint32 model_variant = 2 [default = 0]; // Encodes the device properties such as color.
+ required uint32 protocol_version_major = 3; // The major version of the communication protocol
+ // used by the firmware.
+ required uint32 protocol_version_minor = 4; // The minor version of the communication protocol
+ // used by the firmware.
+ repeated ThpPairingMethod pairing_methods = 5; // Pairing methods supported by the Trezor.
}
/**
* @embed
*/
message ThpHandshakeCompletionReqNoisePayload {
- optional bytes host_pairing_credential = 1; // Host's pairing credential
+ optional bytes host_pairing_credential = 1; // Host's pairing credential
}
/**
@@ -87,19 +86,18 @@ message ThpHandshakeCompletionReqNoisePayload {
*/
message ThpCreateNewSession {
optional string passphrase = 1;
- optional bool on_device = 2 [default=false]; // User wants to enter passphrase on the device
- optional bool derive_cardano = 3 [default=false]; // If True, Cardano keys will be derived. Ignored with BTC-only
+ optional bool on_device = 2 [default = false]; // User wants to enter passphrase on the device
+ optional bool derive_cardano = 3 [default = false]; // If True, Cardano keys will be derived. Ignored with BTC-only
}
-
/**
* Request: Start pairing process.
* @start
* @next ThpPairingRequestApproved
*/
message ThpPairingRequest {
- required string host_name = 1; // Human-readable host name (browser name for web apps)
- required string app_name = 2; // Human-readable application name
+ required string host_name = 1; // Human-readable host name (browser name for web apps)
+ required string app_name = 2; // Human-readable application name
}
/**
@@ -107,8 +105,7 @@ message ThpPairingRequest {
* @start
* @next ThpSelectMethod
*/
-message ThpPairingRequestApproved {
-}
+message ThpPairingRequestApproved {}
/**
* Request: Start pairing using the method selected.
@@ -126,15 +123,14 @@ message ThpSelectMethod {
* @next ThpQrCodeTag
* @next ThpNfcTagHost
*/
-message ThpPairingPreparationsFinished {
-}
+message ThpPairingPreparationsFinished {}
/**
* Response: If Code Entry is an allowed pairing option, Trezor responds with a commitment.
* @next ThpCodeEntryChallenge
*/
message ThpCodeEntryCommitment {
- required bytes commitment = 1; // SHA-256 of Trezor's random 32-byte secret
+ required bytes commitment = 1; // SHA-256 of Trezor's random 32-byte secret
}
/**
@@ -142,7 +138,7 @@ message ThpCodeEntryCommitment {
* @next ThpCodeEntryCpaceTrezor
*/
message ThpCodeEntryChallenge {
- required bytes challenge = 1; // Host's random 32-byte challenge
+ required bytes challenge = 1; // Host's random 32-byte challenge
}
/**
@@ -157,10 +153,9 @@ message ThpCodeEntryCpaceTrezor {
* Request: User selected Code Entry option in Host. Host starts CPACE protocol with Trezor.
* @next ThpCodeEntrySecret
*/
- message ThpCodeEntryCpaceHostTag {
- required bytes cpace_host_public_key = 1; // Host's ephemeral CPace public key
- required bytes tag = 2; // SHA-256 of shared secret
-
+message ThpCodeEntryCpaceHostTag {
+ required bytes cpace_host_public_key = 1; // Host's ephemeral CPace public key
+ required bytes tag = 2; // SHA-256 of shared secret
}
/**
@@ -169,7 +164,7 @@ message ThpCodeEntryCpaceTrezor {
* @next ThpEndRequest
*/
message ThpCodeEntrySecret {
- required bytes secret = 1; // Trezor's secret
+ required bytes secret = 1; // Trezor's secret
}
/**
@@ -177,7 +172,7 @@ message ThpCodeEntrySecret {
* @next ThpQrCodeSecret
*/
message ThpQrCodeTag {
- required bytes tag = 1; // SHA-256 of shared secret
+ required bytes tag = 1; // SHA-256 of shared secret
}
/**
@@ -186,7 +181,7 @@ message ThpQrCodeTag {
* @next ThpEndRequest
*/
message ThpQrCodeSecret {
- required bytes secret = 1; // Trezor's secret
+ required bytes secret = 1; // Trezor's secret
}
/**
@@ -194,7 +189,7 @@ message ThpQrCodeSecret {
* @next ThpNfcTagTrezor
*/
message ThpNfcTagHost {
- required bytes tag = 1; // Host's tag
+ required bytes tag = 1; // Host's tag
}
/**
@@ -203,7 +198,7 @@ message ThpNfcTagHost {
* @next ThpEndRequest
*/
message ThpNfcTagTrezor {
- required bytes tag = 1; // Trezor's tag
+ required bytes tag = 1; // Trezor's tag
}
/**
@@ -212,9 +207,9 @@ message ThpNfcTagTrezor {
* @next ThpCredentialResponse
*/
message ThpCredentialRequest {
- required bytes host_static_public_key = 1; // Host's static public key identifying the credential.
- optional bool autoconnect = 2 [default=false]; // Whether host wants to autoconnect without user confirmation
- optional bytes credential = 3; // Host's previous credential
+ required bytes host_static_public_key = 1; // Host's static public key identifying the credential.
+ optional bool autoconnect = 2 [default = false]; // Whether host wants to autoconnect without user confirmation
+ optional bytes credential = 3; // Host's previous credential
}
/**
@@ -223,8 +218,8 @@ message ThpCredentialRequest {
* @next ThpEndRequest
*/
message ThpCredentialResponse {
- required bytes trezor_static_public_key = 1; // Trezor's static public key used in the handshake.
- required bytes credential = 2; // The pairing credential issued by the Trezor to the host.
+ required bytes trezor_static_public_key = 1; // Trezor's static public key used in the handshake.
+ required bytes credential = 2; // The pairing credential issued by the Trezor to the host.
}
/**
@@ -244,31 +239,31 @@ message ThpEndResponse {}
* Only for internal use.
* @embed
*/
- message ThpCredentialMetadata {
+message ThpCredentialMetadata {
option (internal_only) = true;
- required string host_name = 1; // Human-readable host name (browser name for web apps)
- optional bool autoconnect = 2; // Whether host is allowed to autoconnect without user confirmation
- required string app_name = 3; // Human-readable application name
+ required string host_name = 1; // Human-readable host name (browser name for web apps)
+ optional bool autoconnect = 2; // Whether host is allowed to autoconnect without user confirmation
+ required string app_name = 3; // Human-readable application name
}
/**
* Only for internal use.
* @embed
*/
- message ThpPairingCredential {
+message ThpPairingCredential {
option (internal_only) = true;
- required ThpCredentialMetadata cred_metadata = 1; // Credential metadata
- required bytes mac = 2; // Message authentication code generated by the Trezor
+ required ThpCredentialMetadata cred_metadata = 1; // Credential metadata
+ required bytes mac = 2; // Message authentication code generated by the Trezor
}
/**
* Only for internal use.
* @embed
*/
- message ThpAuthenticatedCredentialData {
+message ThpAuthenticatedCredentialData {
option (internal_only) = true;
- required bytes host_static_public_key = 1; // Host's static public key used in the handshake
- required ThpCredentialMetadata cred_metadata = 2; // Credential metadata
+ required bytes host_static_public_key = 1; // Host's static public key used in the handshake
+ required ThpCredentialMetadata cred_metadata = 2; // Credential metadata
}
/**
@@ -281,9 +276,9 @@ message ThpPairedCache {
repeated ThpPairedCacheEntry entries = 1;
/**
- * Only for internal use.
- * @embed
- */
+ * Only for internal use.
+ * @embed
+ */
message ThpPairedCacheEntry {
option (internal_only) = true;
required bytes mac_addr = 1; // 6-byte MAC address
diff --git a/common/protob/messages-tron.proto b/common/protob/messages-tron.proto
index 7d4d99bd..7d0a9884 100644
--- a/common/protob/messages-tron.proto
+++ b/common/protob/messages-tron.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.tron;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageTron";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
// All uint64 are actually int64 in TRON. int64 is not supported on our firmware.
@@ -16,9 +16,9 @@ option java_outer_classname = "TrezorMessageTron";
* @next Failure
*/
message TronGetAddress {
- 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
- optional bool chunkify = 3; // Display the address in chunks of 4 characters
+ 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
+ optional bool chunkify = 3; // Display the address in chunks of 4 characters
}
/**
@@ -26,8 +26,8 @@ message TronGetAddress {
* @end
*/
message TronAddress {
- required string address = 1; // Tron address in Base58Check encoding
- optional bytes mac = 2; // Address authentication code
+ required string address = 1; // Tron address in Base58Check encoding
+ optional bytes mac = 2; // Address authentication code
}
/**
@@ -36,13 +36,16 @@ message TronAddress {
* @next TronContractRequest
*/
message TronSignTx {
- repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
- required bytes ref_block_bytes = 2; // The height of the transaction reference block, using the 6th to 8th (exclusive) bytes of the reference block height, a total of 2 bytes
- required bytes ref_block_hash = 3; // The hash of the transaction reference block
- required uint64 expiration = 4; // Transaction expiration time, beyond which the transaction will no longer be packed
- optional bytes data = 5; // Transaction memo. (256 bytes maximum, this is a Trezor limitation, not a Tron protocol limitation)
- required uint64 timestamp = 6; // Transaction timestamp, set as the transaction creation time
- optional uint64 fee_limit = 7; // Not TRX. Maximum Energy cost. Only for deploying or triggering smart contracts.
+ repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
+ required bytes ref_block_bytes = 2; // The height of the transaction reference block, using the 6th to 8th
+ // (exclusive) bytes of the reference block height, a total of 2 bytes
+ required bytes ref_block_hash = 3; // The hash of the transaction reference block
+ required uint64 expiration = 4; // Transaction expiration time, beyond which the transaction
+ // will no longer be packed
+ optional bytes data = 5; // Transaction memo. (256 bytes maximum, this is a Trezor limitation,
+ // not a Tron protocol limitation)
+ required uint64 timestamp = 6; // Transaction timestamp, set as the transaction creation time
+ optional uint64 fee_limit = 7; // Not TRX. Maximum Energy cost. Only for deploying or triggering smart contracts.
}
/**
@@ -53,8 +56,7 @@ message TronSignTx {
* @next TronUnfreezeBalanceV2Contract
* @next TronWithdrawUnfreeze
*/
-message TronContractRequest {
-}
+message TronContractRequest {}
/**
* Request: Fill in TransferContract details
@@ -63,21 +65,20 @@ message TronContractRequest {
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/contract/balance_contract.proto#L32-L36
message TronTransferContract {
// https://developers.tron.network/docs/tron-contracttype#2-transfercontract
- required bytes owner_address = 1; // Sender's address, Base58Check encoding
- required bytes to_address = 2; // Recipient's address, Base58Check encoding
- required uint64 amount = 3; // Transfer amount (in SUN)
+ required bytes owner_address = 1; // Sender's address, Base58Check encoding
+ required bytes to_address = 2; // Recipient's address, Base58Check encoding
+ required uint64 amount = 3; // Transfer amount (in SUN)
}
-
/**
* Request: Fill in TriggerSmartContract details. TRC-10 not supported.
* @next TronSignature
*/
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/contract/smart_contract.proto#L74
message TronTriggerSmartContract {
- required bytes owner_address = 1; // Sender account, signs transaction
- required bytes contract_address = 2; // Target smart contract address
- required bytes data = 4; // ABI-encoded function call data
+ required bytes owner_address = 1; // Sender account, signs transaction
+ required bytes contract_address = 2; // Target smart contract address
+ required bytes data = 4; // ABI-encoded function call data
}
/**
@@ -86,9 +87,10 @@ message TronTriggerSmartContract {
*/
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/contract/balance_contract.proto#L84-L88
message TronFreezeBalanceV2Contract {
- required bytes owner_address = 1; // Account whose TRX has to be frozen
- required uint64 balance = 2; // Amount to be frozen (in SUN)
- optional TronResourceCode resource = 3 [default = BANDWIDTH]; // Resource obtained against freezing. Optional with default required in proto2
+ required bytes owner_address = 1; // Account whose TRX has to be frozen
+ required uint64 balance = 2; // Amount to be frozen (in SUN)
+ optional TronResourceCode resource = 3 [default = BANDWIDTH]; // Resource obtained against freezing.
+ // Optional with default required in proto2
}
/**
@@ -97,9 +99,9 @@ message TronFreezeBalanceV2Contract {
*/
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/contract/balance_contract.proto#L90-L94
message TronUnfreezeBalanceV2Contract {
- required bytes owner_address = 1; // Account whose TRX has to be unfrozen
- required uint64 balance = 2; // Amount to be unfrozen (in SUN)
- optional TronResourceCode resource = 3 [default = BANDWIDTH]; // Resource being forfeited.
+ required bytes owner_address = 1; // Account whose TRX has to be unfrozen
+ required uint64 balance = 2; // Amount to be unfrozen (in SUN)
+ optional TronResourceCode resource = 3 [default = BANDWIDTH]; // Resource being forfeited.
}
/**
@@ -108,7 +110,7 @@ message TronUnfreezeBalanceV2Contract {
*/
// https://github.com/tronprotocol/protocol/blob/4c726956542b8dff5a4bd5c54aa07cd9da257d08/core/contract/balance_contract.proto#L96
message TronWithdrawUnfreeze {
- required bytes owner_address = 1; // Address to claim all unfrozen TRX.
+ required bytes owner_address = 1; // Address to claim all unfrozen TRX.
}
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/contract/common.proto#L9C1-L13C2
@@ -124,10 +126,9 @@ enum TronResourceCode {
* @end
*/
message TronSignature {
- required bytes signature = 1; // Signature of the transaction
+ required bytes signature = 1; // Signature of the transaction
}
-
/**
* TronRawTransaction and embedded messages are used to encode the Tron transaction, not for communication.
* @start
@@ -145,10 +146,9 @@ message TronRawTransaction {
// https://github.com/tronprotocol/protocol/blob/37bb922a9967bbbef1e84de1c9e5cda56a2d7998/core/Tron.proto#L337-L385
message TronRawContract {
-
message TronRawParameter {
- required string type_url = 1; // e.g., "type.googleapis.com/protocol.TransferContract"
- required bytes value = 2; // The serialized value of the contract parameter, e.g., TronTransferContract
+ required string type_url = 1; // e.g., "type.googleapis.com/protocol.TransferContract"
+ required bytes value = 2; // The serialized value of the contract parameter, e.g., TronTransferContract
}
enum TronRawContractType {
@@ -161,6 +161,5 @@ message TronRawTransaction {
required TronRawContractType type = 1;
required TronRawParameter parameter = 2;
-
}
}
diff --git a/common/protob/messages-webauthn.proto b/common/protob/messages-webauthn.proto
index 10bf4604..60cf932d 100644
--- a/common/protob/messages-webauthn.proto
+++ b/common/protob/messages-webauthn.proto
@@ -2,8 +2,8 @@ syntax = "proto2";
package hw.trezor.messages.webauthn;
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageWebAuthn";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/**
* Request: List resident credentials
@@ -11,8 +11,7 @@ option java_outer_classname = "TrezorMessageWebAuthn";
* @next WebAuthnCredentials
* @next Failure
*/
-message WebAuthnListResidentCredentials {
-}
+message WebAuthnListResidentCredentials {}
/**
* Request: Add resident credential
@@ -34,7 +33,6 @@ message WebAuthnRemoveResidentCredential {
optional uint32 index = 1;
}
-
/**
* Response: Resident credential list
* @start
diff --git a/common/protob/messages.proto b/common/protob/messages.proto
index fd0a1eb3..b1a98b69 100644
--- a/common/protob/messages.proto
+++ b/common/protob/messages.proto
@@ -1,16 +1,17 @@
syntax = "proto2";
package hw.trezor.messages;
+import "options.proto";
+
/**
* Messages for Trezor communication
*/
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessage";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
-import "options.proto";
-
+// Include in BTC-only firmware
option (include_in_bitcoin_only) = true;
/**
@@ -124,7 +125,8 @@ enum MessageType {
reserved 71 to 74;
// Debug
- MessageType_DebugLinkDecision = 100 [(bitcoin_only) = true, (wire_debug_in) = true, (wire_tiny) = true, (wire_no_fsm) = true];
+ MessageType_DebugLinkDecision = 100
+ [(bitcoin_only) = true, (wire_debug_in) = true, (wire_tiny) = true, (wire_no_fsm) = true];
MessageType_DebugLinkGetState = 101 [(bitcoin_only) = true, (wire_debug_in) = true, (wire_tiny) = true];
MessageType_DebugLinkState = 102 [(bitcoin_only) = true, (wire_debug_out) = true];
MessageType_DebugLinkStop = 103 [(bitcoin_only) = true, (wire_debug_in) = true];
diff --git a/common/protob/options.proto b/common/protob/options.proto
index 2749db6e..93ad7366 100644
--- a/common/protob/options.proto
+++ b/common/protob/options.proto
@@ -1,11 +1,11 @@
syntax = "proto2";
package hw.trezor.messages;
+import "google/protobuf/descriptor.proto";
+
// Sugar for easier handling in Java
-option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorOptions";
-
-import "google/protobuf/descriptor.proto";
+option java_package = "com.satoshilabs.trezor.lib.protobuf";
/************************* WARNING ***********************
Due to the way extensions are accessed in pb2py, there needs to be a globally unique
@@ -29,35 +29,40 @@ The convention to achieve this is as follows:
/**
* Options for specifying message direction and type of wire (normal/debug)
*/
- extend google.protobuf.EnumValueOptions {
- optional bool wire_in = 50002; // message can be transmitted via wire from PC to Trezor
- optional bool wire_out = 50003; // message can be transmitted via wire from Trezor to PC
- optional bool wire_debug_in = 50004; // message can be transmitted via debug wire from PC to Trezor
- optional bool wire_debug_out = 50005; // message can be transmitted via debug wire from Trezor to PC
- optional bool wire_tiny = 50006; // message is handled by Trezor when the USB stack is in tiny mode
- optional bool wire_bootloader = 50007; // message is only handled by Trezor Bootloader
- optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode
+extend google.protobuf.EnumValueOptions {
+ optional bool wire_in = 50002; // message can be transmitted via wire from PC to Trezor
+ optional bool wire_out = 50003; // message can be transmitted via wire from Trezor to PC
+ optional bool wire_debug_in = 50004; // message can be transmitted via debug wire from PC to Trezor
+ optional bool wire_debug_out = 50005; // message can be transmitted via debug wire from Trezor to PC
+ optional bool wire_tiny = 50006; // message is handled by Trezor when the USB stack is in tiny mode
+ optional bool wire_bootloader = 50007; // message is only handled by Trezor Bootloader
+ optional bool wire_no_fsm = 50008; // message is not handled by Trezor unless the USB stack is in tiny mode
- optional bool bitcoin_only = 60000; // enum value is available on BITCOIN_ONLY build
- // (messages not marked bitcoin_only will be EXCLUDED)
+ optional bool bitcoin_only = 60000; // enum value is available on BITCOIN_ONLY build
+ // (messages not marked bitcoin_only will be EXCLUDED)
}
/** Options for tagging enum types */
extend google.protobuf.EnumOptions {
- optional bool has_bitcoin_only_values = 51001; // indicate that some values should be excluded on BITCOIN_ONLY builds
- optional bool wire_enum = 51002; // this enum is used for mapping wire type integer to message type, it cannot be used as normal enum
+ optional bool has_bitcoin_only_values = 51001; // indicate that some values should be excluded
+ // on BITCOIN_ONLY builds
+ optional bool wire_enum = 51002; // this enum is used for mapping wire type integer to message
+ // type, it cannot be used as normal enum
}
/** Options for tagging message types */
extend google.protobuf.MessageOptions {
- optional bool experimental_message = 52001; // indicate that a message is intended for development and beta testing only and its definition may change at any time
+ optional bool experimental_message = 52001; // indicate that a message is intended for development and beta testing
+ // only and its definition may change at any time
optional uint32 wire_type = 52002; // override wire type specified in the MessageType enum
- optional bool internal_only = 52003; // indicate that a message is intended for internal use only and should not be transmitted via the wire
+ optional bool internal_only = 52003; // indicate that a message is intended for internal use
+ // only and should not be transmitted via the wire
}
/** Options for tagging field types */
extend google.protobuf.FieldOptions {
- optional bool experimental_field = 53001; // indicate that a field is intended for development and beta testing only
+ optional bool experimental_field = 53001; // indicate that a field is intended for development
+ // and beta testing only
}
/** Options for tagging files with protobuf definitions */
diff --git a/core/embed/projects/bootloader/protob/pb/messages.proto b/core/embed/projects/bootloader/protob/pb/messages.proto
index 7060cc55..b73bfa86 100644
--- a/core/embed/projects/bootloader/protob/pb/messages.proto
+++ b/core/embed/projects/bootloader/protob/pb/messages.proto
@@ -1,6 +1,5 @@
syntax = "proto2";
-
/**
* Mapping between Trezor wire identifier (uint) and a protobuf message
*/
@@ -25,16 +24,14 @@ enum MessageType {
* @start
* @next Features
*/
-message Initialize {
-}
+message Initialize {}
/**
* Request: Ask for device details (no device reset)
* @start
* @next Features
*/
-message GetFeatures {
-}
+message GetFeatures {}
/**
* Request: Request device to wipe all sensitive data and settings
@@ -42,42 +39,41 @@ message GetFeatures {
* @next Success
* @next Failure
*/
-message WipeDevice {
-}
+message WipeDevice {}
/**
* Response: Reports various information about the device
* @end
*/
message Features {
- optional string vendor = 1; // name of the manufacturer, e.g. "trezor.io"
- required uint32 major_version = 2; // major version of the firmware/bootloader, e.g. 1
- required uint32 minor_version = 3; // minor version of the firmware/bootloader, e.g. 0
- required uint32 patch_version = 4; // patch version of the firmware/bootloader, e.g. 0
- optional uint32 build_version = 61; // build version of the firmware/bootloader, e.g. 0
- optional bool bootloader_mode = 5; // is device in bootloader mode?
- optional string device_id = 6; // device's unique identifier
- optional string language = 9; // device language
- optional string label = 10; // device description label
- optional bool initialized = 12; // does device contain seed?
- optional bytes revision = 13; // SCM revision of firmware
- optional bool firmware_present = 18; // is firmware loaded?
- optional string model = 21; // device hardware model
- optional uint32 fw_major = 22; // reported firmware version if in bootloader mode
- optional uint32 fw_minor = 23; // reported firmware version if in bootloader mode
- optional uint32 fw_patch = 24; // reported firmware version if in bootloader mode
- optional uint32 fw_build = 62; // reported firmware version if in bootloader mode
- optional string fw_vendor = 25; // reported firmware vendor if in bootloader mode
- // optional bytes fw_vendor_keys = 26; // obsoleted, use fw_vendor
- optional string internal_model = 44; // internal model name
- optional uint32 unit_color = 45; // color of the unit/device
- optional bool unit_btconly = 46; // unit/device is intended as bitcoin only
- optional bool bootloader_locked = 49; // bootloader is locked
- optional uint32 unit_packaging = 51; // unit/device packaging version
- optional uint32 soc = 55; // Battery state of charge (0 - 100%)
- optional bool firmware_corrupted = 56; // is firmware corrupted?
- optional bool usb_connected = 59; // USB connected
- optional bool wireless_connected = 60; // Wireless charger connected
+ optional string vendor = 1; // name of the manufacturer, e.g. "trezor.io"
+ required uint32 major_version = 2; // major version of the firmware/bootloader, e.g. 1
+ required uint32 minor_version = 3; // minor version of the firmware/bootloader, e.g. 0
+ required uint32 patch_version = 4; // patch version of the firmware/bootloader, e.g. 0
+ optional uint32 build_version = 61; // build version of the firmware/bootloader, e.g. 0
+ optional bool bootloader_mode = 5; // is device in bootloader mode?
+ optional string device_id = 6; // device's unique identifier
+ optional string language = 9; // device language
+ optional string label = 10; // device description label
+ optional bool initialized = 12; // does device contain seed?
+ optional bytes revision = 13; // SCM revision of firmware
+ optional bool firmware_present = 18; // is firmware loaded?
+ optional string model = 21; // device hardware model
+ optional uint32 fw_major = 22; // reported firmware version if in bootloader mode
+ optional uint32 fw_minor = 23; // reported firmware version if in bootloader mode
+ optional uint32 fw_patch = 24; // reported firmware version if in bootloader mode
+ optional uint32 fw_build = 62; // reported firmware version if in bootloader mode
+ optional string fw_vendor = 25; // reported firmware vendor if in bootloader mode
+ // optional bytes fw_vendor_keys = 26; // obsoleted, use fw_vendor
+ optional string internal_model = 44; // internal model name
+ optional uint32 unit_color = 45; // color of the unit/device
+ optional bool unit_btconlWhy this scored 15/100
Community notes
Notes can correct, qualify, or add evidence to the AI analysis. Every note shown here has been validated by a human moderator.
The AI analysis stands alone for now. Submit a note if you can add evidence or important context.