Off-the-Chain Transactions: Understanding the Layer 2 Landscape

ETHCC 3 · March 2020 · 21:23

Guillaume Felley surveys the Layer 2 landscape and offchain transactions.

Speakers

Topics

From ETHCC 3, hosted by Ethereum France.

Transcript

okay to do no no today what normally but this hey everybody so my name is Guillaume Farah I'm from I'm a developer at liquidity Network and today I'm going to

speak about off chain of chain transactions and more precisely of chain scaling so this talk is based on this this paper from Louis great Don Pedro Moreno Sanchez Tiffany rose Patrick McGorry and our survey so this paper summarizes like the different option and like explain what layer to scaling is about and it's made by solid economics so if you want to go more in depth into what I'm gonna quickly present read this paper alright so yeah blockchain does not scale and yeah let's keep the slide so how can we scale a blockchain right

so you have basically four ways that you can improvement that you can you can improve on the net at the network layer by reducing like latency and bandwidth so that validators can process block faster and therefore blocks any bigger you can tweak the consensus so that some constants do surgeries in my introduce less overhead and therefore you could scale more you can shorten by partitioning the network so here challenge that if you do that you might lose on interoperability and unless you have of chains so of chain is basically delayed on share settlement so all this approach are complementary and yeah I believe if you want

blockchain Ettore scale you can look into all of them you will need all of them in one word one sentence of of chain transaction is a transaction outside of the blockchain but which is still secured by the blockchain why is exciting so basically you just need one unchain transaction to join and one off to introduction to leave the network but in between you can do as many of chain transaction as you want that are completely that are obvious and you don't have any latency and you don't need it pay any fees to the miners and the last but not least you have backward compatibility which means that

you can implement this on block chains like a theorem all right so what of change solution do we have we have basically two two families coming chains and channel networks so yeah let's let's start by looking at channel networks very briefly I will explain how payment channel works but basically so here you have a block here you have a block chain and two parties set up channel together one guy depots one coin into it then you can make a transaction off chain sending point oh five coin to the other guy you are the state you have the state that is now updated the guy on the right as 0.5

now your five and then you can send it back and then somehow this previous state here gonna be invalidated and then you have a new set here and sometime later the channel will be closed and this balance will be this balance would be settled chain all right so now how do you make sure that is gonna be the latest state that is enforce on chain right so this party here might be malicious and wants to submit the on chain and cross the channel with the all state the number one where here's more money than the latest one where he has

less money right so basically do you have a dispute mechanics mechanism so either of the two party can start a dispute and both party will like provide their own evidence and the blockchain will somehow settle dispute and choose which state is the latest and hopefully it will choose the last one all right so this works with like some state replacement methods that you can somehow invalidate the old state and yeah so those are the the four state-by-state replacement methods that you have from the most simple to the most complex so of all the time like the

payment channels I got more complicated so at the beginning you had like simple incentives so one-way channel so in one which other you don't need any dispute resolution mechanism because as a recipient of a transfer you will always submit the latest states unless you are silly and you want to lose money and then we've seen the like the emergence of time locks with the duplex micro payment channel paper and this allow passively for bi-directional payment channels by introducing an expiry time then you are then you are like the revocation state replacements which is the one currently used at the Lightning

Network it uses pre image to basically revoke images and the most recent one is version which I won't get into detail here but you can check onto the paper all right then you have state channels yeah so twos three are like state channels proposals and non-state channels you can do like game voting ocean and so on but like you cannot run arbitrary code like you could do on the EVM number alrightso synchronization so by what I mean by synchronization like to

party might not have like a direct relation between each other so you might need to go through this intermediaries to send a payment and then you forward the payment through this this these two guys in the middle so this is called routing and what you need to achieve that is a simple conditional transfer so this three transfer here needs to up to happen atomically so either all of them either none so there are two techniques to achieve that one is hdl-c so watched at a time lock contract and those allowed to enforce that the payment append atomically and the second approach is one called virtual channels so virtual channels virtual dimensionals

means that you establish a payment channel with joint through your intermediaries so once you set up channel a channel you don't need to talk to in situ the intermediaries anymore to make payments and then you have this network graph you have to keep a record of like all the channels that are open and you hopefully have to route through that you have to advertise your channel and so on so yeah so the good and the bad of the payment channels they are so it requires some collateral and so each of those ups basically increase the amount of collateral that you need for this payment channel and that might be expensive and that make note that makes

it not practical so large payments it's fairly decentralized at least on paper you have strong censorship resistance and you don't need direct connection with everybody that you want to pay and yeah it's optimistic licky fast and cheap meaning that if your counterparty is not malicious and everything goes all right is fast and cheap but you might not be alright so on the other side now we have commit chains so the two most well-known kamichan constructions are noticed and Plasma basically a commit chain the way it works you have a so-called this

server in the middle in the middle here or we call in the operator and you have these users around and this operator regularly periodically commits a constant size checkpoint which is actually a merkel route and yeah the users makes off change transaction by talking to the server after some time there will be a new medical route that updates the state of everybody of everybody here with their transactions and so on and it goes like this until for forever so one important thing is that you have to audit each checkpoint means that you have to look at them that

everything is correct and unsuspected if it's not you need to challenge all right so this looks like a fairly centralized system so it's true that it is interested in noncustodial the operator cannot steal coins or double spend coins or minting coins and yeah and most importantly like the operator cannot prevent you from living this commit chain meaning that if you're happy or if it doesn't work you can just leave without asking anyone's permission what it can do bad is basically censor you preventing you from making transaction

