Creating Real-Time Applications on the EVM | Paul Thomas - Somnia
Ethereum Denver·Thu, Oct 9, 2025, 12:00 AM
🚀 Get Ready for ETHDenver 2025! 🚀 We're already hard at work preparing for next year's biggest Web3 event! Keep your eyes peeled for more info on ETHDenver 2025—it’s going to be epic! 🌟
Transcript
performance characteristics we can do a million transactions per second with subsec latency and subse gas fees so I'd like to start this talk with why we built somia so I used to work at a company called improbable um we basically did gaming technology and services and we also did metaverse stuff the key technology we made was this technology allows for tens of thousands of people to be in the same space digitally at the same time so we apply that to the games industry but also the music industry and the sports industry now obviously all of these applications are going monetized through digital assets but they're all owned by different businesses and so we needed a way to have an interoperable layer that every consumer could buy digital assets and have them interoperate across these experiences and blockchain is obviously a very good solution for that the issue is we couldn't find a blockchain that could scale for these kind of consumer applications when you have 20,000 people all trying to buy the same thing at the same time blockchains cannot scale to that today and so we set out to solve that problem so if we get to the next slide so in terms of Sonia does and what we do first high performance so again very high throughput we can do 1 million transactions per second with subsec latency when we mean latency we mean endtoend client latency so block time is actually 100 milliseconds so it's super fast we're fully evm compatible so when we mean evm compatible we mean you literally can just change the RPC and your application will Port it over we did this because obviously there's a huge developer ecosystem around evm and it's very important the next thing is low cost so we're trying to get the gas fees to be below 0 .1 cents so that's super super cheap the vision here is really to enable developers to move their logic that normally lives offchain and mo that fully onchain the final part is we are what we call a reactive blockchain so I could do a whole 30 minute talk on this but essentially we allow you to react onchain data in a fully onchain manner so you can listen to onchain activations on onchain data changes and do that in full smart contracts so you don't need any external third party services so how did we build somnia and how did we get to those Point characteristics so basically it's say full stack blockchain rewrite there is no Fork here there is no modification of anything else that exists a new execution layer that basically compiles evm bik code to machine code a new database called ICB optimized for blockchain data with really fast read and wrs a new consensus mechanism called multistream consensus a new networking layer which has really really high compression ratios to shuffle that data around the network so let's go through execution how do we do this so execution today in blockchain world is scaled in two ways one is shotting so having essentially multiple block chains all do different things this is what's happening with ethereum of l2s that works well we have issues with composability and interoperability the other way that's being touted a lot is parallel approaches now the problem with parallel approaches is they work very well for some use cases but not for the mass consumer use cases that I was talking about so if you have lots of different applications that are item potent that touching different pieces of state so me and you are swapping erc20 this guy's doing an nft in this guy is's using another smart contract parallel will scale very well because each of those threads can process those individually but if everyone is doing the same thing at the same time parallel no longer scales so this happens in nft mints where everyone's trying to Mint the same nft at the same time this happens with mean coin launches where everyone's trying to trade the same L people so we don't think parallel is very good for these high concurrency use cases this is exactly what happened in the other side Min back in 20202 whatever that was so you may think this doesn't happen very frequently it's only when Mega mins happen or mean coin launches happen but if you look at the frequency of smart contract calls in ethereum from 2024 this is what this graph shows so on the top here we have call frequency on the bottom we have contract addresses you can see a big parel curve we are calling the same contracts over and over again the problem with parallel is you have to roll back and essentially execute this sequentially so you're going to get a lot of religions and we don't think parallel will scale very effectively so how do we do it we basically take evm B code compile that down to machine code this allows us to take advantage of Hardware parallelism so this is something we use in the game industry a lot modern CPU architectures are really good executing machine code executed out of order their Branch prediction so we basically take evm bite code compile that down that's done in two ways we have an on the-fly compiler so just upload your smart contract and we compile on the fly or a pre-compile step we compile it ahead of time and upload your compile code so next we have the database so the database again is a complete rewrite of a database we tried to look at things like rock DB pedals but we couldn't find anything that was fast enough so it has three properties one it has what we call predictable performance so you can understand the cost of read or rights I'll explain why that's important later second is optimized for blockchain data structures just built with blockchain data structures in mind from the ground up and third as super fast Freedom rights with a very effective caching strategy so the predictable performance how do we do that what does that mean why is that important so every time you do a read or write with somnia a performance report is created so that performance report essentially tells you did this hit dis did this hit cash and therefore you can understand the cost of that read or write because you can understand the cost of that read or write you can modify bu the gas to exactly price that read or right exactly this essentially means you can fit more gas into a block more gas into a block means more transactions which means we can have higher throughput the next thing is the read write cache so the average readwrite time on sonnia with ICB is 15 to 100 NCS 15 when you hit cache 100 when you hit dis that for context most of the time databases are measured in micros seconds so Nan seconds is very fast um the reason we've done this is basically a back to front rewrite with a very very effective Liu readwrite cache that basically optimistically add stuff to the cache and kind of predicts what needs to be in the cach ahead of time so the consensus model how do we do this so this is a new consensus model called multistream consensus is a partial bft model um it's inspired by a white paper called Motorway uh which you can find online motow bft the way it works essentially each validator in the network has almost its own mini blockchain we we call those data chains so each Valor can create blocks in their own blockchain those are around 100 millisecond block times we're then continuously running what we call a global consensus chain across all of the validators to work out what is the head state of the blockchain now that is being run at around 20 milliseconds so faster than the validators can create blocks themselves then all the validators are constantly reading from that consensus Chain Looking At what is the current head state of the blockchain so they're not colliding with any of that head state with any other validators so what this means is you essentially have lots of manyi blockchains all working together in one Global Uncharted context this increases throughput significantly and decreases latency so I explain that very fast you can look at our white paper online and go through more details networking so the this isn't talked about a lot in the blockchain sphere but when you're getting to hundreds of thousands of transactions millions of transactions the real problem you have is a networking problem so if you think about a standard ethereum transaction is around 200 bytes if you're doing a million of those that is 190 mbes per second or 1.5 GB a second now if you want an actually decentralized Network that's going to run across the public internet you're going to have a bad time so you need to think about how you com press that data and can make it much smaller so you can actually have a fully decentralized Network running at those capacities so how do we do this so we take advantage of what's called a parel distribution so for people aren't aware a parallel basically shows the ratio of frequency of occurrences with the thing they happen a a lot in nature and in organizations so if you look at say a sales organization the top five sales people will do 90% of the revenues if you look at say the games industry the top 10 games in the games industry account for 95% of the revenues so you get this kind of curve of a very long taale so if you look at ethereum or if you look at any blockchain you can see that many smart contracts and accounts are interfaced with so so the top accounts are interfaced with many times and then there's a very very long taale that means you can take that knowledge and use a very novel compression argument to compress that data down to make it much smaller than necessary now if you don't believe me remember this card from before this is clearly showing a power o and we take advant of that with our compression algorithm now the next thing is signatures so signatures by definition are uncompressible um the way we solve this problem is we essentially batch the signatures together using a BLS signature scheme so the way this works and this is very high level CU not got much time you essentially aggregate all of the keys together to make a master aggregate key and you aggregate all of the signatures together to make an aggregate signature and you send that around the network um so these are used today in ethereum so in the beacon chain between validators this is used but we use this across the whole network between all the clients and all the validators so this obviously decreases increases compression ratios but also increases throughput as well now this is one of our backwards compatibility breaks so because we are using BLS signatures you can't out of the box use metam mask or Phantom or a wallet like that um we do have backwards compatibility for ethereum signatures so eliptic curve signatures so you can still use all the stuff that exists in the ecosystem today you just can't get to those million transactions through put you're now looking at 100,000 or so still pretty good um the main use case for this we're seeing is people who are building games embedding the wallet into the game and using a signature scheme directly so we do three things uh one is that novel compression algorithm that takes advantage of the power LW two is streaming compression I skipped that in this talk but essentially we use a compression technique that's used in video compression to allow for much better compression ratios and three we use signature badging so Al together that gives us 10 to 20 times better compression ratios than any other blockchain in the market today as far as we're aware of so we can send all that data around the network effectively so four things just to recap increased single threaded execution through an evm compiler a new database designed for predictable performance and really fast reading wrs a new consensus algorithm allow for higher throughput called mream consensus and a compression algorithm that allows for 10 to 20 times better time compression ratios between nodes now benchmarks let's actually get to some raw numbers so the first Benchmark we ran were erc20 transfers so when I talk about transactions these are real transactions these are 100 accounts all transferring ERC 20s between each other this is running on 100 nodes globally across several data centers so for this uh we topped out 1.05 million transactions per second for context that was using the ethereum gas model that is 50 gigas per second when I saw this number I was a bit like that's crazy people normally talk about meag gas people are trying to get to 1 gigas so 50 gigas is crazy uh here you see the latency uh results so it's about 1.2 seconds in the mean case um the reason for this is obviously you're maxing out the network so latencies are going up a little bit and this is end to endend latency so it's not finality it's the time a client submits uh a transaction to the blockchain that transaction gets accepted and another client can read it so it's proper endtoend latency we then ran another Benchmark Unis swaps per second so this I think is a much better Benchmark and something that I wish more of the industry talked about and used so here uh un swap B3 100 accounts all trading between the same L people uh here we got to 50 un 50,000 Unis swaps per second uh so the context any mean coin launch on somnia would go very well we wouldn't have any problems there latencies are significantly better because you're not modifying as much State as ec20 swaps so the next one was nft mints per second again I think this is a much better use case and a real world workload so here we essentially had 100,000 accounts all trying to Min the same nft at the same time for this we got to 300,000 nfts per second mitted that's a lot of nfts you won't have the scaling problems that you normally have at nft mints and laty numbers in there are pretty good so I think the next thing for us to work on really is optimizing those endtoend latency numbers uh which we're looking at doing over the next couple of months so just to recap what is somnia somnia is a high performance L1 fully evm compatible can do a million transactions per second Subs gas fees and very low latency so where we're at in the journey um so we just released our test net last week uh we have all of the components and infrastructure you need to build your apps so we're kind of now really excited to get developers building with the blockchain I think for me what I'm really interested in seeing what developers come up with now the blockchain doesn't really have the limits used to have before I really want people to start thinking about what are the apps that you wanted to build that you couldn't build because there were limitations in terms of blockchain scaling so there some links uh you can take a picture here follow us on X that obviously gives us you loads of updates you can follow me I talk about video games and blockchains a lot um you can use this link over here to join the testet you go to sn.
network you also there find our light paper find out more about the blockchain uh thank you very much I'm done
Automatic transcript — names and jargon may be misspelled.