-
-
Notifications
You must be signed in to change notification settings - Fork 233
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Decred support #28
Decred support #28
Changes from all commits
0316f61
987144d
5821f6b
67ae109
eb4cb2a
6e936e1
10d7498
fafe6ae
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -137,4 +137,42 @@ | |
}, | ||
"dust_limit": 546, | ||
"blocktime_minutes": 2.5 | ||
}, { | ||
"coin_name": "Decred", | ||
"coin_shortcut": "DCR", | ||
"address_type": 1855, | ||
"maxfee_kb": 100000000, | ||
"address_type_p2sh": 1818, | ||
"address_type_p2wpkh": null, | ||
"address_type_p2wsh": null, | ||
"signed_message_header": "Decred Signed Message:\n", | ||
"hash_genesis_block": "298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980", | ||
"xpub_magic": "02fda926", | ||
"xprv_magic": "02fda4e8", | ||
"bip44": 20, | ||
"segwit": false, | ||
"default_fee_b": { | ||
"Normal": 10 | ||
}, | ||
"dust_limit": 546, | ||
"blocktime_minutes": 10 | ||
}, { | ||
"coin_name": "DecredTestnet", | ||
"coin_shortcut": "DCRT", | ||
"address_type": 3873, | ||
"maxfee_kb": 100000000, | ||
"address_type_p2sh": 3836, | ||
"address_type_p2wpkh": null, | ||
"address_type_p2wsh": null, | ||
"signed_message_header": "Decred Signed Message:\n", | ||
"hash_genesis_block": "298e5cc3d985bfe7f81dc135f360abe089edd4396b86d2de66b0cef42b21d980", | ||
"xpub_magic": "043587d1", | ||
"xprv_magic": "04358397", | ||
"bip44": 11, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Testnet should use |
||
"segwit": false, | ||
"default_fee_b": { | ||
"Normal": 10 | ||
}, | ||
"dust_limit": 546, | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Indentation, again. |
||
"blocktime_minutes": 10 | ||
}] |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -81,7 +81,16 @@ enum MessageType { | |
MessageType_DebugLinkMemoryRead = 110 [(wire_debug_in) = true]; | ||
MessageType_DebugLinkMemory = 111 [(wire_debug_out) = true]; | ||
MessageType_DebugLinkMemoryWrite = 112 [(wire_debug_in) = true]; | ||
MessageType_DebugLinkFlashErase = 113 [(wire_debug_in) = true]; | ||
MessageType_DebugLinkFlashErase = 113 [(wire_debug_in) = true]; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What happened here? |
||
MessageType_DecredLoadDevice = 114 [(wire_in) = true]; | ||
MessageType_DecredGetAddress = 115 [(wire_in) = true]; | ||
MessageType_DecredAddress = 116 [(wire_out) = true]; | ||
MessageType_DecredEntropyAck = 117 [(wire_in) = true]; | ||
MessageType_DecredSignMessage = 118 [(wire_in) = true]; | ||
MessageType_DecredVerifyMessage = 119 [(wire_in) = true]; | ||
MessageType_DecredSignTx = 120 [(wire_in) = true]; | ||
MessageType_DecredTxAck = 121 [(wire_in) = true]; | ||
MessageType_DecredTxRequest = 122 [(wire_out) = true]; | ||
} | ||
|
||
//////////////////// | ||
|
@@ -348,6 +357,107 @@ message LoadDevice { | |
optional uint32 u2f_counter = 8; // U2F counter | ||
} | ||
|
||
/** | ||
* Request: Load Decred seed PGP word list from the computer | ||
* @next ButtonRequest | ||
* @next Success | ||
* @next Failure | ||
*/ | ||
message DecredLoadDevice { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Did you need a new message or could you have added it as an enum in the existing message? |
||
optional string mnemonic = 1; // seed encoded as BIP-39 mnemonic (12, 18 or 24 words) | ||
optional HDNodeType node = 2; // BIP-32 node | ||
optional string pin = 3; // set PIN protection | ||
optional bool passphrase_protection = 4; // enable master node encryption using passphrase | ||
optional string language = 5 [default='english']; // device language | ||
optional string label = 6; // device label | ||
optional uint32 u2f_counter = 7; // U2F counter | ||
} | ||
|
||
/** | ||
* Request: Ask device for Decred address corresponding to address_n path | ||
* @next PassphraseRequest | ||
* @next DecredAddress | ||
* @next Failure | ||
*/ | ||
message DecredGetAddress { | ||
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 an Decred address derived from device private seed | ||
* @prev DecredGetAddress | ||
*/ | ||
message DecredAddress { | ||
required string address = 1; // Base58 encoded address string | ||
} | ||
|
||
/** | ||
* Request: Provide additional entropy for seed generation function (Decred variant) | ||
* @prev EntropyRequest | ||
* @next ButtonRequest | ||
*/ | ||
message DecredEntropyAck { | ||
optional bytes entropy = 1; // 256 bits (32 bytes) of random data | ||
} | ||
|
||
/** | ||
* Request: Ask device to sign message (Decred variant) | ||
* @next MessageSignature | ||
* @next Failure | ||
*/ | ||
message DecredSignMessage { | ||
repeated uint32 address_n = 1; // BIP-32 path to derive the key from master node | ||
required bytes message = 2; // message to be signed | ||
} | ||
|
||
/** | ||
* Request: Ask device to verify message (Decred variant) | ||
* @next Success | ||
* @next Failure | ||
*/ | ||
message DecredVerifyMessage { | ||
optional string address = 1; // address to verify | ||
optional bytes signature = 2; // signature to verify | ||
optional bytes message = 3; // message to verify | ||
} | ||
|
||
/** | ||
* Request: Ask device to sign transaction (Decred variant) | ||
* @next PassphraseRequest | ||
* @next PinMatrixRequest | ||
* @next DecredTxRequest | ||
* @next Failure | ||
*/ | ||
message DecredSignTx { | ||
required uint32 outputs_count = 1; // number of transaction outputs | ||
required uint32 inputs_count = 2; // number of transaction inputs | ||
optional uint32 version = 4 [default=1]; // transaction version | ||
optional uint32 lock_time = 5 [default=0]; // transaction lock_time | ||
} | ||
|
||
/** | ||
* Response: Device asks for information for signing Decred transaction or returns the last result | ||
* If request_index is set, device awaits TxAck message (with fields filled in according to request_type) | ||
* If signature_index is set, 'signature' contains signed input of signature_index's input | ||
* @prev DecredSignTx | ||
* @prev DecredTxAck | ||
*/ | ||
message DecredTxRequest { | ||
optional RequestType request_type = 1; // what should be filled in TxAck message? | ||
optional TxRequestDetailsType details = 2; // request for tx details | ||
optional TxRequestSerializedType serialized = 3; // serialized data and request for next | ||
} | ||
|
||
/** | ||
* Request: Decred Reported transaction data | ||
* @prev DecredTxRequest | ||
* @next DecredTxRequest | ||
*/ | ||
message DecredTxAck { | ||
optional DecredTransactionType tx = 1; | ||
} | ||
|
||
/** | ||
* Request: Ask device to do initialization involving user interaction | ||
* @next EntropyRequest | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What happened here?