Enhancing L2 Security with Sequencer-Level Protection

DeFi Security Summit 2024 · 8 Nov 2024 · 7:02

Phillip Kemper of Zircuit explains sequencer-level security, in which an AI-based oracle checks each transaction before it moves from the queue to the pending queue of a geth-based execution client, and potentially malicious ones get a new quarantine status that never reaches layer one. He argues that L2 sequencers are still centralised, so proactive blocking avoids the alternative of halting block production after a hack. He covers a public dashboard of quarantined transactions, extra RPC calls, risk checks fast enough for a two second block time, scanning L1 deposit transactions, and testing the model against overfitting and real exploits. Zircuit reports more than 400,000 transactions analysed since its August mainnet launch, with no exploits and zero false positives.

Speakers

Topics

From DeFi Security Summit 2024, hosted by DeFi Security Summit.

Transcript

all right all right thank you very much um my name is Philip keer and yeah welcome to my talk where I'm going to inform you about sequencer level protection on layer twos um I'm going to tell you first what sequence level security is then I'm going to tell you why it's important on layer twos finally I'm going to also show you how to is implemented on circuit and I also want to give you some insight from our sorry May net okay let's take one step back first and look at how transactions are flowing

on layer twos you have a an RPC endpoint where users are transacting to um and these transactions are then fored to the sequencer the sequencer is performing validation of these transactions and is then responsible for ordering these transactions it then builds layer two blocks puts them into badges push pushes these badges to layer one where they then have data availability and then they can be verified through a validation mechanism such as fraud proofs or zero knowledge validity proofs well with sequenc level security we take one step back to this step of validation with the validation at the sequencer we have an extra step but we say we make use of an aib based Oracle which tells us is this is this

transaction not only valid is it also safe if it is safe yes we can include it in a layer 2 block if it's not we have a new transaction status which is called the quarantine for potentially malicious transactions the rest of the transaction flow is then the same as with a normal normal rollup the layer one never knows about these quarantine transactions so now as we have explained what is layer sequence level security why is this important and particularly why is this important on layer twos well first of all Layer Two uh bring with it a new ecosystem of new applications the lower fees lower block times lead to new applications and there will be new

vulnerabilities and it's not enough to just check for smart contract uh vulnerabilities with audits so yeah there's there is more issues now and we have to take it up to the infrastructure level to also verify uh the that these transactions are benign additionally there is higher transactions through report as our said hex can be executed faster and it's also harder for the protocols to track it so yeah we want to take it one step further and introduce Security on the sequencer level and finally if you have an exploit well today sequences are still relatively centralized and what has happened on other rollups once there were hacks well one opportunity to protect users is to

actually hold block production however this kind of goes against the principles of decentralization and yeah with sequence level uh security you can proactively prevent hacks and and prevent collateral damages because of this sequence not being halted um yeah the good news is we have this on circuit circuit is not only the first Z roll out built on the op stack it's also the first rup that introduces sequence level security in a main set main net setting and uh how did we implement this well our execution client is is like many others is based on a leading execution client ethereum ecosystem it's based on G what happens with a transaction in G well G maintains

two transaction pools a q and a pending que um and when a transaction arrives in G it will first have some basic validation for example is the signature correct is the rlp encoding correct is the gas limit sufficient and then if it if it has been validated it can go into the pending que the pending Q means also the nons is matching and the fees are good and then it can be included in a layer two block well with sequence level security we introduce an additional validation step between this que and the pending queue which tells us hey we doing a risk assessment of the transaction before being able to include this in a block um yeah so to sum it up it's

placing a transaction in a quarantine which is the new transaction status it means we skip it in process of moving it from the que to pending que and put this transaction on hold um we want to do this in a way that does not prevent a censorship resistance that means we also are being transparent what we quarantine there is a public dashboard where you can see what is quarantined you can see the contents of the transaction you can see why we quarantined it also we have additional RPC calls which tells tell you whether a transaction has been quarantined and what you can do against it um to have effective effective sequencer level security performance is really important on our Network we have a block time of 2

seconds uh this means we have to be able to uh do a risk assessment of transactions very quickly to not degrade the developer experience also it comes at the cost of some computation costs you never want to do the risk assessment of these transactions on the sequencer itself because in terms of high through per you would risk get the sequencer would get halted um another technical detail are deposit transactions you the op stack I don't know if you're familiar with it introduces an opportunity to incl inq transactions via the layer one so we also need to scan those in a in a quick time to ensure they're being included and also scanned for transactions and we also need to record this on the

da so how do you test such an AI based Oracle well it is based on machine learning so you need to have several things in mind you do not want to overfit on P Tex so we introduced an extensive testing Suite with bite code variance and even uh reproduced temporals States smart contract States and also tested on multiple reild exploits to test our machine uh learning Oracle well good thing is this is live more than 400,000 transactions have been analyzed since our menet launch in August so far uh there have not been any exploits and also zero false positives we also aim to be in uh in collaboration with the blockchain security and let

them know if there are for example if we see anything any suspicious activity if you want to learn more about this we have a paper we tell you how to decentralize this also I invite you to read our documentation or talk to me we are live on mnet we are testing this on on real world TX and yeah with that I thank you very much if you want to talk about layer tws or sequence level security or circuit in general come find me around or I also invite you to other events at this conference thank you [Applause]