mirror of
https://github.com/trezor/trezor-firmware.git
synced 2025-07-02 04:42:33 +00:00

core: refactor writing native_call with length core: removed hex encoded string branch from native_call calculation common: nested OntologyTransaction into OntologySignTx core: fix ontology layout formatting python: change the way ontology message signing works python: add expected fields to ontology core+python+common: remove type field from OntologyTransaction core: inline write_push_bytes
134 lines
3.4 KiB
Protocol Buffer
134 lines
3.4 KiB
Protocol Buffer
syntax = "proto2";
|
|
package hw.trezor.messages.ontology;
|
|
|
|
// Sugar for easier handling in Java
|
|
option java_package = "com.satoshilabs.trezor.lib.protobuf";
|
|
option java_outer_classname = "TrezorMessageOntology";
|
|
|
|
|
|
/**
|
|
* Request: Ask device for Ontology public key corresponding to address_n path
|
|
* @start
|
|
* @next OntologyPublicKey
|
|
*/
|
|
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
|
|
*/
|
|
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 transaction
|
|
* @start
|
|
* @next OntologySignedTx
|
|
*/
|
|
message OntologySignTx{
|
|
repeated uint32 address_n = 1;
|
|
optional OntologyTransaction transaction = 2;
|
|
optional OntologyTransfer transfer = 3;
|
|
optional OntologyWithdrawOng withdraw_ong = 4;
|
|
optional OntologyOntIdRegister ont_id_register = 5;
|
|
optional OntologyOntIdAddAttributes ont_id_add_attributes = 6;
|
|
|
|
message OntologyTransfer {
|
|
optional OntologyAsset asset = 1;
|
|
optional uint64 amount = 2;
|
|
optional string from_address = 3;
|
|
optional string to_address = 4;
|
|
/**
|
|
* Ontology Asset
|
|
*/
|
|
enum OntologyAsset {
|
|
ONT = 1;
|
|
ONG = 2;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ontology ONG Withdrawal
|
|
*/
|
|
message OntologyWithdrawOng {
|
|
optional uint64 amount = 1;
|
|
optional string from_address = 2;
|
|
optional string to_address = 3;
|
|
}
|
|
|
|
/**
|
|
* Ontology ONT ID registration
|
|
*/
|
|
message OntologyOntIdRegister {
|
|
optional string ont_id = 1;
|
|
optional bytes public_key = 2;
|
|
}
|
|
|
|
/**
|
|
* Ontology ONT ID attributes adding
|
|
*/
|
|
message OntologyOntIdAddAttributes {
|
|
optional string ont_id = 1;
|
|
optional bytes public_key = 2;
|
|
repeated OntologyOntIdAttribute ont_id_attributes = 3;
|
|
/**
|
|
* Attribute of Ontology ONT ID
|
|
*/
|
|
message OntologyOntIdAttribute {
|
|
optional string key = 1;
|
|
optional string type = 2;
|
|
optional string value = 3;
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Ontology Transaction
|
|
* @embed
|
|
*/
|
|
message OntologyTransaction {
|
|
optional uint32 version = 1;
|
|
optional uint32 nonce = 2;
|
|
optional uint64 gas_price = 3;
|
|
optional uint64 gas_limit = 4;
|
|
optional string payer = 5;
|
|
repeated OntologyTxAttribute tx_attributes = 6;
|
|
/**
|
|
* Attribute of Ontology transaction
|
|
*/
|
|
message OntologyTxAttribute {
|
|
optional uint32 usage = 1;
|
|
optional bytes data = 2;
|
|
}
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Response: Contains Ontology tx signature and payload
|
|
* @end
|
|
*/
|
|
message OntologySignedTx {
|
|
optional bytes signature = 1;
|
|
}
|