0

I'm a new JS coder, Ethereum coder and first day on Solana. I don't get the terms like Token Mint, Token Account, Token Program, Token Program ID even after reading the cookbook and more. All I know is SPL Token is like ERC-20.

Can someone explain it from the POV of an Ethereum coder? I think this is great for posterity since some ETH coders might move to SOL.

2 Answers 2

2

in Ethereum, you have ERC20 Tokens (Token Mint). In Solana, SPL Tokens

In Ethereum, you don't have Token Accounts, you can send any token to anyone. In Solana, a Token Account is an account that holds SPL Tokens. You need to have a Token Account for that SPL Token if you wanna hold that SPL Token. You send SPL Tokens to Token Account

In Ethereum, you don't have a Token Program. Rather it's done implicitly. In Solana, Token Program allows the transfer of SPL Tokens between Token Accounts. It needs to be called in order to transfer the SPL Tokens.

Token Program ID is the address of the Token Program. e.g. "TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"

6
  • Why do you call ERC20 Tokens as Token Mint? Do you mean a token is called a mint? Like I have 10 ETH tokens, is I have 10 SOL mints (like candy)? And Token Account is like my MetaMask wallet address? And Token Program is the MOTHER of all Token Accounts? Btw, which of the above is equivalent to smart contract?
    – ratib90486
    Commented Aug 8, 2022 at 14:50
  • Is Token Account my wallet address? Like my Phantom wallet address?
    – ratib90486
    Commented Aug 8, 2022 at 14:51
  • Some medium posts said Token Program is like smart contract. But here you said it's the Mother contract. It's like to do some actions say transfer SPL Tokens from wallet A to B, we need to ask Mother's (Token Program) permission to do it. Right? If so, what is smart contract in Solana?
    – ratib90486
    Commented Aug 8, 2022 at 14:54
  • Token program is a smart contract program (regular program) that Solana defined to handle tokens.
    – vicyyn
    Commented Aug 9, 2022 at 6:44
  • Ok, correct me please. There's actually only ONE "smart contract" in the entire Solana chain called SPL-Token Program or just Token Program in short, is that right? So tokens are not created or stay inside smart contracts.
    – ratib90486
    Commented Aug 10, 2022 at 6:29
0

Token Mint: is the address of any token (Token, NFT)

Token Program ID: is like the address of a Smart Contract. On Solana, Smart Contracts are called Programs.

Token Program: Probably you are talking about the SPL-Token Program, a smart contract that we use on Solana to create tokens.

Token Account: Your wallet account has a Token Account for each Token Mint. For example, if I have USDC, USDC has the Token Mint. And that USDC/Token Mint is stored on a Token Account exclusively for USDC, inside my wallet.

4
  • Why do you need an address for token (Token Mint) when you have address for Program (smart contract). Do you have an example of a Token Mint? I don't agree with what you said about Token Program ID and Token Program. AFAIK, Token Program is a MOTHER program that takes care of other programs. Please view this - nimb.ws/VreUTd. Otherwise, we won't have the constant TOKEN_PROGRAM_ID.
    – ratib90486
    Commented Aug 9, 2022 at 2:48
  • If I wish to get the address of the USDC smart contract, where do I look? Token Account?
    – ratib90486
    Commented Aug 9, 2022 at 2:51
  • Every token on Solana has its own address called Token Mint. explorer.solana.com/address/… This address is the Token Mint of that NFT. Token Program and Token Program ID is like I already described to you. You need to change your way of thinking, forget about EVM chains. USDC hasn't a contract, it has a Token Mint, generated but the SPL-Token Program, First, learn how the account model works on Solana. Check Solana Coockbook
    – Andres
    Commented Aug 9, 2022 at 12:40
  • Also, you need to understand the contracts on Solana are stateless, code and data are separated. that's why you don't need the contract address, you need the Token Mint (token address) and the ATA (Associated Token Account)
    – Andres
    Commented Aug 9, 2022 at 12:43

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