Most Solana token tutorials end at minting. That's fine until you need a token that behaves differently from a plain one. Token-2022 is the newer token program, and its extensions let one token do things like collect fees on every transfer, refuse to move at all, or be revoked by an authority. I spent day 42 of #100DaysOfSolana working through three of them.

What you'll learn
How transfer fees are configured and collected
Why non-transferable tokens are useful for credentials
How a permanent delegate lets an authority reclaim tokens

  1. Transfer fees

A transfer fee is set in the mint's TransferFeeConfig extension. Each transfer withholds a percentage of the amount, up to a cap, and the withheld amount stays on the destination account until someone harvests it.

  1. Non-transferable tokens

The NonTransferable extension blocks transfers entirely. That makes it a good fit for tokens that represent something that shouldn't move, like a membership or a credential.

  1. Permanent delegate

The PermanentDelegate extension gives a designated authority the power to move or burn tokens from any account of that mint. It's the mechanism behind revocable credentials, and it's also the one that makes people nervous, so it's worth being explicit about who holds that key.

Code and links
Repo: https://github.com/parnita-Singh/100-days-of-solana

Follow along with the rest of the series with #100DaysOfSolana.