-
-
Notifications
You must be signed in to change notification settings - Fork 668
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(core): add Zcash shielded transactions
- Loading branch information
Showing
64 changed files
with
3,789 additions
and
158 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
syntax = "proto2"; | ||
package hw.trezor.messages.zcash; | ||
|
||
// Sugar for easier handling in Java | ||
option java_package = "com.satoshilabs.trezor.lib.protobuf"; | ||
option java_outer_classname = "TrezorMessageZcash"; | ||
|
||
import "messages.proto"; | ||
|
||
enum ZcashSignatureType { | ||
reserved 1, 2, 4; | ||
TRANSPARENT = 0; | ||
// SAPLING_SPEND_AUTH = 1; | ||
// SAPLING_BINDING = 2; | ||
ORCHARD_SPEND_AUTH = 3; | ||
// ORCHARD_BINDING = 4; | ||
} | ||
|
||
/** | ||
* Request: Ask device for Orchard Viewing Key. | ||
* If field `full` is true, then Full Viewing Key will be returned. | ||
* Otherwise Incoming Viewing Key will be returned. | ||
* | ||
* @start | ||
* @next Failure | ||
* @next ZcashViewingKey | ||
*/ | ||
message ZcashGetViewingKey { | ||
optional string coin_name = 1 [default = "Zcash"]; | ||
repeated uint32 z_address_n = 2; // z-address ZIP 32 path | ||
optional bool full = 3 [default = true]; // true -> Full Viewing Key requested | ||
// false -> Incoming Viewing Key requested | ||
} | ||
|
||
/** | ||
* Response: Contains unified Full/Incoming Viewing Key. | ||
* @end | ||
*/ | ||
message ZcashViewingKey { | ||
required string key = 1; | ||
} | ||
|
||
/** | ||
* Request: Ask device for a Unified Address. | ||
* @start | ||
* @next Failure | ||
* @next ZcashAddress | ||
*/ | ||
message ZcashGetAddress { | ||
optional string coin_name = 1 [default = "Zcash"]; | ||
repeated uint32 t_address_n = 2; // t-address BIP 32 path (P2PKH) | ||
repeated uint32 z_address_n = 3; // z-address ZIP 32 path (Orchard) | ||
optional uint64 diversifier_index = 4 [default = 0]; // z-address diversifier index | ||
optional bool show_display = 5 [default = false]; // Optionally show on display before sending the result | ||
} | ||
|
||
/** | ||
* Response: Contains Zcash diversified payment address derived from device private seed | ||
* @end | ||
*/ | ||
message ZcashAddress { | ||
optional string address = 1; | ||
} | ||
|
||
/** | ||
* Request: Specify transaction Orchard input. | ||
* @next TxRequest | ||
*/ | ||
message ZcashOrchardInput { | ||
required bytes recipient = 1; | ||
required uint64 value = 2; | ||
required bytes rho = 3; | ||
required bytes rseed = 4; | ||
} | ||
|
||
/** | ||
* Request: Specify transaction Orchard output. | ||
* Let the `address` and `memo` fields empty for change outputs. | ||
* @next TxRequest | ||
*/ | ||
message ZcashOrchardOutput { | ||
optional string address = 1; // for outgoing transfers | ||
required uint64 amount = 2; | ||
optional string memo = 3; // an optional message for a recepient | ||
} | ||
|
||
message ZcashAck { | ||
option (wire_type) = 22; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Add Zcash shielded transactions |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.