@ -3,7 +3,7 @@
Author : Marek "slush" Palatinus < info @ bitcoin.cz >
Author : Marek "slush" Palatinus < info @ bitcoin.cz >
Version : 0. 1
Version : 0. 4
* /
* /
/ / Specifies which script will be used for given transaction output.
/ / Specifies which script will be used for given transaction output.
@ -18,7 +18,31 @@ enum RequestType {
TXOUTPUT = 1 ;
TXOUTPUT = 1 ;
}
}
/ / Ask for device details
/ / Structure for BIP32 - encoded node
/ / Used for imports into the device
message XprvType {
required bytes version = 1 ;
required uint32 depth = 2 ;
required uint32 fingerprint = 3 ;
required uint32 child_num = 4 ;
required bytes chain_code = 5 ;
required bytes private_key = 6 ;
}
message CoinType {
optional bytes coin_name = 2 ;
optional bytes coin_shortcut = 3 ;
optional uint32 address_type = 4 ;
optional uint64 maxfee_kb = 5 ;
}
message SettingsType {
optional bytes language = 1 ; / / Trezor uses 'english' as default
optional CoinType coin = 2 ;
optional bytes label = 3 ; / / Human readable wallet name
}
/ / Reset device to default state and ask for device details
/ /
/ /
/ / Response : Features
/ / Response : Features
message Initialize {
message Initialize {
@ -29,7 +53,15 @@ message Features {
optional bytes vendor = 1 ; / / Name of the manufacturer , e.g. "trezor"
optional bytes vendor = 1 ; / / Name of the manufacturer , e.g. "trezor"
optional uint32 major_version = 2 ; / / Major version of the device , e.g. 1
optional uint32 major_version = 2 ; / / Major version of the device , e.g. 1
optional uint32 minor_version = 3 ; / / Minor version of the device , e.g. 0
optional uint32 minor_version = 3 ; / / Minor version of the device , e.g. 0
optional uint64 maxfee_kb = 4 ; / / Maximum accepted fee per kilobyte of signed transaction
optional SettingsType settings = 4 ; / / User - level settings of the device
optional bytes serial_number = 5 ; / / Device ' s unique identifier
}
/ / Overwrites only filled fields of the structure
message ApplySettings {
optional bytes language = 1 ;
optional bytes coin_shortcut = 2 ;
optional bytes label = 3 ;
}
}
/ / Test if device is live , device will send back the message on success
/ / Test if device is live , device will send back the message on success
@ -82,18 +114,6 @@ message Failure {
optional bytes message = 2 ; / / May contain human - readable message of the error state
optional bytes message = 2 ; / / May contain human - readable message of the error state
}
}
/ / Ask device for unique identifier.
/ /
/ / Response : UUID
message GetUUID {
}
/ / Identifier of the device. This identifier must be composed from CPU serial number
/ / or other persistent source and must be the same for consecutive requests.
message UUID {
required bytes UUID = 1 ;
}
/ / Message can be sent by the * device * as a resopnse to any request.
/ / Message can be sent by the * device * as a resopnse to any request.
/ / Device is waiting for HW button press. No action is required from computer
/ / Device is waiting for HW button press. No action is required from computer
/ / Computer should respond with ButtonAck message or ButtonCancel to cancel
/ / Computer should respond with ButtonAck message or ButtonCancel to cancel
@ -140,15 +160,6 @@ message Entropy {
required bytes entropy = 1 ; / / Stream of generated bytes
required bytes entropy = 1 ; / / Stream of generated bytes
}
}
/ / Set maximum allowed fee per kB of transaction. This is used by internal sanity checking
/ / in SignTx method. Transaction won ' t be signed if requested transaction fees are above
/ / current value.
/ /
/ / Response : Success , PinMatrixRequest , Failure
message SetMaxFeeKb {
required uint64 maxfee_kb = 1 ; / / Maximum allowed transaction fee in satoshis per kB
}
/ / Ask device for it ' s current master public key. This may be used for generating
/ / Ask device for it ' s current master public key. This may be used for generating
/ / public keys on the computer independently to the device. API doesn ' t provide
/ / public keys on the computer independently to the device. API doesn ' t provide
/ / any other way how to get bitcoin addresses from the device.
/ / any other way how to get bitcoin addresses from the device.
@ -174,8 +185,9 @@ message Address {
/ /
/ /
/ / Response : Success , PinMatrixRequest , Failure
/ / Response : Success , PinMatrixRequest , Failure
message LoadDevice {
message LoadDevice {
required bytes seed = 1 ; / / Seed encoded as a mnemonic ( 12 english words )
optional bytes seed = 1 ; / / Seed encoded as a mnemonic ( 12 english words )
optional bytes pin = 2 ; / / Set PIN protection for important actions
optional XprvType xprv = 2 ;
optional bytes pin = 3 ; / / Set PIN protection for important actions
}
}
/ / Request device to do full - reset , to generate new seed
/ / Request device to do full - reset , to generate new seed
@ -195,6 +207,23 @@ message SignTx {
required uint32 inputs_count = 5 ; / / Count of inputs of the transaction
required uint32 inputs_count = 5 ; / / Count of inputs of the transaction
}
}
/ / Request a simplified workflow of signing.
/ / This method doesn ' t support streaming ,
/ / so there may be hardware limits
/ / in number of inputs and outputs.
/ /
/ / This simplified workflow should not be used
/ / in production , it is designed mainly for debug purposes.
/ /
/ / When everything is fine , Success.message contains
/ / serialized transaction.
/ /
/ / Response : Success , PinMatrixRequest , Failure
message SimpleSignTx {
repeated TxInput inputs = 1 ;
repeated TxOutput outputs = 2 ;
}
/ / Sent by the device as a response for SignTx. Device asks for information for signing transaction.
/ / Sent by the device as a response for SignTx. Device asks for information for signing transaction.
/ / If request_index is set , device asks for TxInput / TxOutput message ( depends on request_type )
/ / If request_index is set , device asks for TxInput / TxOutput message ( depends on request_type )
/ / with details of index ' s input.
/ / with details of index ' s input.