[program-2022] Add functions to generate mint/burn proofs from account info #7575
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
The confidential mint/burn extension and the confidential transfer extension have some inconsistent ways of generating proofs from account data.
Summary of Changes
6b073ce: All proof data types (
TransferProofData
,TransferWithFeeProofData
,BurnProofData
, ...) just contains the proof components while theMintProofData
contains the new decryptable supply component. The decryptable supply ciphertext could be generated together with the proofs, but I think it is slightly more natural to generate it separately from account data like in the other confidential transfer instructions. In this commit, I removed the decryptable supply component fromMintProofData
. Sorry I should have noticed this before in the review 🙏 for #7319.9c80b2c: Added functions to generate mint and burn proof data from account infos. This would simplify the client for confidential mint and burn.
19b7525: The order of the parameters of type
ElGamalKeypair
andAeKey
are inconsistent between the account info functions of confidential transfer and confidential mint/burn, so I switched these. I also renameddecrypt_current_supply
withdecrypted_current_supply
to be consistent withdecrypt_current_balance
of confidential transfer.I apologize for the breaking changes, but I think this should really do it for the program 🙏 .