From ea3c8eaef0a88ea04f0937e1faa983061ea96101 Mon Sep 17 00:00:00 2001 From: slush Date: Fri, 5 Apr 2013 17:12:43 +0200 Subject: [PATCH] Refactored protobuf --- protobuf/bitkey.proto | 23 ++++++++++------------- 1 file changed, 10 insertions(+), 13 deletions(-) diff --git a/protobuf/bitkey.proto b/protobuf/bitkey.proto index 8364a4f..9e18b6b 100644 --- a/protobuf/bitkey.proto +++ b/protobuf/bitkey.proto @@ -31,16 +31,16 @@ message Initialize { // Response object for Initialize. Contains list of available features on the device. message Features { - required bytes session_id = 1; // Echoed back from Initialize message + optional bytes session_id = 1; // Echoed back from Initialize message optional string vendor = 2; // Name of the manufacturer, e.g. "bitkey" optional uint32 major_version = 3; // Major version of the device, e.g. 1 optional uint32 minor_version = 4; // Minor version of the device, e.g. 0 - optional bool otp = 5; // True when device will send OtpRequest on important action - optional bool pin = 6; // True when device will send PinRequest on important action - optional bool spv = 7; // True when device requires SPV verification of transaction inputs - optional uint64 maxfee_kb = 8; // Maximum accepted fee per kilobyte of signed transaction - repeated Algorithm algo = 9; // List of key generation algorithms supported by the device - optional bool debug_link = 10; // Indicates support for DebugLink connection + optional bool has_otp = 5; // True when device will send OtpRequest on important action + optional bool has_spv = 6; // True when device requires SPV verification of transaction inputs + optional bool pin = 7; // True when device will send PinRequest on important action + optional Algorithm algo = 8; // Choosen generation algorithm + repeated Algorithm algo_available = 9; // List of key generation algorithms supported by the device + optional uint64 maxfee_kb = 10; // Maximum accepted fee per kilobyte of signed transaction } // Test if device is live, device will send back the message on success @@ -180,7 +180,6 @@ message SetMaxFeeKb { // // Response: MasterPublicKey, Failure message GetMasterPublicKey { - required Algorithm algo = 1 [default=BIP32]; // Used algorithm for generating the master public key } // Contains master public key derived from device's seed. @@ -189,12 +188,11 @@ message MasterPublicKey { } message GetAddress { - required Algorithm algo = 1 [default=BIP32]; // Used algorithm for generating the address - repeated uint32 address_n = 2; // Parameter for address generation algorithm to derive the address from the master public key + repeated uint32 address_n = 1; // Parameter for address generation algorithm to derive the address from the master public key } message Address { - required string address = 1; // Bitcoin address in base58 encoding corresponding to GetAddress(algo, n) call + required string address = 1; // Bitcoin address in base58 encoding corresponding to GetAddress(n) call } // Load seed and related internal settings from computer to the device. Existing seed is overwritten. @@ -220,7 +218,6 @@ message ResetDevice { // // Response: TxRequest, OtpRequest, PinRequest, Failure message SignTx { - required Algorithm algo = 1 [default=BIP32]; // Algorithm using for key generation algorithm required uint32 outputs_count = 3; // Count of outputs of the transaction required uint32 inputs_count = 5; // Count of inputs of the transaction optional bytes random = 6; // Provide additional entropy for signing function. @@ -234,7 +231,7 @@ message SignTx { message TxRequest { optional int32 request_index = 1; // If >=0, device expects TxInput/TxOutput message from the computer optional RequestType request_type = 2; // Ask for TxInput or TxOutput? - optional int32 signed_index = 3 [default=-1]; // If >=0, 'signature' contains signed input of this input + optional int32 signed_index = 3; // If >=0, 'signature' contains signed input of this input optional bytes signature = 4; // If signed_index>=0, represent signature of the signed_index input optional bytes serialized_tx = 5; // Part of serialized and signed transaction }