CSHLD-1573: Build and validate Merkle witness path for Zcash Ironwood shielded notes - #374
Merged
Merged
Conversation
Contributor
Author
|
@claude review this pr |
abhi-bitgo
marked this pull request as ready for review
September 2, 2026 09:35
OttoAllmendinger
requested changes
Sep 2, 2026
| /// This crate has no chain state, so the raw sibling-hash path must be supplied by the caller | ||
| /// (typically BitGo's backend, querying a Zcash-aware service). The returned witness is not yet | ||
| /// installed anywhere — hook it into a spend once real-spend construction exists. | ||
| #[wasm_bindgen(js_name = ironwoodBuildWitness)] |
Contributor
There was a problem hiding this comment.
please follow https://github.com/BitGo/BitGoWASM/blob/master/CONVENTIONS.md here
Contributor
There was a problem hiding this comment.
sorry specifically the architecture here: https://github.com/BitGo/BitGoWASM/blob/master/packages/wasm-utxo/js/README.md
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
abhi-bitgo
force-pushed
the
CSHLD-1573-ironwood-witness-path
branch
from
September 2, 2026 10:16
6c66379 to
181bf79
Compare
Ranjna-G
approved these changes
Sep 2, 2026
OttoAllmendinger
approved these changes
Sep 2, 2026
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