Skip to content

CSHLD-1700: Build Ironwood witness auth-path from shard data in wasm-utxo - #387

Draft
abhi-bitgo wants to merge 1 commit into
masterfrom
CSHLD-1700-build-ironwood-witness-shard
Draft

CSHLD-1700: Build Ironwood witness auth-path from shard data in wasm-utxo#387
abhi-bitgo wants to merge 1 commit into
masterfrom
CSHLD-1700-build-ironwood-witness-shard

Conversation

@abhi-bitgo

Copy link
Copy Markdown
Contributor

Summary

Adds build_ironwood_witness_from_shard to wasm-utxo, allowing callers to build a Zcash Orchard/Ironwood Merkle witness from a caller-supplied "shard" (dense leaves of one subtree + upper sibling hashes) instead of pre-walking the full 32-level note-commitment tree.

Linear: CSHLD-1700

Changes

  • Cargo.toml: add incrementalmerkletree dependency (needed for Hashable/Level primitives not re-exported by orchard)
  • src/zcash/ironwood_build.rs: ShardWitnessInput, new IronwoodBuildError variants, build_ironwood_witness_from_shard, shard_local_auth_path helper — reuses the existing build_ironwood_witness for canonical-encoding/anchor validation (no duplicated validation logic)
  • src/wasm/zcash.rs: ironwood_build_witness_from_shard wasm-bindgen export
  • js/fixedScriptWallet/ZcashIronwoodWitness.ts: buildFromShard static method
  • Rust unit tests (13 cases) and a new JS mocha test + fixture

Test Plan

  • cargo test --workspace (631 passed, 0 failed)
  • cargo clippy --all-targets --all-features -- -D warnings (clean)
  • npm run build + full mocha suite (1554 passing, 0 failing)

Callers previously had to pre-walk the full 32-level Orchard
note-commitment tree to produce an Ironwood witness. This adds
build_ironwood_witness_from_shard, which instead accepts a caller-
supplied shard (dense leaves for one subtree + upper sibling hashes),
folds the shard locally, and delegates to the existing
build_ironwood_witness for canonical-encoding/anchor validation.

Ticket: CSHLD-1700
@linear-code

linear-code Bot commented Sep 9, 2026

Copy link
Copy Markdown

CSHLD-1700

@abhi-bitgo

Copy link
Copy Markdown
Contributor Author

@claude review this pr

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant