2

How can I create a SPL token with the both the confidential transfer and transfer fee extensions?

2 Answers 2

1

You simply need to include the instructions to initialize both extensions before you initialize the mint. If you're using the CLI, that would be:

$ spl-token create-token \
  --enable-confidential-transfers auto \
  --transfer-fee 10 11 \
  --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb

You can mix and match any extensions that you want in your mint!

1

To create a new mint with confidential transfers enabled, run:

$ spl-token --program-id TokenzQdBNbLqP5VEhdkAS6EPFLC1PHnBqCXEpPxuEb create-token --enable-confidential-transfers auto

The auto keyword means that any token user can permissionlessly configure their account to perform confidential transfers.

If you would like to gate confidential transfer functionality to certain users, you can set the approve policy to manual. With this approve policy, all users must be manually approved to perform confidential transfers. Anyone can still use the token non-confidentially.

Note that you must configure your mint with confidential transfers at creation, and cannot add it later.

This guide explains how to use the confidential transfer extension: https://spl.solana.com/confidential-token/quickstart

Not the answer you're looking for? Browse other questions tagged or ask your own question.