2018-07-04 14:44:26 +00:00
|
|
|
syntax = "proto2";
|
2018-07-29 14:17:00 +00:00
|
|
|
package hw.trezor.messages.cardano;
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
// Sugar for easier handling in Java
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
option java_outer_classname = "TrezorMessageCardano";
|
|
|
|
|
2018-07-16 13:00:18 +00:00
|
|
|
import "messages-common.proto";
|
2018-07-04 14:44:26 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device for Cardano address
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @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
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message CardanoAddress {
|
|
|
|
optional string address = 1; // Base58 cardano address
|
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Request: Ask device for public key corresponding to address_n path
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next CardanoPublicKey
|
|
|
|
* @next Failure
|
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message CardanoGetPublicKey {
|
2018-07-04 14:44:26 +00:00
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
2018-08-20 13:49:52 +00:00
|
|
|
optional bool show_display = 2; // optionally show on display before sending the result
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Contains public key derived from device private seed
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message CardanoPublicKey {
|
2018-07-29 14:17:00 +00:00
|
|
|
optional string xpub = 1; // Xpub key
|
|
|
|
optional hw.trezor.messages.common.HDNodeType node = 2; // BIP-32 public node
|
|
|
|
optional string root_hd_passphrase = 3; // HD passphrase for root in hex format
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
2018-07-16 14:51:03 +00:00
|
|
|
* Request: Ask device to sign Cardano message
|
|
|
|
* @start
|
|
|
|
* @next CardanoMessageSignature
|
2018-07-04 14:44:26 +00:00
|
|
|
* @next Failure
|
|
|
|
*/
|
2018-07-16 14:51:03 +00:00
|
|
|
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
|
2018-07-04 14:44:26 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Response: Signed Cardano message
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
|
|
|
message CardanoMessageSignature {
|
|
|
|
optional bytes public_key = 1; // public key which was used to sign mesage
|
|
|
|
optional bytes signature = 2; // signature of the message
|
|
|
|
}
|
|
|
|
|
2018-07-16 14:51:03 +00:00
|
|
|
/**
|
|
|
|
* Request: Ask device to verify Cardano message
|
|
|
|
* @start
|
|
|
|
* @next Success
|
|
|
|
* @next Failure
|
|
|
|
*/
|
2018-07-16 16:19:46 +00:00
|
|
|
message CardanoVerifyMessage {
|
2018-07-16 14:51:03 +00:00
|
|
|
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
|
|
|
|
}
|
|
|
|
|
2018-07-04 14:44:26 +00:00
|
|
|
/**
|
|
|
|
* Request: Ask device to sign Cardano transaction
|
2018-07-16 14:51:03 +00:00
|
|
|
* @start
|
2018-08-21 09:57:08 +00:00
|
|
|
* @next CardanoSignedTx
|
2018-07-04 14:44:26 +00:00
|
|
|
* @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
|
|
|
|
}
|
|
|
|
|
2018-07-16 16:19:46 +00:00
|
|
|
/**
|
|
|
|
* Request: Reported transaction data
|
2018-08-21 09:57:08 +00:00
|
|
|
* @next CardanoSignedTx
|
2018-07-16 16:19:46 +00:00
|
|
|
* @next CardanoTxRequest
|
|
|
|
*/
|
|
|
|
message CardanoTxAck {
|
|
|
|
optional bytes transaction = 1;
|
|
|
|
}
|
|
|
|
|
2018-07-04 14:44:26 +00:00
|
|
|
/**
|
|
|
|
* Response: Serialised signed cardano transaction
|
2018-07-16 14:51:03 +00:00
|
|
|
* @end
|
2018-07-04 14:44:26 +00:00
|
|
|
*/
|
2018-08-21 09:57:08 +00:00
|
|
|
message CardanoSignedTx {
|
2018-07-04 14:44:26 +00:00
|
|
|
optional bytes tx_hash = 1; // hash of the signed transaction
|
|
|
|
optional bytes tx_body = 2; // serialised body of the signed transaction
|
|
|
|
}
|