but the way to get around that is basically to fall back onto layer one or to move to a new commit chain that won't do that and that you're happy with so I mentioned there is plus mine noticed so very quickly plasma you have non-functional coins so like in this miracle tree at the leaves or the miracle tree do of like a single coin that you can't split so you have to send like for example one ether or nothing you cannot split them and yeah so the second one which I'm which I'm working on called noticed this is account days which is plasma which actually is UT EXO based and here

you have ang ability so yeah I'll explain a bit oh it work so in so now it's specific to noticed yeah so in August you have this period here between two check point that can be fairly long typically on our current version we do like 36 hours so what that means is that if I make a transaction now maybe I would have to wait a very long period of time before my transaction is actually interested in to the check point and therefore confirmed so that's not quite right I might need to wait 20 hours or up to 30 hour 36 hours for my confirmation and the way that we get around that is that we have we have an

insurance period so that means that we provide a pool of collateral that is used to ensure not yet confirmed payments so what you get out of that is you get basically instant economic finality because if I make a transfer in case something goes wrong into the future with this upcoming check point that my transaction is not included as expected I can tap into this collateral pool and get my money so if I receive one Easter I can go to the collateral pool and take one Easter from there if I'm not if the next checkpoint is incorrect alright and yeah so the collateral is very usable each round so it's fairly efficient and there this way

you get transaction instant transaction finality which is a big improvement over over current user experience that you have with blockchain where you need to wait for transaction confirmation and to be included into a block and so on and so on okay so security properties you might wonder like how is it secure so let's look at some attack scenarios first let's do we have coming chain and it's gonna disappear after some period of time so you have the first the first checkpoint again after 36 hours you have entered transaction in between then one more one more round of a new transaction and then a few more transaction and then

this operator just disappears so what does that mean that means that transaction from 1 to 200 are actually safe because they are committed on chain and users can we throw them at any point in time based on that checkpoint but the transaction from 201 to 230 or not so they are kind of reverted which is bad but there is this insurance pool that users can claim money from to recover ok so now let's look at double spend so we have Bob and Bob Prime and Alice so obviously but Prime on to send 15 so to

Alice and we'll try to send 50 ether to Prime and that does not work and that doesn't work because simply God your pay rate err in the middle that those accountings is that Bob cannot spend his balance twice so we will prevent that so that was easy right so now more interesting like Bob is actually the operator so Bob collude with the operator or he is himself the operator so in this case you a can you can actually double spend and Alice won't notice anything at first but once the check point is submitted she will notice that something is going wrong so

basically the data structure that we are using makes it obvious if like there is any inconsistencies or if the operator is trying to cheat so at least in this case we'll see that there are 50 ether extra in the commit chain that come came out of nowhere so she will open a challenge and the operator will lose this checkpoint will get reverted and she won't lose anything second attack scenario though simply like the operator tries to make an unauthorized transfers so transferring money from Alice without air without our signature so in this case as well Alice

will quickly notice it in the checkpoint and can open a challenge to Weaver that okay so commit chains what are the advantages in the counts recipient can be offline when receiving a transactions so this is kind of nice because like that's what this is the U weeks you X you get out of currents blockchain transaction now but if you look at payment channels for example you somehow need to counter you you're the recipient need to countersign so the recipient needs to be online I cannot send you money if you're not online yeah so with centrist with with

Commission's you get limited decentralization that is from an architectural perspective and therefore limited censorship resistance because you have this one single node yeah so it's fairly collateral efficient you are instant and free and boarding so this instant of broadening means that I don't need to make an untrained transaction to join the network therefore here it improves it improves also on the user experience and last you have data availability challenges I haven't touched on that but you you as similar to other blockchain protocol you have to

monitor a chain and react based on if something goes wrong and here it's about data availability if like you're missing data to audit your chain you will have to to to open a challenge to force the operator to release the data even though there might be nothing wrong so quickly you can do arbitrary smart contract on a common chain like but we've implemented token swap so basically we stock and swap it's like the primitive you need to build an exchange and yes so I click we network we've built text that is based actually

on Locust and it is now on that's net if you want to try out just go on this link all right that's it so if you have any question or yeah happy to two minutes two minutes yeah thanks for so I guess the yes okay paper was like this kind of overview yeah that's great can you go a couple slides back like I'm thinking because I've been mmm no no actually actually yeah the one with good and bad of the

comité chains yeah yeah this one so yeah I've been thinking mmm yeah spent some time building this kind of commit chain lately and and the I'm thinking if it has the same problems like these bad things it has this feature that mmm kind of similar to a theorem anyone can be like the validators kind of replicate the work of those who off the operator right so you

know what validator is all right right so yeah well I mean I guess you could compare it to mining right but anyone who wants to check that the state is actually correct yep and in that sense you could swap the operator for somebody else and I'm thinking does that ameliorate the centralization and censorship resistance because in some sense you can if you can do the operators work or replicate the operators work then I guess so yeah so like I think the I didn't mention it but like the operator is a single person he has his own private key pair and it cannot be anyone that just do the work of the operator it

has to be one single party yeah no well I mean it's in our construction it is replicatable but yeah of course that comes with a trade-off so yeah so yeah like you could have several operators but it becomes very tricky because of data availability so you have to make sure that the guy that want to validate and to create checkpoints as all the data of all the accounts otherwise you can't and you could also like game that the users who like somehow take the the Commission down by withholding data therefore making the operator unable to make a checkpoint in certain right

because the transaction happen off change so by definition you don't know what happens okay so I guess thank you [Applause]