1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-16 11:28:14 +00:00
trezor-firmware/protob/messages-cardano.proto

138 lines
4.1 KiB
Protocol Buffer

syntax = "proto2";
// Sugar for easier handling in Java
option java_package = "com.satoshilabs.trezor.lib.protobuf";
option java_outer_classname = "TrezorMessageCardano";
import "messages-common.proto";
/**
* Request: Ask device for Cardano address
* @start
* @next CardanoAddress
* @next Failure
*/
message CardanoGetAddress {
repeated uint32 address_n = 1; // BIP-32-style path to derive the key from master node
optional bool show_display = 2; // optionally prompt for confirmation on trezor display
}
/**
* Request: Ask device for Cardano address
* @end
*/
message CardanoAddress {
optional string address = 1; // Base58 cardano address
}
/**
* Request: Ask device for public key corresponding to address_n path
* @start
* @next CardanoPublicKey
* @next Failure
*/
message CardanoGetPublicKey {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
}
/**
* Response: Contains public key derived from device private seed
* @end
*/
message CardanoPublicKey {
optional string xpub = 1; // Xpub key
optional HDNodeType node = 2; // BIP-32 public node
optional string root_hd_passphrase = 3; // HD passphrase for root in hex format
}
/**
* Request: Ask device to sign Cardano message
* @start
* @next CardanoMessageSignature
* @next Failure
*/
message CardanoSignMessage {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bytes message = 2; // message to be signed
}
/**
* Response: Signed Cardano message
* @end
*/
message CardanoMessageSignature {
optional bytes public_key = 1; // public key which was used to sign mesage
optional bytes signature = 2; // signature of the message
}
/**
* Request: Ask device to verify Cardano message
* @start
* @next Success
* @next Failure
*/
message CardanoVerifyMessage {
optional bytes public_key = 1; // Public key which was used to sign message
optional bytes signature = 2; // signature to verify
optional bytes message = 3; // message to verify
}
/**
* Request: Ask device to sign Cardano transaction
* @start
* @next CardanoSignedTransaction
* @next CardanoTxRequest
* @next Failure
*/
message CardanoSignTransaction {
repeated CardanoTxInputType inputs = 1; // inputs to be used in transaction
repeated CardanoTxOutputType outputs = 2; // outputs to be used in transaction
optional uint32 transactions_count = 3; // transactions count
/**
* Structure representing cardano transaction input
*/
message CardanoTxInputType {
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
optional bytes prev_hash = 2; // hash of previous transaction output to spend by this input
optional uint32 prev_index = 3; // index of previous output to spend
optional uint32 type = 4; // input type, defaults to 0
}
/**
* Structure representing cardano transaction output
*/
message CardanoTxOutputType {
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"
optional uint64 amount = 3; // amount to spend
}
}
/**
* Response: Serialised signed cardano transaction if tx_index is not specified.
* If tx_index is specified, trezor will wait for transaction
* @next CardanoTxAck
*/
message CardanoTxRequest {
optional uint32 tx_index = 1; // index of requested transaction
optional bytes tx_hash = 2; // hash of the signed transaction
optional bytes tx_body = 3; // serialised body of the signed transaction
}
/**
* Request: Reported transaction data
* @next CardanoSignedTransaction
* @next CardanoTxRequest
*/
message CardanoTxAck {
optional bytes transaction = 1;
}
/**
* Response: Serialised signed cardano transaction
* @end
*/
message CardanoSignedTransaction {
optional bytes tx_hash = 1; // hash of the signed transaction
optional bytes tx_body = 2; // serialised body of the signed transaction
}