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 | Every network, with chain ID, currency, RPC and explorer |
For chain IDs, RPC URLs and explorers, see Somnia networks and Network info; to add a network 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 the testnets |
| 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 network |
| Somnia Reactivity | Live | Contracts that react to events in the same block, 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 500 ms on mainnet.
- Gas price. The base price is 6 gwei outside of congestion. At that price, a plain SOMI transfer (21,000 gas) costs 0.000126 SOMI. Transfers to contracts, and other calls, 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 and can be slashed for malicious behaviour.
- 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" },
},
});