zcash_note_encryption generalization#746
Closed
PaulLaux wants to merge 36 commits into
Closed
Conversation
…to Domain implementation.
…ShieldedOutput trait
…textBytes, wrapping the AEADBytes in a struct
Author
extended zcash_note_encryption to support variable size notes.
Contributor
|
We discussed this PR in ZIP Sync today. Current thoughts:
|
Contributor
The |
Author
|
moved to zcash/zcash_note_encryption#2 |
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
In order to support note encryption for zsa, we suggest extending the current
zcash_note_encryptionimplementation. Currently, theCOMPACT_NOTE_SIZEis a constant, however we need to support variable note sizes to include theAssetIdfield for zsa notes.Currently, in
zcash_note_encryption:and
We suggest moving the constants into the specific implementation (
impl Domain for OrchardDomainand Sapling) of theDomaintrait by adding abstract types toNotePlaintextBytes,NoteCiphertextBytes,CompactNotePlaintextBytes,CompactNoteCiphertextBytes.We get
Also, the constant will be removed from functions' signatures since they are unknown at compilation time. For example:
Will be replaced with simply
We provided our initial implementation to be complemented by the appropriate changes in
Orchard::note_encryption.rs. Currently can be seen here for v2 notes https://github.com/QED-it/orchard/pull/7/files#diff-73b5b84dde3fc78a9942d6c827ed46e4ab9e027ca508e6279b9262fe985c3bffL2 (seenote_encryption.rsdiff)The changes will allow us to implement an
Orchard::DomainforV3notes while keeping compatibility with the existing Orchard Domain ( forV2notes ) and Sapling.