CSHLD-1573: Build and validate Merkle witness path for Zcash Ironwood shielded notes - #374
Draft
abhi-bitgo wants to merge 1 commit into
Draft
CSHLD-1573: Build and validate Merkle witness path for Zcash Ironwood shielded notes#374abhi-bitgo wants to merge 1 commit into
abhi-bitgo wants to merge 1 commit into
Conversation
Adds a standalone `build_ironwood_witness` (Rust) and `ironwoodBuildWitness` (WASM) that validate a caller-supplied Merkle witness — cmx, position, 32 sibling hashes, and expected anchor — against orchard's own MerklePath::root. wasm-utxo has no chain state, so the raw path must come from the caller; this catches a bad path immediately instead of failing later at the external prover. Installing the witness into a real spend is deferred to a follow-up ticket. Ticket: CSHLD-1573
Author
|
@claude review this pr |
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
Adds a standalone
build_ironwood_witness(Rust) andironwoodBuildWitness(WASM) function thatvalidates a caller-supplied Merkle witness — cmx, position, 32 sibling hashes, and expected anchor —
against orchard's own
MerklePath::root.wasm-utxohas no chain state, so the raw sibling-hashpath must always be supplied by the caller; this catches a bad path immediately rather than failing
later at the external prover. Installing the witness into a real spend is explicitly out of scope
and deferred to a follow-up ticket.
Linear: CSHLD-1573
Changes
IronwoodBuildErrorvariants:BadWitnessPath,WitnessAnchorMismatchbuild_ironwood_witnessinironwood_build.rs, usingorchard::tree::MerklePath::from_parts+.root()ironwoodBuildWitnesswasm-bindgen export andIronwoodWitnessstruct inwasm/zcash.rstest/fixedScript/zcashIronwoodWitness.ts) exercising the compiled WASM exportpasta_curvesdev-dependency, pinned to the version orchard already pulls in, used only to synthesize test fixturesTest Plan
cargo test --workspaceinpackages/wasm-utxocargo clippy --all-targets --all-features -- -D warningsinpackages/wasm-utxonpm run build:wasm && npx mocha test/fixedScript/zcashIronwoodWitness.ts— confirms the new export compiles through wasm-pack and is reachable from JS