1

What is/are the way(s) to create a standard token that has the following characteristics:

  • Discrete in number and cannot be divided into fractions of that token (flexible on this)
  • Prevents additional number of those tokens from ever being added/minted in a way that is easily verifiable by third parties
  • Can be traded between wallets
  • Can be exchanged for other tokens and NFTs
  • Allows a freeze authority to reversibly flag a wallet to prevent movement of those tokens from that wallet
  • Allows the number of those tokens within a wallet to be revealed by performing a blockchain scan via standard JSON RPC calls
  • A JSON RPC websocket listener is able to detect when the number of this token changes within a specific wallet
  • The transfer history of a wallet for that token is viewable with standard JSON RPC API calls
  • Is compatible with all known standard wallets, such as Phantom
1
  • This question presupposes that each token is its own program, like in Ethereum. But in Solana we all use a single token program, the SPL token program
    – Henry E
    Jul 26, 2022 at 6:17

1 Answer 1

4

Yes, that is possible. Easiest way is probably the spl-token CLI

spl-token create-token --decimals 0 --enable-freeze
spl-token create-account TOKEN_ID
spl-token mint TOKEN_ID AMOUNT
spl-token authorize TOKEN_ID mint --disable

(you need to replace TOKEN_ID and AMOUNT with actual values)

Let's see in detail if that meets your requirements:

  • Discrete in number and cannot be divided into fractions of that token
    Yes, with decimals set to 0 there are only full tokens.
  • Prevents additional number of those tokens from ever being added/minted in a way that is easily verifiable by third parties
    Yes, disabling the mint authority takes care of that. Can be verified on chain (eg. Solana Explorer shows it as "Fixed Supply")
  • Can be traded between wallets
    Well, you'll need programs to do that, but yeah.
  • Can be exchanged for other tokens and NFTs
    Again, you'll need to build that on top. List it on Serum, create an AMM, something like that.
  • Allows a freeze authority to reversibly flag a wallet to prevent movement of those tokens from that wallet
    Yes. The --enable-freeze sets the creator wallet as the freeze authority (can also be transferred with authorize) and this wallet can then freeze token accounts (which what you want. When you refer to tokens in a wallet it is usually the associated token account)
  • Allows the number of those tokens within a wallet to be revealed by performing a blockchain scan via standard JSON RPC calls
    Yes, the explorers will display it and anyone can getAccountInfo and check the u64 (2 byte) number at offset 64 of the token account.
  • A JSON RPC websocket listener is able to detect when the number of this token changes within a specific wallet
    Don't know how to set that up but pretty sure that's possible somehow.
  • The transfer history of a wallet for that token is viewable with standard JSON RPC API calls
    Yes, to the point that your RPC provider stores transaction history. Beyond that there are other solutions ;)
  • Is compatible with all known standard wallets, such as Phantom
    Yes, because it's the Token Program (which is supported by pretty much all wallets)

hope that helps :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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