-
Notifications
You must be signed in to change notification settings - Fork 4.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[zk-token-sdk] Add VerifyGroupedCiphertext2HandlesValidity
and VerifyBatchedGroupedCiphertext2HandlesValidity
proof instructions
#31816
[zk-token-sdk] Add VerifyGroupedCiphertext2HandlesValidity
and VerifyBatchedGroupedCiphertext2HandlesValidity
proof instructions
#31816
Conversation
Codecov Report
@@ Coverage Diff @@
## master #31816 +/- ##
=========================================
- Coverage 81.9% 81.9% -0.1%
=========================================
Files 757 759 +2
Lines 207054 207187 +133
=========================================
+ Hits 169648 169750 +102
- Misses 37406 37437 +31 |
VerifyCiphertextValidity
and AggregateCiphertextValidity
proof instructionsVerifyGroupedCiphertext2HandlesValidity
and VerifyBatchedGroupedCiphertext2HandlesValidity
proof instructions
zk-token-sdk/src/instruction/batched_grouped_ciphertext_validity.rs
Outdated
Show resolved
Hide resolved
One nit, otherwise looks good to me. |
Yeah, so that is a good question. The 1 and 3 handle cases are quite natural/useful as well. For the 1 handle case especially, we would definitely want to support a validity proof for it at some point. The 1 handle grouped ciphertext is just a standard ElGamal, so it could just be For >3 handles, I think it starts becoming much less useful, so it is unlikely we would support it in the future. It would be really nice to make some of these instructions more generic (if not these instructions, then range proof instructions for different bit-sizes), but it was not clear how since the context and proof sizes are all different. I think it is not out of the question, but I think we would need to use something other than |
…ty.rs Co-authored-by: Tyera <[email protected]>
Oh, and I will also update the names for the sigma proof from |
…ifyBatchedGroupedCiphertext2HandlesValidity` proof instructions (#31816) * add grouped ciphertext validity proof data * add batched grouped ciphertext validity proof data * rename proof contexts and data for consistency * add grouped ciphertext validity proof instructions * Update zk-token-sdk/src/instruction/batched_grouped_ciphertext_validity.rs Co-authored-by: Tyera <[email protected]> --------- Co-authored-by: Tyera <[email protected]> (cherry picked from commit 0495051)
…nd `VerifyBatchedGroupedCiphertext2HandlesValidity` proof instructions (backport of #31816) (#31918) [zk-token-sdk] Add `VerifyGroupedCiphertext2HandlesValidity` and `VerifyBatchedGroupedCiphertext2HandlesValidity` proof instructions (#31816) * add grouped ciphertext validity proof data * add batched grouped ciphertext validity proof data * rename proof contexts and data for consistency * add grouped ciphertext validity proof instructions * Update zk-token-sdk/src/instruction/batched_grouped_ciphertext_validity.rs Co-authored-by: Tyera <[email protected]> --------- Co-authored-by: Tyera <[email protected]> (cherry picked from commit 0495051) Co-authored-by: samkim-crypto <[email protected]>
Problem
The zk-token-proof program does not yet have instructions that can verify whether a ciphertext is valid.
Summary of Changes
Add
VerifyGroupedCiphertext2HandlesValidity
andVerifyBatchedGroupedCiphertext2HandlesValidity
instructions.The verification for these instructions were benched in a devserver and CU units were computed assuming that 1 CU should take roughly 33ns (as per #25464 (comment)). I hope to create another PR with the benchmark code as a follow-up.
This will be the last set of instructions to be added to the proof program for token-2022.
Fixes #