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

Add hashAuthDataRoot to Block network messages, and semantically verify it #2336

Closed
3 tasks
Tracked by #2311
teor2345 opened this issue Jun 17, 2021 · 2 comments
Closed
3 tasks
Tracked by #2311
Labels
A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-security Category: Security issues I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data S-needs-spec-update Status: Not in the Zcash spec, but it should be

Comments

@teor2345
Copy link
Contributor

teor2345 commented Jun 17, 2021

Motivation

In #2134, Zebra validates the hashAuthDataRoot in the finalized state. But this is very late in the validation pipeline.

We'd prefer to validate it as the first step in block and checkpoint verification. That way, the transaction authorizing data is bound to the block header before we do any other verification. That improves the security of Zebra's verification pipeline.

Specifications

Transaction Identifier Non-Malleability: https://zips.z.cash/zip-0244

Designs

Zebra's parallel verification pipeline: https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/0002-parallel-verification.md#definitions

Solution

  • Write a ZIP that adds the commitments used to generate hashBlockCommitments to the end of Block messages in the network protocol
  • Add these commitments to Zebra's block::Header, parsing them on the way in, and sending them on the way out
  • Validate the hashAuthDataRoot as the first step in block and checkpoint verification

Alternatives

This change improves security, but it's not required for full validation. We'll probably do it during the network protocol upgrades after NU5.

Related Work

#1874 and other ZIP-244 work.

@teor2345 teor2345 added A-rust Area: Updates to Rust code S-needs-triage Status: A bug report needs triage P-Medium C-security Category: Security issues I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data A-network Area: Network protocol updates or fixes labels Jun 17, 2021
@daira
Copy link
Contributor

daira commented Jun 19, 2021

I assigned ZIP number 240 260 for this. (The title is just a placeholder.)

@mpguerra mpguerra removed the S-needs-triage Status: A bug report needs triage label Jun 21, 2021
@mpguerra mpguerra mentioned this issue Jan 27, 2022
40 tasks
@teor2345 teor2345 added the S-needs-spec-update Status: Not in the Zcash spec, but it should be label Feb 22, 2022
@teor2345
Copy link
Contributor Author

teor2345 commented Mar 1, 2022

This protocol change would be useful, but other things are higher priority.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-network Area: Network protocol updates or fixes A-rust Area: Updates to Rust code C-security Category: Security issues I-invalid-data Zebra relies on invalid or untrusted data, or sends invalid data S-needs-spec-update Status: Not in the Zcash spec, but it should be
Projects
None yet
Development

No branches or pull requests

3 participants