-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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
[program-2022] Add auditor ciphertexts to instruction data #7480
Conversation
8b947e6
to
99bd97b
Compare
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
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?
pub struct CiphertextValidityProofWithCiphertext { | |
pub struct CiphertextValidityProofWithAuditorCiphertext { |
Pull request has been modified.
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.