You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When extracting the Sapling types back into sapling-crypto, we added more type safety. In particular, we made the proof verifying keys typesafe by placing the bellman types inside opaque newtype wrappers (to prevent downstream users from trying to verify a Spend proof with the Output proof verifying key, for example; the bellman types permit that because Groth16 proof encodings do not explicitly bind to the circuit).
In zcashd we do batch validation at the Sapling bundle level:
This works fine after the type changes: zcashd passes in whole bundles, and the Spend and Output verifying keys, and sapling-crypto knows what to do with them.
zebrad took a different approach, creating independent Tower services for batch-verifying Spend proofs and Output proofs (and every other authorization part). The type safety changes break this use case. Refactoring zebrad to verify only at the bundle level is not feasible (and maybe has a performance impact, IDK).
We should expose individual batch validation types for Spend and Output proofs individually. We can then use them internally to BatchValidator for zcashd, while zebrad can use them directly (and gain type safety in their batch validation Tower services that is currently missing).
The text was updated successfully, but these errors were encountered:
When extracting the Sapling types back into
sapling-crypto
, we added more type safety. In particular, we made the proof verifying keys typesafe by placing thebellman
types inside opaque newtype wrappers (to prevent downstream users from trying to verify a Spend proof with the Output proof verifying key, for example; thebellman
types permit that because Groth16 proof encodings do not explicitly bind to the circuit).In
zcashd
we do batch validation at the Sapling bundle level:sapling-crypto/src/verifier/batch.rs
Lines 17 to 22 in d23547f
This works fine after the type changes:
zcashd
passes in whole bundles, and the Spend and Output verifying keys, andsapling-crypto
knows what to do with them.zebrad
took a different approach, creating independent Tower services for batch-verifying Spend proofs and Output proofs (and every other authorization part). The type safety changes break this use case. Refactoringzebrad
to verify only at the bundle level is not feasible (and maybe has a performance impact, IDK).We should expose individual batch validation types for Spend and Output proofs individually. We can then use them internally to
BatchValidator
forzcashd
, whilezebrad
can use them directly (and gain type safety in their batch validation Tower services that is currently missing).The text was updated successfully, but these errors were encountered: