ZcashFoundation / zebra

Zcash - Financial Privacy in Rust πŸ¦“
https://zfnd.org/zebra/
Apache License 2.0
404 stars 96 forks source link

NU5 Tracking: The Spec #1856

Closed dconnolly closed 2 years ago

dconnolly commented 3 years ago

This epic will track the tasks that need to happen somewhere in code in order to implement Zcash Orchard and the other NU5 ZIPs in Zebra, as defined by the Zcash Specification.

This may include pieces of code contributed to the https://github.com/zcash/orchard crate or https://github.com/zcash/halo2 crate, by the zebrad team or the zcashd or whomever, but they need to happen by someone.

This tracking issue contains segments for the whole spec that includes Orchard changes for now. A checkbox means that that part of the specification describes something to implement.

A checked box or strikethrough means that we:

Our mandatory Canopy checkpoint significantly reduces the number of features that we have to implement.

Leaf nodes are marked by – and correspond to implementable items. They should be followed by issue references that track the status of that issue, or a short explanation. Some pieces of the spec that pertain to sending or receiving money or blockchain scanning are noted here, but not linked to issues, as we are not doing that work for Zebra for NU5 activation.

Also remember that consensus ZIPs are part of the spec

teor2345 commented 3 years ago

@dconnolly @mpguerra where's the ticket that tracks: "Pre-NU5 spec sections still active in Canopy or NU5, which Zebra hasn't implemented yet" ?

mpguerra commented 3 years ago

@dconnolly @mpguerra where's the ticket that tracks: "Pre-NU5 spec sections still active in Canopy or NU5, which Zebra hasn't implemented yet" ?

this is now #1872

mpguerra commented 3 years ago

@dconnolly I don't see any changes for NU5 in 5.4.1.5. CRHivk Hash Function, but I see them in 5.4.1.6 instead.

If that's correct, I will move the work in 5.4.1.5 into #1872 for the Pre-NU5 spec work

mpguerra commented 3 years ago

@dconnolly I started adding #1864 to some of the spec sections, can you please review these? Also, do we need to create an "Orchard Key Agreement and KDF" issue similar to #271 and/or an issue to "Implement Orchared shared secret key derivation" similar to #301 ?

mpguerra commented 3 years ago

For "4.1.6. Signature" do we need to create an issue for Pallas signatures?

mpguerra commented 3 years ago

For "4.1.10 Group Hash" are we going to pull in as a dependency?

mpguerra commented 3 years ago

For "4.7.2. Sending Notes (Sapling and Orchard)", do we need to create an new issue to implement Orchard note encryption and decryption similar to #181 and #269?

dconnolly commented 3 years ago

For "4.7.2. Sending Notes (Sapling and Orchard)", do we need to create an new issue to implement Orchard note encryption and decryption similar to #181 and #269?

We need to do this eventually for when we are sending money via Orchard but not for 'just' Zebra's NU5 chain validation. So yes we need to create the ticket but it does not have to be completed yet.

dconnolly commented 3 years ago

For "4.1.10 Group Hash" are we going to pull in as a dependency?

I think this is completed in #1864, under the hood it uses the pallas_curves dependency

mpguerra commented 3 years ago

Do we need to create an issue for " 4.9. Merkle Path Validity" also?

dconnolly commented 3 years ago

For "4.1.6. Signature" do we need to create an issue for Pallas signatures?

Yes I think so. I am stubbing out similar types to RedJubjub in that branch #1864 just to have the types, but I not sure yet if we just want to port redjubjub to Pallas, or great a generic RedDSA variant, or what, do I'm delaying the decision πŸ™ˆ

dconnolly commented 3 years ago

@dconnolly I don't see any changes for NU5 in 5.4.1.5. CRHivk Hash Function, but I see them in 5.4.1.6 instead.

If that's correct, I will move the work in 5.4.1.5 into #1872 for the Pre-NU5 spec work

I think that is correct, yes

str4d commented 3 years ago

For "4.1.6. Signature" do we need to create an issue for Pallas signatures?

Yes I think so. I am stubbing out similar types to RedJubjub in that branch #1864 just to have the types, but I not sure yet if we just want to port redjubjub to Pallas, or great a generic RedDSA variant, or what, do I'm delaying the decision πŸ™ˆ

As a reminder, I have already created a (semi-)generic reddsa from the redjubjub crate; it is what I'm using in the orchard crate. It's currently just a branch; I haven't published it yet because I want to discuss with you how you'd like to collaborate on maintenance going forward (since it's basically identical to redjubjub, and redjubjub could just be a wrapper around it).

mpguerra commented 3 years ago

Do we need to create an issue for "4.14. Balance and Binding Signature" ?

mpguerra commented 3 years ago

Do we need to create an issue for "5.4.9.3. Halo 2" similar to #305?

teor2345 commented 3 years ago

Do we need to create an issue for "4.14. Balance and Binding Signature" ?

Pool balance is #1895, but we still need to create (or find) tickets for the rest.

teor2345 commented 3 years ago

There are a significant number of transaction consensus rules in 7.1 that aren't covered by ZIP-225 or the v5 transaction RFC.

I'd like to track those changes in separate tickets, because the v5 transaction RFC is already quite large, and we need to finish it off soon.

daira commented 3 years ago

Note that some of the section numbers in the spec changed as a result of inserting section 4.1.3 Pseudo Random Permutations. Also 4.7.2 (sending notes) was split into separate Sapling and Orchard sections.

mpguerra commented 3 years ago

Updated section "5.6.4 Unified and Orchard Encodings" with "5.6.4.1 Unified Payment Addresses"

mpguerra commented 3 years ago

Added #2064 to section "5.4.1.10 PoseidonHash Function" and Epic

mpguerra commented 3 years ago

@dconnolly: Is "4.14. Balance and Binding Signature (Orchard)" fully covered by ZIP-209/#1895 ? If so, we can cross it out from this list

mpguerra commented 2 years ago

Looks like we are done here πŸŽ‰