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

ZIP-213: Explain how Zebra validates shielded coinbase outputs like other shielded outputs #2382

Merged
merged 4 commits into from
Jun 24, 2021

Conversation

teor2345
Copy link
Contributor

Motivation

We've split most of the work out of ZIP-213, so we just need to explain how we implement the remaining consensus rules.

Closes #608.

Specifications

The consensus rules applied to valueBalance, vShieldedOutput, and bindingSig in non-coinbase transactions MUST also be applied to coinbase transactions.

https://zips.z.cash/zip-0213#specification

Note: this rule originally applied to Sapling, but we assume it also applies to Orchard

Solution

  • Explain how Zebra validates shielded coinbase outputs like other shielded outputs
  • Rearrange some code to make the implementation clearer
  • Add a note about mempool coinbase transactions

The existing block test vectors and tests include shielded coinbase transactions.

Review

@jvff is working on the same file.

This PR is not urgent.

Reviewer Checklist

  • Code implements Specs and Designs
  • Tests for Expected Behaviour
  • Tests for Errors

Follow Up Work

The Sapling and Orchard note consensus rules will be implemented in #2362.

"Only transparent outputs in coinbase transactions are subject to the existing restrictions on spending coinbase funds" will be implemented in #1970:

teor2345 added 3 commits June 24, 2021 11:27
This change isn't required to implement the ZIP-213 rule, but it makes
it easier to identify the specific checks for coinbase transactions.
@teor2345 teor2345 added A-docs Area: Documentation A-consensus Area: Consensus rule updates NU-1 Sapling Network Upgrade: Sapling specific tasks A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-5 Network Upgrade: NU5 specific tasks P-Medium labels Jun 24, 2021
@teor2345 teor2345 requested a review from jvff June 24, 2021 01:35
@teor2345 teor2345 self-assigned this Jun 24, 2021
dconnolly
dconnolly previously approved these changes Jun 24, 2021
Co-authored-by: Deirdre Connolly <durumcrustulum@gmail.com>
@teor2345 teor2345 enabled auto-merge (squash) June 24, 2021 23:23
@teor2345 teor2345 requested a review from dconnolly June 24, 2021 23:23
Copy link
Contributor

@dconnolly dconnolly left a comment

Choose a reason for hiding this comment

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

🌱🌳

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-consensus Area: Consensus rule updates A-docs Area: Documentation A-rust Area: Updates to Rust code C-enhancement Category: This is an improvement NU-1 Sapling Network Upgrade: Sapling specific tasks NU-5 Network Upgrade: NU5 specific tasks
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ZIP-213: Validate Shielded Coinbase Outputs like other shielded outputs
2 participants