Skip to content
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

Port zebra-chain::sapling to zebra-chain::orchard #1885

Merged
merged 84 commits into from
Apr 30, 2021
Merged

Conversation

dconnolly
Copy link
Contributor

@dconnolly dconnolly commented Mar 11, 2021

Motivation

We need a bunch of data structures and implementations for Orchard, that share a lot of similarities for the things that we've already implemented for Sapling, modulo Sinsemilla hashes, Actions, and using Pallas instead of Jubjub.

Solution

Port our zebra_chain::sapling code to zebra_chain::orchard, adding/updating/removing where appropriate.

The code in this pull request has:

  • Documentation Comments
  • Unit Tests and Property Tests

Review

@teor2345 @oxarbitrage

Related Issues

This resolve a lot of tickets that should be linked from NU5 spec tracking, please create and fill them in here.

#1856

Closes #1864 ?

Follow Up Work

  • Several things that have test vectors for the Sapling equivalent are waiting on them for Orchard, such as Sinsemilla. Fill those in when the ECC Python implementation produces them. Import and test against Sinsemilla test vectors from zcash-hackworks #2079
  • This has a stub of redpallas in primitives for now. There is a proposal to make redjubjub generic over traits to make it reddsa. I haven't really formed an opinion yet on this, because it would be globally generic, but for Jubjub and Pallas to start. I personally would be fine with a port of RedJubjub to RedPallas, not generic, perhaps just internal to zebra-chain right now, at least to get things working. replaceredpallas module with reddsa crate #2080

@dconnolly dconnolly added E-med A-rust Area: Updates to Rust code NU-5 Network Upgrade: NU5 specific tasks labels Mar 11, 2021
@dconnolly dconnolly added this to the 2021 Sprint 5 milestone Mar 11, 2021
@dconnolly dconnolly self-assigned this Mar 11, 2021
@dconnolly dconnolly added this to Review in progress in 🦓 via automation Mar 11, 2021
@dconnolly dconnolly linked an issue Mar 11, 2021 that may be closed by this pull request
53 tasks
@dconnolly dconnolly removed a link to an issue Mar 11, 2021
53 tasks
@teor2345 teor2345 mentioned this pull request Mar 11, 2021
3 tasks
@mpguerra mpguerra removed this from the 2021 Sprint 5 milestone Mar 15, 2021
@teor2345
Copy link
Contributor

@dconnolly let me know when you want a review on this PR.

@dconnolly dconnolly marked this pull request as ready for review March 16, 2021 23:15
@dconnolly
Copy link
Contributor Author

dconnolly commented Mar 16, 2021

@dconnolly let me know when you want a review on this PR.

I've moved it to 'ready for review', while I add more tests and clean up this first pass.

I figure that a first pass can get merged imminently, with the understanding that changes from the spec, keeping an eye on progress on the orchard crate to maintain compatibility, and the availability of test vectors/data will result in follow-on work.

Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks like it's mostly there, let me know if you need a hand with any of the changes and missing pieces.

zebra-chain/src/amount.rs Show resolved Hide resolved
zebra-chain/src/lib.rs Outdated Show resolved Hide resolved
zebra-chain/src/sapling/note/nullifiers.rs Outdated Show resolved Hide resolved
zebra-chain/src/primitives/redpallas/verification_key.rs Outdated Show resolved Hide resolved
zebra-chain/src/primitives/redpallas.rs Outdated Show resolved Hide resolved
zebra-chain/src/orchard/address.rs Outdated Show resolved Hide resolved
zebra-chain/src/orchard/commitment.rs Outdated Show resolved Hide resolved
zebra-chain/src/orchard/commitment.rs Outdated Show resolved Hide resolved
zebra-chain/src/orchard/keys.rs Outdated Show resolved Hide resolved
zebra-chain/src/orchard/keys.rs Outdated Show resolved Hide resolved
@mpguerra mpguerra removed the E-med label Mar 23, 2021
@teor2345 teor2345 added this to the 2021 Sprint 5 milestone Mar 25, 2021
@mpguerra mpguerra removed this from the 2021 Sprint 5 milestone Mar 26, 2021
Copy link
Contributor

@teor2345 teor2345 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me, but I'm going to leave it to @dconnolly to merge.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-rust Area: Updates to Rust code NU-5 Network Upgrade: NU5 specific tasks
Projects
No open projects
🦓
  
Done
Development

Successfully merging this pull request may close these issues.

Port zebra-chain::sapling to zebra-chain::orchard
5 participants