Skip to content

Networks and chain ids

Every SVM network Morsel signs for, with its SDK key, chain id, older ids, native coin, public RPC and explorer, and what Morsel does with an id it doesn't know.

Every SVM network uses the same keys and the same address format, so a Morsel wallet has one address on all of them. What tells the networks apart is the chain id. It travels with every connect, sign and send, and Morsel signs only for the network it names.

Mainnets

NetworkSDK keyChain idOlder ids
Solanasolanasolana:5eykt4UsFv8P8NJdTREpY1vzqKqZKvdpsolana:mainnet
Cookie Chaincookiesolana:9wDaBRDgArEUpvhHxGguNkwozsZh4UpGgorbagana:testnet-v3
Fogofogosolana:CDLtwKnaCoK157uaHQDj4fHu72AyD251None
Sonic SVMsonicsvmsolana:9qoRTAHGWBZHYzMJGkt62wBbFRASj6H7None
X1x1solana:4SvBP3omtvcCVWdxq1zBY5cDp4wndjsTNone
Solayersolayersolayer:mainnetNone
NetworkNativePublic RPCExplorer
SolanaSOLhttps://api.mainnet-beta.solana.comSolscan
Cookie ChainCOOKhttps://rpc.cookiescan.ioCookieScan
FogoFOGOhttps://mainnet.fogo.ioFogoscan
Sonic SVMSOLhttps://api.mainnet-alpha.sonic.gameSonic Explorer
X1XNThttps://rpc.mainnet.x1.xyzX1 Explorer
SolayerSOLhttps://mainnet-rpc.solayer.orgSolayer Explorer

Every native coin has 9 decimals. Each network has a quick start: Fogo, Sonic SVM, X1, Solayer, Cookie Chain and Solana.

Test networks

NetworkSDK keyChain idOlder ids
Solana Devnetsolana-devnetsolana:EtWTRABZaYq6iMfeYKouRu166VU2xqa1solana:devnet
Solana Testnetsolana-testnetsolana:4uhcVJyU9pJkvQyS88uRDiswHXSCkY3zsolana:testnet
Fogo Testnetfogo-testnetsolana:9GGSFo95raqzZxWqKM5tGYvJp5iv4Dm5None
Sonic SVM Testnetsonicsvm-testnetsolana:BRSVhduW2sGkyhrxK6MYqyymirEggFv1None
X1 Testnetx1-testnetsolana:C7ucgdDEhxLTpXHhWSZxavSVmaNTUJWwNone
NetworkNativePublic RPC
Solana DevnetSOLhttps://api.devnet.solana.com
Solana TestnetSOLhttps://api.testnet.solana.com
Fogo TestnetFOGOhttps://testnet.fogo.io
Sonic SVM TestnetSOLhttps://api.testnet.sonic.game
X1 TestnetXNThttps://rpc.testnet.x1.xyz

Solayer has no test network Morsel knows.

How a chain id is made

A network is identified by its genesis hash. The chain id is CAIP-2: solana: followed by the first 32 characters of that hash. Fogo's genesis hash is CDLtwKnaCoK157uaHQDj4fHu72AyD2519Cphmpiq6hvT, so its chain id is solana:CDLtwKnaCoK157uaHQDj4fHu72AyD251.

Solayer's node answers getGenesisHash with a placeholder, so there is nothing to derive an id from. It is named solayer:mainnet instead.

Besides the chain id, Morsel accepts:

  • the older ids in the tables, so dApps written before 0.4 keep working;
  • the 33-character form some wallets send, and the full genesis hash;
  • names such as fogo:mainnet.

Send the chain id. The others exist for compatibility.

Unknown ids are refused

An id that names no network Morsel knows is refused. It is never treated as Solana: signing a transaction for the wrong network is how funds get replayed or lost.

WhereWhat happens with an unknown id
SDKsvmChain(id) answers null. connectionFor(id) throws Unknown SVM network.
Injected providerThe request fails with 4901 and Unsupported network.
Wallet StandardThe request fails with invalid chain.

A URL is not a network either. Passing an RPC URL where a chain id belongs is refused the same way. dApps never choose the RPC Morsel signs or sends through: Morsel checks every endpoint it uses against the network's genesis hash.

Read from your own RPC

The public endpoints above are rate limited and fine for trying things out. In production, use your own:

TSX
<WalletProvider chain="fogo" rpcUrl="https://your-fogo-rpc.example">
TS
const connection = connectionFor('fogo', 'https://your-fogo-rpc.example');

Your RPC is for your dApp's own reads. It never changes which network Morsel signs for.

Same address, separate balances

The address is the same on every network, but balances are not shared. FOGO on Fogo and SOL on Sonic SVM are separate from SOL on Solana. Read each balance with a connection to that network. For what users see, see Your address on each network.

Try one of these