Blockchain
Blockchain
Somnia is an EVM-compatible chain: the Somnia Global L1, plus Regional Subchains placed in trading hubs. This section covers the networks, how they work, the explorer's pages for the chain and the protocols that span its networks.
Somnia is made up of the Somnia Global L1 and Regional Subchains. The Global L1 is run by validators around the world, and holds the assets, accounts and settlement that every subchain shares. Regional Subchains are lower-latency chains with validators in specific trading hubs.
| Network | Status | What it is |
|---|---|---|
| Somnia Global L1 | Live | The main chain, chain ID 5031 |
| Tokyo Subchain | Live | A Regional Subchain with validators in Tokyo, chain ID 50321 |
| Somnia networks | Live | Mainnet and testnet, and every chain on them, with chain ID, currency, RPC and explorer |
For chain IDs, RPC URLs and explorers, see Somnia networks and Network info; to add a chain to your wallet, see Connect a wallet.
The products of the chain itself, as the Somnia Explorer's Blockchain section lists them:
| Product | Status | What it is |
|---|---|---|
| Somnia Explorer | Live | The chain and every product on it, live, with APIs for agents |
| Faucet | Live | Test STT for testnet |
| Validators | Live | This epoch's committee, every validator's stake and delegation |
| RPCs | Live | The public HTTP and WebSocket endpoints; dedicated nodes coming soon |
| Somnia Bridge | Live | Moves tokens between Global and Tokyo |
| Somnia Accounts | Live | Accounts at the same address on every Somnia chain |
| Somnia Reactivity | Live | Contracts that react to events, usually in the same block, with no keepers |
| Somnia Gas Sponsorship | Coming soon | Native gas sponsorship, so users trade without holding SOMI |
How the chain works
- MultiStream consensus. Every validator publishes its own data chain. A separate consensus chain, running modified PBFT, advances the heads of all data chains at once.
- Global ordering. A deterministic pseudorandom ordering of the data chains produces a single ordered stream of transactions.
- Compiled execution. EVM bytecode is compiled to native code.
- IceDB. A purpose-built database with built-in snapshotting.
- Compression. Streaming compression and BLS signature aggregation reduce bandwidth.
- Cuthbert. Validators also run every transaction through Cuthbert, a separate, unoptimised implementation, and halt if the two disagree.
Chain features
- EVM compatible. Solidity contracts, standard wallets and existing tooling work unchanged.
- Finality. Transactions are final in under a second on mainnet.
- Gas price. The base price is 6 gwei outside of congestion. At that price, a plain SOMI transfer to an existing address (21,000 gas) costs 0.000126 SOMI. Sending SOMI to an address that has never held anything creates its account and costs 421,000 gas (0.002526 SOMI). Transfers to contracts, and other calls, also cost more, in proportion to the gas they use.
- Sustained-use discounts. High-volume senders get automatic 70% or 90% base-fee discounts.
- Proof of stake. Validators stake SOMI. Stake isn't slashed onchain today: a validator that stops participating can be voted out of the committee, and node operators under Somnia's node terms have their rewards reduced when their uptime falls.
- ERC-4337 EntryPoint v0.7. Deployed on mainnet, so gas can be sponsored through ERC-4337 paymasters.
- EIP-7702. Externally owned accounts can delegate to smart-account code.
Example
chain.ts
import { defineChain } from "viem";
export const somnia = defineChain({
id: 5031,
name: "Somnia Mainnet",
nativeCurrency: { name: "Somnia", symbol: "SOMI", decimals: 18 },
rpcUrls: {
default: {
http: ["https://api.infra.mainnet.somnia.network"],
webSocket: ["wss://api.infra.mainnet.somnia.network/ws"],
},
},
blockExplorers: {
default: { name: "Somnia Explorer", url: "https://explorer.somnia.network" },
},
contracts: {
multicall3: { address: "0x5e44F178E8cF9B2F5409B6f18ce936aB817C5a11" },
},
});
See it in use
- Somnia Explorer. The Global L1's blocks, transactions, tokens and contracts, live; Tokyo for the Tokyo Subchain.
- Validators. This epoch's committee, and every validator's stake and delegation.
Use it from the CLI and MCP
somnia read --network tokyo # chain ID and latest block over JSON-RPC
somnia watch heads --network mainnet # each new block as it lands
somnia explorer block $NUMBER --network testnet # one block through the Explorer's API
Every command takes --network mainnet, testnet, tokyo or tokyo-testnet (CLI 0.2.0 or newer for the Tokyo two). The MCP server gives agents the Explorer reads as its explorer_block, explorer_transaction and explorer_address tools; it has no tool for somnia read or somnia watch. To deploy or call your own contracts, use your usual library, such as viem or ethers, with the chain definition above.