mirror of
https://github.com/trezor/trezor-firmware.git
synced 2024-12-16 19:38:09 +00:00
123 lines
3.8 KiB
Protocol Buffer
123 lines
3.8 KiB
Protocol Buffer
syntax = "proto2";
|
|
|
|
// Sugar for easier handling in Java
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
option java_outer_classname = "TrezorMessageTezos";
|
|
|
|
/**
|
|
* Request: Ask device for Tezos address corresponding to address_n path
|
|
* @next PassphraseRequest
|
|
* @next TezosAddress
|
|
* @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
|
|
}
|
|
|
|
/**
|
|
* Response: Contains Tezos address derived from device private seed
|
|
* @prev TezosGetAddress
|
|
*/
|
|
message TezosAddress {
|
|
optional string address = 1; // Coin address in Base58 encoding
|
|
}
|
|
|
|
/**
|
|
* Request: Ask device to sign Tezos transaction
|
|
* @next TezosSignedTx
|
|
*/
|
|
message TezosSignTx {
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
optional TezosOperationCommon operation = 2; // Tezos operation structure
|
|
optional TezosTransactionType transaction = 3; // Tezos transaction part
|
|
optional TezosOriginationType origination = 4; // Tezos origination part
|
|
optional TezosDelegationType delegation = 5; // Tezos delegation part
|
|
/*
|
|
* Tezos contract ID
|
|
*/
|
|
message TezosContractID {
|
|
optional TezosContractType tag = 1;
|
|
optional bytes hash = 2; // Implicit = 21B, originated = 20B + 1B padding
|
|
/*
|
|
* Type of Tezos Contract type
|
|
*/
|
|
enum TezosContractType {
|
|
Implicit = 0;
|
|
Originated = 1;
|
|
}
|
|
}
|
|
/*
|
|
* Structure representing the common part for Tezos operations
|
|
*/
|
|
message TezosOperationCommon {
|
|
optional bytes branch = 1;
|
|
optional TezosOperationType tag = 2;
|
|
optional TezosContractID source = 3;
|
|
optional uint64 fee = 4;
|
|
optional uint64 counter = 5;
|
|
optional uint64 gas_limit = 6;
|
|
optional uint64 storage_limit = 7;
|
|
/*
|
|
* Type of Tezos operation
|
|
*/
|
|
enum TezosOperationType {
|
|
Transaction = 8;
|
|
Origination = 9;
|
|
Delegation = 10;
|
|
}
|
|
}
|
|
/*
|
|
* Structure representing additional information for transaction
|
|
*/
|
|
message TezosTransactionType {
|
|
optional uint64 amount = 1;
|
|
optional TezosContractID destination = 2;
|
|
optional bytes parameters = 3;
|
|
}
|
|
/*
|
|
* Structure representing additional information for origination
|
|
*/
|
|
message TezosOriginationType {
|
|
optional bytes manager_pubkey = 1;
|
|
optional uint64 balance = 2;
|
|
optional bool spendable = 3;
|
|
optional bool delegatable = 4;
|
|
optional bytes delegate = 5; // 1B tag + 20B public key hash
|
|
optional bytes script = 6;
|
|
}
|
|
/*
|
|
* Structure representing additional information for delegation
|
|
*/
|
|
message TezosDelegationType {
|
|
optional bytes delegate = 1; // 1B tag + 20B public key hash
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Response: Contains Tezos transaction signature
|
|
* @prev TezosSignTx
|
|
*/
|
|
message TezosSignedTx {
|
|
optional bytes signature = 1; // Tezos transaction signature
|
|
optional bytes sig_op_contents = 2; // Signed operation contents
|
|
optional string operation_hash = 3; // b58 check encoded blake2b hashed operation contents
|
|
}
|
|
|
|
/**
|
|
* Request: Ask device for Tezos public key corresponding to address_n path
|
|
* @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
|
|
}
|
|
|
|
/**
|
|
* Response: Contains Tezos public key derived from device private seed
|
|
* @prev TezosGetPublicKey
|
|
*/
|
|
message TezosPublicKey {
|
|
optional bytes public_key = 1; // Tezos public key
|
|
}
|