Kick out the EVM: How we hit 42 million payments/s on a purpose-built L2
Devcon·Thu, Nov 5, 2026, 12:00 AM
Speaker
Transcript
[music] [music]
Hello folks. So I'm Madhav Gupta. I'm the CTO at Polygon Labs and today we'll be talking about scaling blockchains. So I'll talk about like how you can scale the blockchains. I'll talk about what we did to achieve the scale of 40 to million payments per second.
What are the trade offs and and so on. So first like why the number 40 to million payments per second? Few reasons. Number one, 42 is the answer to everything so that and also two. So folks over at another blockchain company did their whole presentation with confetti and so on because they hit 41 million.
So I'm like okay, I'll do 42 then. In reality, the benchmarks ran came out to be 45 million transactions per second, payments per second, which is even more interesting. And the best thing about the architecture is that it scales linearly. This is just an arbitrary number that I decided to benchmark at. The hardest part is generating the load.
Imagine generating 45 million transactions every second to send to the server. Like it's not easy. That was the hardest part. It scales linearly, which means I can just add another server and I'll have more throughput. So I did the benchmark at one device at 11 at 25 at 100 and it just scales linearly.
Like it's almost perfectly linear and if you need more throughput, you can just add more servers. You will have more throughput. How can we achieve this? That's the hardest question because it it breaks a lot of assumptions in blockchains and the only way to get to this was to specialize. So, what we uh like first let's talk about why the scale, where this can be useful.
An example is like if you want every API call to be a payment rather than billing people at the end of the month, what if like you want to use something like X402 to charge the person just at the time of the call. This would let AI agents very freely pay for things and this is like the future of agentic payments, but agents just pay for what they need when they need um rather than worrying about signing up for postpaid billing, providing their details, ID and and so on. Like it just I make a call to the server, I pay for it, I'm done. Um and for that you need scale. So, Cloudflare for example basically said on a podcast that the moment they they want to enable this, they are going to offer this um like X402 over to their customers.
They were just blocked by scale. They couldn't find anyone doing 10 million TPS, which is the bare minimum they need. Um so they were blocked by this. Um obviously like I heard that we built this and it it's it's so much better than what they were imagining and so on. Oh they will release something like this very soon, basically more or less the same thing, but they'll base on base because they have an partnership there, but uh basically the same thing.
It's it's it's it's the architecture this architecture is the future um and I'll talk about why that is the case. So, first like how the architecture architecture actually works. The agent sends request to facilitator uh the facilitate X402 facilitator forwards it to the hub and the payment is done. Um this takes 20 microseconds in the benchmark like across multiple machines. It was not a local thing.
Um 20 microseconds it's like you take you you can blink multiple times like hundreds of times in this. So it's like you can blink a hundred times and the payment like in the time the payment takes. The settlement is batched, so you don't the costs are super low. Mentioned briefly before, but the costs are for this as low as 0.15 dollars per billion transactions.
So like it's zero, essentially zero. It's just the hardware server cost. It's you can for all practical purposes zero cost, free transaction. You can have as many as you want. So how we got there is by deletion.
So we like I started looking the whole stack of payments and blockchains from ground up and basically said like I don't need any of these. Like we should just keep the bare minimum stuff that we actually need and kick out rest of the things that are the bottlenecks. So the first thing to basically understand is like this is specialized for payments. This stack pay channels does nothing but payments. Like it cannot do DeFi for you.
It's not built for that. It's not a general purpose EVM. And not making it general purpose is how I was able to achieve this scale. So the first thing I did was to kick out EVM itself. That's the that's the biggest thing.
The interpreter, gas measuring, global state, state roots, like like everything is gone. Everything that consumed time it's gone. It only has what the payments need. And we also minimized what every payment needs to [clears throat] basically get to the scale. To get into more details like the first thing to unblock like if you want high throughput, you basically have to make sure nothing wait in line.
There is no queue. If you are processing things serially, if you are processing things in in order, if you are processing things by a nonce, that nonce three must come before nonce four, you will never hit this level of scale. You will never have parallelism at this level of scale. So we got rid of global ordering. There is no transaction ordering here.
You can it's just data. The transaction can be like the first transaction or the last transaction. It would not matter. The end state would be the same. This is not possible in a general purpose EVM, but how did we do it?
So for payments, what we did was we created state by payer merchant payer in the sense that the state is stored as let's say there is Alice, Bob and Charlie in the system. If Alice pays Bob $10 first transaction Alice signs is $10 to Bob. Now Alice wants to pay $20 more dollars to Bob. So Alice will not sign $20 to Bob. Alice will sign $30 to Bob.
Why? 10 + 20 is the cumulative amount. So what does this do for you? It eliminates the need of ordering the transaction. It does not matter if the $10 transaction comes first or the $30 transaction comes first.
The end state will always be $30 and that's the like it's it just eliminates ordering. You can get transactions in whatever order, process them first come first serve. You don't need to batch them into blocks. You don't need to have consensus over what goes next. You don't need to have a mempool that orders transaction by gas pricing.
You don't need gas metering. It just gets rid rid of so many things. So it's a big advantage that you just kick out ordering. You kick out all queues. You have maximal parallelism.
Whatever comes in gets processed. The end state is consistent. It does not matter which order things came in. There are no global order. There is no blocks.
There are no mempools. There are no nonces. Anyone who has worked on Ethereum or any blockchain development, they know like managing nonces, especially for high throughput things, is a nightmare. Like there are it's just really a nightmare if you have built anything with high throughput. We we got rid of all of that.
There is no gas payment per transaction. All of that is gone. That that's how we achieve maximal parallelism and it's very helpful in scaling. While we were at it, we kicked out a bunch more things. So like people did something similar earlier in the times with payment channels.
I call our product pay channels as well because people understand it, but it's more of an specialized L2. So the biggest limiting factor of channels was that it's a short time thing. Bunch of parties need to coordinate together to open something. They need to like have some trust and and they need to close it to get payments and so on. Here none of that.
It's essentially like a specialized L2. There is a hub. There is a sequencer that is always online. Anyone can use it anytime and it just works. So there's no there's no need to open channels, close channel and so on.
All of that is simplified. Wallet pop-ups we replace by session keys. A wallet can just delegate a session key of any cryptography type to basically do transactions on their behalf. So a user doesn't need to like open wallet, click there, enter their password to make sense. It just helps with with with UX a lot.
We also made the crypto swappable to be ready for the for the quantum computing future. Like right now ECDSA curve and so on are not safe by quantum computing, but there are quantum safe crypto techniques. So here we with our specialized architecture because it's an isolated component, the signature verification, you can swap out at any time with a with a component which is quantum safe and you'll be fine. So it's it's very very modular that way. We kicked out public state as well.
Like we realized payments don't need a public state. It's private by default. It's can be made public because like if if I want to make my private state public, I can always make it public, but it's not public by default. It's private by default and then made public by choice. The main thing when building any system in the blockchain space is don't trust, verify.
So what did we do about security? What were the security tradeoffs we had to do to reach the scale of hundreds of millions of payments per second? The short answer is almost no tradeoffs, but there are things worth knowing. So in the cheapest form of this where you are only paying 0.15 per billion transactions, the security is is sort of like DVN based in layer zero.
That is like you have a bunch of verifiers. You can have three, you can have five, you can have 11, whatever you feel comfortable with that will verify each and every payment and sign off on it and only then would it be deemed valid and will be withdrawable on on the on the chain. So this level of security is the practically right choice for most applications. It's practically secure. It's it also the good thing about this is it lets third parties be sure that their payments are safe.
For example, if let's say Visa comes to us and says I want to do a billion transactions per second here, but I cannot trust if the validator run by you and MasterCard is safe. What can I do? You can run a validator as well and we'll make it a mandatory validator. Now a transaction will only go through when Visa themselves are verifying that it is true. So it means that no one needs to trust someone else.
They can just join the verifier queue and they would have trust that if they are right, then the thing is right. They don't need to delegate trust on anyone else. The operator cannot steal funds in this. It's verified by the smart contracts that the signatures are valid and the verifiers have also verified it. You can always withdraw as well.
There is like you can always withdraw at the chain level. It's an L2, so it's an L2 to Polygon. You can always withdraw funds directly from Polygon. If for whatever reason the operator of this specialized L2, whoever it might be, is trying to censor you, you can rage quit. You can run away.
You can do your transaction on Polygon and be safe. If you want even more security, you can add ZK proofs to it. So we benchmarked some of it. They are really they're still very cheap. They're more expensive than not having ZK proofs.
If you assume like so ZK proofs are verified per payer merchant pair in this because as I said, in our architecture, it doesn't matter like what transactions you are doing between a pair. Only the last one, only the final one because it's a cumulative amount is the one that matters. So we only need to generate the ZK proof for the final transaction. If I assume there are 1,000 transactions done in this, you come to a cost of $3 per billion transactions, which is again next to zero. If you assume that every merchant pair is a unique transaction, then it would be about it would be $3 per million transaction, not billion.
But $3 per million transactions is almost zero as well. And this is already possible with ZK. It's only going to get better. To put things in context, like every credit card payment has a minimum of like 20 cents, 30 cents. We are doing a million transactions in in that amount almost.
So yeah, very cheap even if you add ZK. Once you add ZK, you don't need verifiers, although you can add verifiers as well. This would all be verified by the chain to be correct, and the security will be of the polygon validators and the cryptography employed by ZK, not by a bunch of verifiers, even though verifiers are practically secure. So the lessons here is stop making every workload look alike. Try to specialize.
We specialize for payments. This is why we hit the scale. You cannot do DeFi on this. That's the limiting factor, but that's not what it built for. So look at your application and decide what you are actually doing and if you can specialize for that workload to get advantage of it.
So another example of an application that did this very well is Lighter. It specialized their ZK rollup for for just a perp exchange. It has custom circuits, it has no VM. Every trade step is proven. It's it it's much more complex than what we have, so it's harder to explain and understand, but it's the same idea.
It's it's a specialized rollup, specialized for trading, and it does a phenomenal job at it. Like out out of all perp exchanges, it is the one to look at for at least on the technical side. I don't know the other aspects. Hyperliquid might have a lead in metrics and other aspects, but just technically speaking, from an engineer's perspective, Lighter is the best one out there. So huge shout out to those folks.
Now you nothing comes without tradeoffs. You have to choose what you want and you have to give up things and only then you can specialize. So with what we did, we went for high throughput, zero fees, we got privacy, we can add compliance there. The operators and verifier can add like compliance checks and so on. We had modular crypto and so on.
What we give up was synchronous composability in this in other words D5. You cannot do D5 on pay channels like you have to withdraw the funds first only then you can put them in our way. You can't do our way while you are within pay channels. We gave up operator liveliness in the it's a minor thing because it's like almost every L2 has this issue including Arbitrum Optimism base that if the sequencer goes down you can't do transactions directly on the L2. This is the same thing with our model if our sequencer goes down you will not be able to do transactions directly but we added a rage quit feature.
So even if we are down you can get your funds move out and be happy and this is much better protection for our use case because in our chain there is no D5 where you can be liquidated and things like that. It's just money that you can transfer around. If you can withdraw your funds then it's as good as like there's no harm there's no loss. You just withdraw your funds you deposit elsewhere you make transfers elsewhere and you are still fine. So general purpose versus specialized a small comparison table.
General purpose obviously you can run any program specialized it's built for one purpose and only that purpose. If you change your mind later it would be very hard to change your product so only build this when you are very sure what you want to do. Ordering is global in general purpose EVM. In specialized essentially there is no ordering. Per hub is basically the servers we are adding.
The servers need to like basically order within themselves when they post the proof but there is no global ordering it's all maximal parallelism. For confirmations it's for blockchains it's per block that's the fastest. You will only get the confirmation right now it's the fastest actually I have something we are building at Polygon where you can get confirmation even before a block is created but ignoring that the general consensus is that you get transaction confirmation when the block is mined. Can be a fraction of second, but it's that. Uh with our specialized thing, you have almost instant confirmation.
As soon as the hub says I got your transaction, that's it. It's finalized. There's no rollback. There is no um like reorgs. There's nothing like that because there doesn't need to be.
There is no ordering change that needs to happen uh ever because there is no ordering. It's like as soon as your transaction enters the system, it's done. It's finalized. It's happening. Um it scales linearly.
Uh this is the biggest advantage of this architecture um that I can just add more and more and more servers and I can scale my throughput more and more and more. Uh with blockchains, you the more validators you add, the slower you will get. It's the opposite. Uh cost for payment, obviously a big difference. That's why we built this uh crypto in general purpose EVM chains.
Mostly it's fixed, although you can do heavy uh changes to swap this. We built this ground up as a modular thing where you can swap the crypto protocol at any moment and be quantum safe, for example. So basically what's the learning? The one learning you you should take away is basically kick out what you don't need. And this applies across the software industry.
Doesn't matter if you are building a blockchain or a simple computer program. Like if you care about performance, if you care about minimizing your attack surface, if you care about simplicity, if you just care about general hygiene, take out everything you don't need. Uh don't build things that you don't need. Keep it simple. You will build faster software, you will build safer software, and it's the way forward.
So now we'll do some Q&As. Uh let's see if anyone has any questions about scalability, about polygon, about anything else.
Okay, thank you Mundit. Let's take some questions. So the first question is beyond TPS what still makes blockchain payments harder than traditional banking systems?
Yeah, for sure. So banking system is like so for payments in general it's all about the reach basically. Like if I want to pay you and you do not accept my blockchain or my bank payment method or whatever then it's pointless. Like I it's like both people both parties need to agree the medium they want to receive funds. This is the whole purpose Visa and MasterCard is so big because the merchant and the payer both agree to use Visa or MasterCard.
So this is the hardest part for blockchain still like you as the consumer might want to pay with blockchains but the receiver might not accept it. So we need to spread awareness around that as well. We need both parties to be accepting blockchains.
Okay. So the next question I think you addressed this towards the end. Can the confirmation of a payment succeed and then it's not settled because of low balance?
So it can never happen if [snorts] so it really depends on basically like the confirmation initial confirmation that is happening by the hub. If you trust the hub and the verifier it will you will only get the confirmation when there is enough balance. There will never be a scenario where there is not enough balance at the time of settlement. The hub will simply not accept a cumulative voucher of that since. This is basically advantage of using cumulative vouchers that the hub or whoever is accepting the payment doesn't need to track record of every individual payment.
It just tracks record of the highest amount being approved and that's that's what you basically verify as well like this is the maximum amount I'm receiving and it is fulfilled. You can verify that like the hub signs it, the verify signs it in terms and you will be fine. Obviously there is this liveness risk in between that if the hub is malicious, then the confirmation is if the hub and the verifier is malicious, then the confirmation is not worth its dollar. But you have to trust the verifier and the hubs on that.
So the next question is as you add more servers to increase the throughput, does it also require more coordination among the servers?
You can do round robin, you can do whatever. Like if my address starts with 0x max, then I will always go to hub A. If my address starts with 0x like 0DA whatever, I will always go to hub B. This can be deterministically at the client side be decided and traffic can be routed in this way that it is like like every individual server only serving a limited set of customers, a limited set of throughput that it can handle. There is no cross state dependency here.
State of like balance of user A is is on hub A. It does not matter what the state is on hub B. That is why we can have this level of parallelism.
Okay. Let's take one more question. So is it fair to say that you traded throughput in exchange for less decentralization?
So it's less decentralization for the settlement time. Like if I'm settling every block on Polygon, I and I can do that because it's the settlement is just updating a Merkle root on on Polygon. I can make this a primitive of the Polygon validators themselves that they must update the state root of this hub every block. This means that yes, I'm trading of decentralization till this state root is updated. That's just fast finality.
That that is pre-confirmation. Um, that that's the common term. Once the state root is there, it's all on polygon. It's secured by polygon validators. There is no tradeoff in terms of decentralization once the state root is there.
Okay. Uh, that's all for the questions. Let's thank the speaker again.
[music]
Automatic transcript — names and jargon may be misspelled.