Skip to content
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

[token-cli] Add confidential transfer deposit, withdraw, apply pending balance, and confidential transfer #5630

Conversation

samkim-crypto
Copy link
Contributor

@samkim-crypto samkim-crypto commented Oct 23, 2023

Problem

The token-cli does not yet support confidential transfer instructions to deposit and withdraw confidential transfer tokens, apply pending balance to available balance, and make a confidential transfer.

Summary of changes

Add the four commands for the four instructions listed above. For confidential transfers, the functionality is added into the existing transfer command instead of creating a dedicated command for confidential transfers.

@samkim-crypto samkim-crypto added the WIP Work in progress label Oct 23, 2023
@samkim-crypto samkim-crypto force-pushed the token-cli/confidential-transfer-deposit-withdraw branch from ae36bf6 to e8d72bf Compare October 23, 2023 01:12
@samkim-crypto samkim-crypto force-pushed the token-cli/confidential-transfer-deposit-withdraw branch from 371613d to 085f495 Compare October 23, 2023 20:17
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is looking really good! I got too excited and gave an early review, so I hope that's ok 😅

token/cli/src/main.rs Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
token/cli/src/main.rs Outdated Show resolved Hide resolved
.await
.unwrap(); // configure destination account for confidential transfers first

// NOTE: the test fails due to transaction size limit
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The next step is to add support for split proofs for this to pass, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yep that would be the next step. Since this PR is quite long already, should we land this PR once the existing issues are addressed and then add the split proofs in a follow-up?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah that's fine, it'll require #5663 anyway!


// withdraw confidential tokens
//
// NOTE: the test fails due to transaction size limit :(
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We'll just need another helper on the token client to generate the proof here, right?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yeah, it should suffice to build a token-client function that (1) creates a withdraw proof context, and then (2) follow through with the withdraw instruction.

@samkim-crypto samkim-crypto removed the WIP Work in progress label Oct 25, 2023
@samkim-crypto samkim-crypto changed the title [token-cli] Add confidential transfer deposit, withdraw, and apply pending balance [token-cli] Add confidential transfer deposit, withdraw, apply pending balance, and confidential transfer Oct 25, 2023
Copy link
Contributor

@joncinque joncinque left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks great, we're so close!

@samkim-crypto samkim-crypto merged commit 506ed92 into solana-labs:master Oct 25, 2023
29 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants