Skip to content

feat(wasm-utxo): verify ZIP-244 transparent signatures on Ironwood PSBTs - #385

Merged
veetragjain merged 1 commit into
masterfrom
veetragjain/cshld-1681-implement-verifysignature-for-zcashironwoodbitgopsbt-zip-244
Sep 8, 2026
Merged

feat(wasm-utxo): verify ZIP-244 transparent signatures on Ironwood PSBTs#385
veetragjain merged 1 commit into
masterfrom
veetragjain/cshld-1681-implement-verifysignature-for-zcashironwoodbitgopsbt-zip-244

Conversation

@veetragjain

Copy link
Copy Markdown
Contributor

Ticket: CSHLD-1681

@linear-code

linear-code Bot commented Sep 8, 2026

Copy link
Copy Markdown

CSHLD-1681

@veetragjain
veetragjain force-pushed the veetragjain/cshld-1681-implement-verifysignature-for-zcashironwoodbitgopsbt-zip-244 branch from 0b696af to 8d385d2 Compare September 8, 2026 11:11
@veetragjain
veetragjain marked this pull request as ready for review September 8, 2026 11:29
@veetragjain
veetragjain requested review from a team as code owners September 8, 2026 11:29

@OttoAllmendinger OttoAllmendinger left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Request changes: the new v6 verification APIs should use the existing wasm-utxo structured-error architecture rather than String errors.

The repository already has the WasmUtxoError boundary in packages/wasm-utxo/src/error.rs, stable error codes via strum::IntoStaticStr and impl_wasm_error_code!, and conversion to branded JavaScript Error objects with err.code in wasm/try_into_js_value.rs. Existing domain errors such as ZcashV6Error, IronwoodBuildError, OutputScriptError, and nested PSBT parse errors follow this pattern.

Please introduce a typed v6 signature verification error, or an appropriately scoped existing domain error, and propagate it through the Rust methods and WASM wrappers. At minimum, callers need to distinguish unsupported/non-Ironwood PSBTs, input-index errors, derivation/PSBT structural failures, and missing-PCZT/sighash failures. Keep Ok(false) for an absent or cryptographically invalid signature, and reserve structured errors for cases where verification cannot be evaluated.

The current Result<bool, String> implementation and WasmUtxoError::new(...) wrappers collapse all of these cases into WasmUtxoError.StringError, forcing JS callers to parse message strings and extending a legacy pattern that should not be used for this new API.

zcash_psbt.verify_v6_signature_with_pub(secp, input_index, pubkey)
}
_ => Err(String::from(
"verify_v6_signature_with_pub requires a Zcash v6 (Ironwood) PSBT",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

let's use structured errors here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

zcash_psbt.verify_v6_signature_with_xpub(secp, input_index, xpub)
}
_ => Err(String::from(
"verify_v6_signature_with_xpub requires a Zcash v6 (Ironwood) PSBT",

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

same

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

addressed

@veetragjain
veetragjain force-pushed the veetragjain/cshld-1681-implement-verifysignature-for-zcashironwoodbitgopsbt-zip-244 branch from 8d385d2 to c4cb3f4 Compare September 8, 2026 13:23

@akarath akarath left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved

@veetragjain
veetragjain merged commit 47b1223 into master Sep 8, 2026
13 checks passed
@veetragjain
veetragjain deleted the veetragjain/cshld-1681-implement-verifysignature-for-zcashironwoodbitgopsbt-zip-244 branch September 8, 2026 13:56
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.

3 participants