-
Notifications
You must be signed in to change notification settings - Fork 107
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
Stop double-spends by checking nullifiers and UTXO spends in each non-finalized chain #2231
Labels
A-consensus
Area: Consensus rule updates
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
NU Sprout
Network Upgrade: Sprout specific tasks (before Overwinter)
NU-1 Sapling
Network Upgrade: Sapling specific tasks
NU-5
Network Upgrade: NU5 specific tasks
Milestone
Comments
teor2345
added
A-consensus
Area: Consensus rule updates
NU-1 Sapling
Network Upgrade: Sapling specific tasks
NU Sprout
Network Upgrade: Sprout specific tasks (before Overwinter)
A-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
S-needs-triage
Status: A bug report needs triage
NU-5
Network Upgrade: NU5 specific tasks
P-Medium
labels
Jun 1, 2021
teor2345
changed the title
Stop double-spends by checking nullifiers in each non-finalized chain
Stop double-spends by checking nullifiers and UTXOs in each non-finalized chain
Jun 24, 2021
teor2345
changed the title
Stop double-spends by checking nullifiers and UTXOs in each non-finalized chain
Stop double-spends by checking nullifiers and UTXO spends in each non-finalized chain
Jun 24, 2021
1 task
This was referenced Jul 2, 2021
This was referenced Jul 9, 2021
This was referenced Jul 16, 2021
3 tasks
This was
linked to
pull requests
Jul 20, 2021
1 task
This got accidentally closed by #2504. |
3 tasks
mpguerra
added a commit
that referenced
this issue
May 19, 2023
mergify bot
pushed a commit
that referenced
this issue
May 23, 2023
* ZIPs were updated to remove ambiguity, this was tracked in #1267. * #2105 was fixed by #3039 and #2379 was closed by #3069 * #2230 was a duplicate of #2231 which was closed by #2511 * #3235 was obsoleted by #2156 which was fixed by #3505 * #1850 was fixed by #2944, #1851 was fixed by #2961 and #2902 was fixed by #2969 * We migrated to Rust 2021 edition in Jan 2022 with #3332 * #1631 was closed as not needed * #338 was fixed by #3040 and #1162 was fixed by #3067 * #2079 was fixed by #2445 * #4794 was fixed by #6122 * #1678 stopped being an issue * #3151 was fixed by #3934 * #3204 was closed as not needed * #1213 was fixed by #4586 * #1774 was closed as not needed * #4633 was closed as not needed * Clarify behaviour of difficulty spacing Co-authored-by: teor <[email protected]> * Update comment to reflect implemented behaviour Co-authored-by: teor <[email protected]> * Update comment to reflect implemented behaviour when retrying block downloads Co-authored-by: teor <[email protected]> * Update `TODO` to remove closed issue and clarify when we might want to fix Co-authored-by: teor <[email protected]> * Update `TODO` to remove closed issue and clarify what we might want to change in future Co-authored-by: teor <[email protected]> * Clarify benefits of how we do block verification Co-authored-by: teor <[email protected]> * Fix rustfmt errors --------- Co-authored-by: teor <[email protected]>
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-rust
Area: Updates to Rust code
C-enhancement
Category: This is an improvement
NU Sprout
Network Upgrade: Sprout specific tasks (before Overwinter)
NU-1 Sapling
Network Upgrade: Sapling specific tasks
NU-5
Network Upgrade: NU5 specific tasks
Motivation
Zebra needs to check the double-spend consensus rule for shielded and transparent inputs, in each non-finalized chain.
Consensus Rules
Nullifiers
https://zips.z.cash/protocol/nu5.pdf#nullifierset
https://zips.z.cash/protocol/nu5.pdf#commitmentsandnullifiers
https://zips.z.cash/protocol/nu5.pdf#decryptivk
Note: reorganizations can also change the best chain to one where a note was spent
UTXO spends
https://zips.z.cash/protocol/protocol.pdf#transactions
https://developer.bitcoin.org/devguide/block_chain.html#introduction
https://developer.bitcoin.org/reference/block_chain.html#merkle-trees
Existing Design
https://github.com/ZcashFoundation/zebra/blob/main/book/src/dev/rfcs/0005-state-updates.md#pub-fn-pushmut-self-block-arcblock
Solution
Design Change
Chain.<version>_nullifiers
should return an error if the key already existsThis design change enforces the double-spend rules for each shielded pool.
Testing
Alternatives
This is a required consensus rule. There aren't really any alternatives to returning an error here.
The text was updated successfully, but these errors were encountered: