feat(wasm-utxo): verify ZIP-244 transparent signatures on Ironwood PSBTs - #385
Conversation
0b696af to
8d385d2
Compare
OttoAllmendinger
left a comment
There was a problem hiding this comment.
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", |
There was a problem hiding this comment.
let's use structured errors here
| 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", |
8d385d2 to
c4cb3f4
Compare
Ticket: CSHLD-1681