[program] Re-order confidential mint burn ciphertexts to dest/src, supply, then auditor #173
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
Auditor ciphertexts for the confidential mint and burn amounts were added to instruction data in solana-labs/solana-program-library#7480. In the processor logic for confidential mint and burn, the auditor ciphertext that is included in the instruction data should be checked whether it corresponds to the auditor ciphertext in the proof data.
Currently, the wrong component of the grouped ciphertext is checked. A grouped ElGamal ciphertext for the confidential mint and confidential burn amounts have the second component correspond to the "auditor" component. However, the third component that corresponds to the confidential "supply" is checked for consistency instead.
Summary of Changes
A simple fix is to just update the processor logic to check the consistency of the second component of the ciphertexts. However, as suggested in #128, I swapped the order of the auditor and supply ciphertext components in the proof data as suggested in #128. This way, the auditor ciphertext component is always third in grouped ciphertexts in confidential transfer, confidential transfer with fee, and confidential mint burn extensions, which could prevent confusion.
Fixes #128.