This repository has been archived by the owner on Jan 10, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
[program-2022] Add auditor ciphertexts to instruction data #7480
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
samkim-crypto
force-pushed
the
audit-ct
branch
from
November 12, 2024 03:12
8b947e6
to
99bd97b
Compare
joncinque
reviewed
Nov 13, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
the guts look great! Just a nit on the API for token-client and a nit on converting into TokenError
token/program-2022/src/extension/confidential_mint_burn/processor.rs
Outdated
Show resolved
Hide resolved
joncinque
previously approved these changes
Nov 14, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks really good! Just one last nit, up to you
/// type is a convenience type that contains the proof data and the extracted | ||
/// ciphertexts. | ||
#[derive(Clone, Copy)] | ||
pub struct CiphertextValidityProofWithCiphertext { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: maybe make this totally clear by specifying the auditor bit?
Suggested change
pub struct CiphertextValidityProofWithCiphertext { | |
pub struct CiphertextValidityProofWithAuditorCiphertext { |
mergify
bot
dismissed
joncinque’s stale review
November 15, 2024 00:19
Pull request has been modified.
joncinque
approved these changes
Nov 15, 2024
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Problem
Currently, confidential transfer, mint and burn instructions do not include the transfer amount ciphertext as part of the token instruction data. This ciphertext is included as part of the proof that is either included in the Zk ElGamal proof program instruction, record account, or context state account.
From the perspective of a real world auditor who must constantly be monitoring activities in a particular mint to decrypt transactions, it must access the ciphertexts indirectly by first looking up the token instruction data and then if proof accounts are used, look up the corresponding record account or context state account, parse these accounts, and then get the transfer amount ciphetext. It would make life much simpler for the auditor if the token instruction data simply includes the auditor part of the ciphertext.
Summary of Changes
Added the auditor ciphertext to the confidential transfer, mint, and burn instruction data. I think the program changes should be straightforward. The only tricky part is coming up with the most logical interface on the client side. I updated the transfer, mint, and burn token-client functions to take in the auditor ciphertext as input, but I am open to suggestions on making the client functions a bit simpler.