Presented by

An EVM layer 1 Somnia drew attention after announcing it reached a milestone of one million TPS. Founder Paul Thomas provided insights into this achievement, discussing the project’s unique architecture on Cointelegraph AMA.

Rewriting blockchain from scratch

As Thomas explained, Somnia has achieved 500,000 to 800,000 TPS on the public test network and over a million on the devnet before that. This was made possible by a combination of a new execution engine, a Multistream consensus mechanism, and a high-speed database, IceDB.

In Somnia, each validator operates its own mini-blockchain that runs independently at speeds of up to one block every 100 milliseconds. These data chains can move quickly because they don’t require global consensus to create each new block. To maintain the coherence and composability of this network, a separate consensus chain runs concurrently at 20-millisecond intervals. It acts as a universal observer, constantly synchronizing the state of all validators. All validators read from it to ensure that when they add new blocks, they don’t conflict with the current global state.

“You deploy code and it just runs and scales,“ Thomas added. “You don’t have to worry about it running on this server and how do I talk between servers?“

Although building custom databases is not standard practice, the Somnia team preferred to go in this direction after sorting through various Web2 and Web3 options. “We completely rewrote the caching algorithm. Our predictive algorithm preemptively places essential data in RAM, minimizing disk access. It leverages the power-law distribution of blockchain data, where about 5% of smart contracts account for most calls, to optimize memory usage,“ Thomas clarified.

In addition to database optimization, the team also dealt with data compression. “We took some lessons from the gaming industry, where it’s also critical to performance, especially for multiplayer games,“ Thomas said. “So we applied similar methods, including novel algorithms based on blockchain data distribution patterns. For example, the top two accounts might handle 95% of all calls, allowing for specialized compression approaches.“

Another strategy involves signature batching, a critical compression method. “Signatures aren’t typically compressible, but we use a BLS signature scheme. It allows us to aggregate multiple signatures into one, which significantly reduces the data size,“ he added.

Unlocking decentralized reactive apps

With the launch of the mainnet later this year, Thomas believes that Somnia is already fully developer-ready. “Developers can start developing now and build anything they couldn’t build on any other EVM-compatible chain. Our goal is to inspire them by giving them a blockchain that allows them to build things that were previously impossible due to transaction limitations, latency, or cost. I’m incredibly excited to see what they bring to the table.“

Helping to build decentralized reactive applications that respond instantly to changes in data or state completely onchain is Somnia’s main focus. “We’re exploring ways to let developers code directly in game engines and easily move that logic onchain, without having to learn smart contracts. This can be huge – allowing Web2 developers to jump in quickly and unlock tons of new apps,“ Thomas emphasized.

He sees strong potential for Somnia to leverage onchain data and logic to enhance gameplay and innovation, such as putting detailed game events directly onchain. “The key benefit of this approach is the creation of a composable metadata layer that allows developers to build companion applications and unique gaming experiences,“ Thomas said. “You can build a fantasy league around game outcomes, or real-time prediction markets where you bet on specific in-game outcomes.“

He cited Improbable and MSquared as key partners: “Their metaverse technology is really pushing a range of consumers into these onchain-backed applications and changing the boundaries of what’s possible.“

Composable games are the next evolutionary step, according to Thomas: “Substantial logic and data stored on the chain will allow developers to create more games faster, potentially opening up entirely new game genres. It’s similar to the modding scene of Web2 games like MOBAs, which started as a mod of Warcraft III.“

He also sees use cases for other types of platforms. “There is room for fully onchain user-generated content platforms, similar to Roblox but decentralized, and even fully onchain real-time social media apps,“ he concluded.

Explore Somnia in detail

Disclaimer. Cointelegraph does not endorse any content or product on this page. While we aim at providing you with all important information that we could obtain in this sponsored article, readers should do their own research before taking any actions related to the company and carry full responsibility for their decisions, nor can this article be considered as investment advice.