solana-program-library icon indicating copy to clipboard operation
solana-program-library copied to clipboard

[token-cli] Reduce number of transactions for confidential transfer withdraw

Open samkim-crypto opened this issue 1 year ago • 0 comments

Problem

The withdraw-confidential-tokens command is currently executed in a sequence of 4 transactions:

  1. system instruction to create the proof context account
  2. verify and store the proof context account
  3. execute the withdraw
  4. close the proof context account

Due to the transaction size limit, steps 1 and 2 must be independent transactions. However, steps 3 and 4 can still be executed in a single transaction.

Proposed solution

Update the token-client to merge the instructions in steps 3 and 4. This change should also be applied for other instructions that uses proof context such as ConfigureAccount.

samkim-crypto avatar Oct 27 '23 21:10 samkim-crypto