2018-08-14 13:23:07 +00:00
|
|
|
|
syntax = "proto2";
|
|
|
|
|
|
|
|
|
|
// Sugar for easier handling in Java
|
|
|
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
|
|
|
option java_outer_classname = "TrezorMessageOntology";
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Ontology Transaction
|
|
|
|
|
* @embed
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyTransaction {
|
|
|
|
|
optional uint32 version = 1;
|
|
|
|
|
optional uint32 type = 2;
|
|
|
|
|
optional uint32 nonce = 3;
|
|
|
|
|
optional uint64 gas_price = 4;
|
|
|
|
|
optional uint64 gas_limit = 5;
|
|
|
|
|
optional string payer = 6;
|
|
|
|
|
repeated OntologyTxAttribute tx_attributes = 7;
|
2018-08-14 13:25:42 +00:00
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Attribute of Ontology transaction
|
|
|
|
|
*/
|
2018-08-14 13:25:42 +00:00
|
|
|
|
message OntologyTxAttribute {
|
|
|
|
|
optional uint32 usage = 1;
|
|
|
|
|
optional bytes data = 2;
|
|
|
|
|
}
|
2018-08-14 13:23:07 +00:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device for Ontology public key corresponding to address_n path
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologyPublicKey
|
2018-08-14 18:59:00 +00:00
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyGetPublicKey {
|
|
|
|
|
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 Ontology public key derived from device private seed
|
|
|
|
|
* @end
|
2018-08-14 18:59:00 +00:00
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyPublicKey {
|
|
|
|
|
optional bytes public_key = 1; // Ontology public key
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device for Ontology address corresponding to address_n path
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologyAddress
|
|
|
|
|
*/
|
|
|
|
|
message OntologyGetAddress {
|
|
|
|
|
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 Ontology address derived from device private seed
|
|
|
|
|
* @end
|
|
|
|
|
*/
|
|
|
|
|
message OntologyAddress {
|
|
|
|
|
optional string address = 1; // Ontology address
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device to sign Ontology transfer
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologySignedTransfer
|
|
|
|
|
*/
|
2018-08-14 18:59:00 +00:00
|
|
|
|
message OntologySignTransfer {
|
2018-08-14 13:23:07 +00:00
|
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
|
optional OntologyTransaction transaction = 2;
|
|
|
|
|
optional OntologyTransfer transfer = 3;
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Ontology Transfer
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyTransfer {
|
2018-08-14 13:25:42 +00:00
|
|
|
|
optional OntologyAsset asset = 1;
|
|
|
|
|
optional uint64 amount = 2;
|
|
|
|
|
optional string from_address = 3;
|
|
|
|
|
optional string to_address = 4;
|
2018-08-14 13:23:07 +00:00
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Ontology Asset
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
enum OntologyAsset {
|
|
|
|
|
ONT = 1;
|
|
|
|
|
ONG = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Response: Contains Ontology transfer signature
|
|
|
|
|
* @end
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologySignedTransfer {
|
|
|
|
|
optional bytes signature = 1;
|
|
|
|
|
optional bytes payload = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device to sign Ontology ONG withdrawal
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologySignedWithdrawOng
|
|
|
|
|
*/
|
2018-08-14 18:59:00 +00:00
|
|
|
|
message OntologySignWithdrawOng {
|
2018-08-14 13:23:07 +00:00
|
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
|
optional OntologyTransaction transaction = 2;
|
|
|
|
|
optional OntologyWithdrawOng withdraw_ong = 3;
|
|
|
|
|
/**
|
|
|
|
|
* Ontology ONG Withdrawal
|
|
|
|
|
*/
|
|
|
|
|
message OntologyWithdrawOng {
|
|
|
|
|
optional uint64 amount = 1;
|
|
|
|
|
optional string from_address = 2;
|
|
|
|
|
optional string to_address = 3;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Response: Contains Ontology ONG withdrawal signature
|
|
|
|
|
* @end
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologySignedWithdrawOng {
|
|
|
|
|
optional bytes signature = 1;
|
|
|
|
|
optional bytes payload = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device to sign Ontology ONT ID registration
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologySignedOntIdRegister
|
|
|
|
|
*/
|
2018-08-14 18:59:00 +00:00
|
|
|
|
message OntologySignOntIdRegister {
|
2018-08-14 13:23:07 +00:00
|
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
|
optional OntologyTransaction transaction = 2;
|
|
|
|
|
optional OntologyOntIdRegister ont_id_register = 3;
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Ontology ONT ID registration
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyOntIdRegister {
|
|
|
|
|
optional string ont_id = 1;
|
|
|
|
|
optional bytes public_key = 2;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Response: Contains Ontology ONT ID registration signature
|
|
|
|
|
* @end
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologySignedOntIdRegister {
|
|
|
|
|
optional bytes signature = 1;
|
|
|
|
|
optional bytes payload = 2;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
|
* Request: Ask device to sign Ontology ONT ID attributes adding
|
|
|
|
|
* @start
|
|
|
|
|
* @next OntologySignedOntIdAddAttributes
|
|
|
|
|
*/
|
2018-08-14 18:59:00 +00:00
|
|
|
|
message OntologySignOntIdAddAttributes {
|
2018-08-14 13:23:07 +00:00
|
|
|
|
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node
|
|
|
|
|
optional OntologyTransaction transaction = 2;
|
|
|
|
|
optional OntologyOntIdAddAttributes ont_id_add_attributes = 3;
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Ontology ONT ID attributes adding
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologyOntIdAddAttributes {
|
|
|
|
|
optional string ont_id = 1;
|
|
|
|
|
optional bytes public_key = 2;
|
|
|
|
|
repeated OntologyOntIdAttribute ont_id_attributes = 3;
|
2018-08-14 13:25:42 +00:00
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Attribute of Ontology ONT ID
|
|
|
|
|
*/
|
2018-08-14 13:25:42 +00:00
|
|
|
|
message OntologyOntIdAttribute {
|
|
|
|
|
optional string key = 1;
|
|
|
|
|
optional string type = 2;
|
|
|
|
|
optional string value = 3;
|
|
|
|
|
}
|
2018-08-14 13:23:07 +00:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
/**
|
2018-08-14 18:59:00 +00:00
|
|
|
|
* Response: Contains Ontology ONT ID attributes adding signature
|
|
|
|
|
* @end
|
|
|
|
|
*/
|
2018-08-14 13:23:07 +00:00
|
|
|
|
message OntologySignedOntIdAddAttributes {
|
|
|
|
|
optional bytes signature = 1;
|
|
|
|
|
optional bytes payload = 2;
|
|
|
|
|
}
|