Why meta-transactions in ETH 1.0 suck and what we can do about it
ETHCC 3 · March 2020 · 22:59
Patrick McCorry examines shortcomings of meta-transactions in Ethereum 1.0 and considers how they could be addressed.
Speakers
Topics
From ETHCC 3, hosted by Ethereum France.
Transcript
we won I'm so sorry for not being there hi everyone I'm so sorry for not being there today I've decided not to come because of the corona virus but I'm glad everyone's there and I'm hope people can actually know listen to this talk and enjoy it so what I want to talk about today is basically why mana transactions and each one point of a suck and what can we do about it some contact is that we've been building this service called any dot sender for the past six months
the very straightforward idea we provide a very simple API the user will send a meta transaction give it to us our only job is to guarantee this blocking or this meta transaction gets in the blockchain before a block deadline and the user will get a signed receipt that promises that we will do it so we use meta transaction under the hood that's what I want to highlight is that one I'm gonna go through why I fear transactions are painful - how does any descender work and three some of the really awkward quirks that pop up you know when we try to use meta transactions and how we've done our best to minimize any of the quirks and finally what we should do an F 1 point 2 or e 2.0 the MiG meta
transactions a native primitive so let's just get started why are transactions painful so first we are pulled involved is little key feeling I'm Bob wants the wood in a doubt because we all love dowels nowadays you know they're all the rage so the baby is going to create a nathie returns action where they want to vote yes they'll broadcast out to the etherium network it will eventually get picked up by miners they link you know they'll be in the pending cold they'll take the transaction out put it in their blog and they'll confirm the B of each transaction so it's a very straightforward process and how you can put in the Dow and I assume everyone here is probably aware how that works so let's look for some of the problems that are may arise for a
little Bob when they interact on the theory the first problem is that the etherium network enforces that all transactions are accepted in order so if you broadcast three transactions transaction ten transaction 11 on transaction 20 the announces in the replay protection was always increment by one so in this example transaction 10 can be accepted transaction 11 can be accepted but transaction 20 well you know there's 12 13 14 15 esto needs to be accepted so Trent transaction 20 else's get dropped and it cannot be confirmed on the network and that's really annoying for ball or the user because the user now
has to be careful but announced they select so the second problem is what do the user wants to send transactions out of order and bypasses network rule maybe they want to prove says 1,000 of drawls and they don't really care what order they're processed it to do that the user has to sign them from n different signing keys and that's really frustrating problem 3 ba transaction fee management so again all transactions have to be accepted in the network in order so transaction 10 has a really low fee in this example five Kiwi miners are only accepting transactions with tanguay we or more then transaction 10 will get in transaction 11 won't get in on
transaction 12 won't get it the usual have to notice this Andry bump the fee per transaction 10 before any transaction completed problem before one look transaction Tangis gets dropped by the network the network congested there's a cryptic any event transaction tandas drops from the network and the panning pool that's the key is that a Gihon transaction 11 transaction 12 conquered in the blockchain and the user has to republish transaction 10 and that's quite beautiful and finally the last problem is what if the user has broadcast 100 transactions and then the relays crop high priority transaction at a half I think what the user gets comes
actually up to the only other solution is that the user has to reorganize all the painting transaction but the fee of all the pending transactions and include this priority at the top of the queue I'm not held to do you know you know you never want to do that because there's so many terrible risk conditions there's a mess up all of your transaction logic so that sounds really annoying but surely these problems are academic and I'm you know I'm just making all this up well Taylor put up this fantastic tweet storm last week that really highlights some of these problems so she's talking about the simple story from 2018 with the crypto kitty boo the first thing she highlights is that the network was
congested and some transactions were being dropped from the pending core that's problem for if transaction Tang gets dropped then none of your other transactions in the queue can get accepted so you have to republish it I'm not so annoying from a business perspective but of course Taylor and some others were in a telegram group or maybe that's a skype group I don't know with some exchanges when these exchanges are sending five transactions a second at their peak now what they do mention is that is problem three they send a cure transactions one has a very low fee and it stops the risk getting in what do you do in that scenario well what someone in the chiraq
commanded was exchanges 250gb is a gas price and that's definitely gonna get in everyone else's fees a hundred kiwis if you choose a 250gb they'll resolve all of your stock transaction issues now that's pretty annoying these if they overpay don't know what everyone else is paying me a huge transaction gets in but actually exchange do that today still you know twenty twenty buying out dragula plans for TGV and who've even has 25 kiwi because they don't want stock transactions you know today you know the pant eggie we and you'll definitely get your transaction in there can forty Kiwi justly avoid the off chance that there's congestion on their transactions in stock now Nick Johnson
was in the chat and everyone just people realized that actually a part of this congestion problem was a plugin go etherium around Fiesta mission so Nick the bug he released the new version of goofy reham and he recommended the exchanges download this new version of aetherium but for exchanges that's way too risky because one the running parody so now they've got a swapping to go aetherium and of them a screw up in these five minutes it's gonna cost twelve to twenty four hour worth of issues for them so it's way too high-risk for them there's a spot they're doing in between so in this short story know why it's still a better story than twilight there's so many stories like this around dealing with etherium transactions
there's loads of examples of high congestion in 2019 with defy issues you know there's issues that were delayed because of the cryptic current the crypto kitty congestion one hundred thousand tons actually get stuck last year when tether joined the network when you have these crazy gambling games like fair would use a fifty percent of all gas on the network and I actually was also annoying is that some of these transactions are time critical so deep my savor their whole purpose is to see if CDP's for their users for the most part they do an excellent job and they're still running today but sometime last year they had an issue with their transaction infrastructure so they send some transactions out one of the
transactions have a low fee except all the other transactions getting in because of this some of the CDP's got liquid in it and they feel the protected customers so they had to refund the customers out of pocket they actually that was a financial loss because standing transact is to a theorem is beautiful on the mother of all examples is this one from an ICU in 2017 where the dude paid seven hundred seventy one thousand dollars on a transaction fee on the execution field we didn't get in the ICO the execution field then he still paid seventy one care I mean that's just crazy he needs an intermediary the stuff I'm studying transactions so the whole point here is that dealing with transacted on
a theorem is painful and lead to a bad user experience and in the worst key is a loss of funds and I believe Metatron's actions can make this so so so so so much better what is the matter transaction or meta transaction is basically where the user will pre authorize a command they say I care about this contract care about this function here's my sign command please get this in the blockchain and get this command executed my meta transactions are typically associated with a godless godless transaction but I think there's so much way useful than just a single use kiss and hopefully I'm going to show why now so the key point is that the user will authorize a meta
transaction give it to your relayer and that really our only job is to get that in the blockchain ASAP so what the relay will do is get the Metatron's action stick it in their theorem transaction bra constant in the network bump the fee and it will eventually get accepted this is exactly what we've built with any descender the first philosophy accountable API we have a very simple API user gives us a meta transaction and we guarantee it gets in the function so how does this work let's go through a step by step step one the user has to have a balance on the service the usual simply deposit eat into relayed outsole and the registration process is now complete
very simple on chain deposit by simple registration process to the user can I send jobs any dot sender and get a signed receipt in return so they'll give her the same meta transaction will return a signed receipt and thus and receiver prey must promise the tracks the transaction will be delivered by block 100 ok understand by Anita sender on step 3 sit back and watch as any does sender delivers his matter transactions while hopping under the hood and he does send it with real and bump the feet he'll eventually get accepted it'll first get processed by reading so I'll record a log and then sign up the command to be
executed in the users contract if there's a good service everything's good I know everyone's really helping but if any does send a provider lousy service then the user has up to three months the sin is signed receipt to a contract called the adjudicator the adjudicator will get the sign receipt look at the on chin logs and say oh I need no sender didn't actually really the transaction if so then any doubt sender must compensate the user a pre agreed amount in a timely manner and if any nos sender doesn't then a security deposit with us they could be ten thousand dollars will simply be sloshed and they lose their you know their skin
in the game I'm not sexy what's really cool about I need a sender Annie does sender is a skin in the game service is noncustodial it only relays pre-authorized transactions it deals of queue management it deals a pumping fees and if it doesn't deliver as promised quality a service you get compensated or we get sloshed so there's own chain deposit there really you know demonstrate our commitment to doing this job now while we were designing any descender we focused on four different properties first minimal intrusiveness we don't want people to modify their smart contracts and use our service and we've tried to minimize that it muscles become too you want to be environmentally friendly we do want to have a negative impact on the network stick to three
sorry we want to be much better than aetherium today and we want to support out of order transactions we have some really cool replay protection to do that I'm finally fair payments the reader should really take on new risk when real in this transaction the reader should always get paid for the job so now that I've spoken about why transactions are painful on aetherium and how I need a sender works well let's talk about some of the gotchas with meta transactions mean this applies for all meta transaction green layers and not just us but it's really important to bring up its let the fun begin the biggest issue is message out sender why is that so if you remember we get a meta transaction we stick it in a
etherium transaction and we broadcast that to the network so the DUP cannot use message that sender immediately these men these are sender they'll get our address they won't get the users address pretty annoying so how do we get around that problem would approach is to modify that the smart contract near the top so we'll check the user signature that's the signage address and then use that the check and this voter is registered than but can you see a problem there the problems replay protection there's no replay protection whatsoever second people you just met a transaction and really it is several times to the network and I'll get process every time
for example it's fine but this is like a financial contract in your real and transfers withdrawals that's huge risk because I can keep sending Bob one coin by replaying this meta transaction so now what you would have to do is modify the contract verify the user signature and force replay port action and then execute the command I'm not pretty damn invasive you know we want to try to avoid this and mustn't talk so the easiest way to avoid it is to have a simple proxy contract in the middle so we the Metatron's accent go by the proxy contract it'll check the signature check the replay protection and then call out to the top and the improve sassing the command and now you
can use message that standard because it's a proxy across and a bunch of projects have already done this business fantastic when we can reuse a lot of that out of the box for ourselves now you may think as a top developer well I like Messi's a sender but I also want to support signers dresses you know I can use magic dust and directives use the signage address I don't care that's a really easy way to do that there is a way that do it is proposed by the GSN as a little bit hacking so let's talk about it yeah so what happens is that the account proxy so we'll send the command again the Metatron's action by the proxy the proxy will calm out with the data and the command but it will also append 20 bytes which is the sign of dress and
I'll get sent to the dot interestingly the duck will not process this issue is Messi's on sender why is
that so we remembered we get a meta transaction we stick it in a theorem transaction and we broadcast that to the network so the DUP cannot use message sender immediately these maybes our sender they'll get our address they won't get the users address that's pretty annoying so how do we get around that problem what approach is to modify that the smart contract near the top so we will check the user signature that's the standard address and then use that the check and this voter is registered them but can you see a problem there the problems replay protection there's no replay protection whatsoever second pick the users meta transaction and really it
is several times to the network and I'll get process every time for our example it's fine but this is like a financial contract in your reel and transfers withdrawals that's huge risk because I can keep sending Bob one coin by read replaying this meta transaction so now what you would have to do is modify the contract verify the user signature enforce replay protection and then executed I'm not pretty dumb invasive you know we want to try to avoid this in muscles in time so the easiest way to avoid it is to have a simple proxy contract in the middle so we the meta transaction go bad and proxy contract it will check the signature check the replay protection and then
called out to the top and then prove sassy the command and now you can use message that's tender because it's a proxy account and a bunch of products have already done this business fantastic and we can reuse a lot of that out of the box for ourselves now you may think as a top developer well I like messy the sender but I also want to support signers dresses you know I can use message does San directors use the signage address I don't care there's a really easy way to do that there is a way that do it is proposed by the DSN as a little bit hacking so let's talk about it okay so what happens is that the account proxy so we'll send the command in the meta transactions by the proxy the proxy were called out with the data
and the command but it will also append 20 bytes this is the sign of stress and August sent to the dump interestingly the dump will not process verify the user signature enforce replay
protection and then execute the command I'm not pretty damn invasive you know we want to try to avoid this in muscles in time so the easiest way to avoid it is to have a simple proxy contract in the middle so we the Metatron's accent we've added proxy contract it will check the signature check the replay protection and then call out to the top and the improve sassing the command and now you can use message that standard because it's a proxy across and a bunch of projects have already done this business fantastic when we can reuse a lot of that out of the box for ourselves now you may think as a top developer well I like Messi's ascender but I also want to support signers dressage now I can use magic dust and directives use the
signage address I don't care there's a really easy way to do that there is a way that do it is proposed by the DSN as a little bit hacking sighs talk about it okay so what happens is that the account proxy so we'll send the command again the Metatron's action by the proxy the proxy will call out with the data in the command but it will also penned 20 bytes which is the sign of stress on August sent to the doctor increasingly the doc will not process okay because yeah do I not be
yeah I think so too so it's all we are you