feat: CAT minting + nullifier v2 (PR5)#21
Open
almogdepaz wants to merge 1 commit intopr/04-stealth-nonce-encryptionfrom
Open
feat: CAT minting + nullifier v2 (PR5)#21almogdepaz wants to merge 1 commit intopr/04-stealth-nonce-encryptionfrom
almogdepaz wants to merge 1 commit intopr/04-stealth-nonce-encryptionfrom
Conversation
CAT minting stack: - CoinMode::Mint in mock, risc0, sp1 backends (was panic/error) - compute_genesis_nullifier for one-time-use genesis enforcement - mint_cat simulator method + mint_command CLI - enforce_ring_balance guard skips Mint (no input coin) - 6 new tests in test_cat_minting.rs Nullifier v2 (ZK-01 security fix): - compute_nullifier_v2: SHA256(domain || tail_hash || serial || program || amount) - tail_hash binding prevents cross-asset nullifier collision attacks - compute_nullifier v1 deprecated - all 8 callsites updated (mock, risc0, sp1, settlement guests) Simulator fixes: - CoinInfo.tail_source field for CAT spend authorization - Fixed UTXO key in mint_cat (serial_number, not serial_commitment) - spend_coins looks up tail_source for CAT coins automatically
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
SHA256("clvm_zk_genesis_v1.0" || serial || tail_hash)— prevents double-mintingSHA256("clvm_zk_nullifier_v2.0" || tail_hash || serial || program || amount)— tail_hash binding prevents cross-asset nullifier collision attacks. v1 deprecated.spend_coinsFiles changed (13)
clvm_zk_core/src/lib.rs—compute_genesis_nullifier,compute_nullifier_v2, v1 deprecatedbackends/mock/src/backend.rs— full Mint arm, enforce_ring_balance guard, v2 nullifierbackends/risc0/guest/src/main.rs— Mint arm, v2 nullifierbackends/sp1/program/src/main.rs— mirror risc0backends/risc0/src/lib.rs,backends/sp1/src/lib.rs— removed host-side Mint guardsbackends/risc0/guest_settlement/src/main.rs,backends/sp1/program_settlement/src/main.rs— v2 nullifiersrc/lib.rs—ClvmZkProver::prove_with_inputsrc/simulator.rs—mint_cat,CoinInfo.tail_source, UTXO key fix, CAT spend tail_source lookupsrc/cli.rs—SimAction::Mint,mint_commandtests/test_cat_minting.rs— 6 testsTest plan
cargo test --no-default-features --features mock,testing --test test_cat_minting— 6/6 passcargo test --no-default-features --features mock,testing— full suite green, no regressions