Raiden: Scaling Out With Offchain State Networks

Devcon 1 · November 2015 · 17:45

Heiko Hees introduces Raiden and its use of offchain state channels to scale token transfers on Ethereum.

Speakers

Topics

From Devcon 1, hosted by Ethereum Foundation.

Transcript

hello oh you're tired okay I'll try to keep it short rather get for a high-level overview about what we're doing so you heard a lot about open problems we have especially scalability we've been talking about this today already you might know that for example visa just about 50000 standard transactions peak per second and we don't come closer transaction penalty is some nice property and many are worried about transaction privacy so we thought about

could we solve these problems if he'd changed the model if we rather have transactions in private between the participants who are involved in transactions but do not put them on the blockchain not to the public ledger but rather use the blockchain just to resolve disputes and to take things in escrow so that's what rain Network tries to inform it's enough chain asset transfer network it's quite similar to the Bitcoin lightning Network proposal and this is work in progress so the features shall be to be to internal circuit should work with any token which

supports the standardized token API which we tell it defined while ago it should support instant asset transfers so you should not wait for confirmations for say five blocks but they should really be instant support should support micropayments this only works if the transaction fees are way lower than the values you want to transfer and it should really scale out to basically I'm at unlimited number of transfers per second and we're looking for transaction privacy so how does this work in order to understand this you need to really understand how a payment channel works

so I try to explain this in the payment channel you would use that if one party say Alice wants to pay Bob multiple times and she doesn't want to see all those transactions on the blockchain but rather opens a payment channel on the blockchain and payment channel would know the address of the receiver that would be Bob and address of the initiator that would be Alice and also it would take an escrow deposit from Alice what Alice then can do is whenever Bob sells something to her she can sign an updated balance so the first balance might be I signed one say Jeff coin for Bob and later in the day she would sign

a second gift card to Bob now Bob can at any time go to the blockchain and claim to gift coins because Alice signed them and well he would make sure that he will not accept signed balances which are higher than the deposit which is on Shane but otherwise he can always be sure if he gets off shyness on transaction that he will be able to claim this on change to gender studies because that's important yeah okay so this is also simple pension we also can have bi-directional para channels

it's a nice feature about bi-directional pensioners is that safety f10 if both parties deposit ten coins on chain they could have updated balances which are higher than ten for example if Ellis sent nine coins to Bob but Bob sent five coins to Alice then she could still send another six coins to Bob so the balance that she would signed would be sixteen right so if you have transfer switch gear in both directions you can for a long lasting channel you can send things back and forth and so again you can settle this on chain any of the

partisans of Alice to Bob can post get Unchained and settle this anytime the requirement to settle being able to settle this at any time is because one of the parties could vanish they could not respond anymore so if we have pirates and shallots we can change channels so say Alice wants to pay Dave but does not yet have for payment channel to Dave then she could ask Bob and Charlie to help to transfer payments to Dave so questions why wouldn't she have her payment channel stay at the first place that is you remember we have to deposit something on trains if you walk through water and have to do multiple payments or many

payments every day then you don't want to have a pension on this every receiver of the payments so therefore she can ask Bob and Charlie to cooperate they might do so if you offer them a small fee and how do we solve that Bob or Charlie do not run away with the transfer which we were signed by Alice but she'll actually go to Dave we do that by using a technique called hash log a hash luck is when Ellis comes up with a random secret which he does not yet share with the other participants and the smart contract on sharing will only settle the transfer if one also provides the secret

for the hash log the hash lock is the hash of the secret so you can publish the hash lock but you will not be able to compute the secret so now Ellis would sign the transfer to Bob which is hash locked and Bob to Charlie which is hash locked those would deduce a small fee and finally Dave might get a signed signature by Charlie which is still hash locked so none of them can claim anything unchanged from these transfers but then Dave could tell Alice hey I received a signal signed talents update from Dave which is hash lock would you tell me the secret so I can show you the webpage of whatever Alice wants to buy from Dave and Alice will eventually

reveal the secret and now Dave can claim those pants on Shane by providing the signed balance update from Charlie and which is hash lock but he would know the secret so does the there's my contract would hash Disick the liquid and put check if that's the same as the hash lock and then Dave can claim on the updated balance transfer and same because then it's on chain same so Charlie and Bob at latest at this time would learn also the secret and all secured claim adapted it balances so there's no trust involved so far right

and all those transactions have been off chain and they probably will stay off chain except if one of these parties becomes unresponsive so if we have change channels we can think about a network of channels if you have a contract which lists all the payment channels then we can derive the network graph from all the payment channels so we can basically find for any two participants a route through the network that would allow us to transfer our values through the network and as we learned those transfers cancel out on average or okay yeah and unchanged that

limit is infrequent because there's no need to settle except if someone uncooperative and break self does not provide the secret and so those transactions which are offed off chain they are cheaper they're instant because you don't have to wait wait for any confirmations and we still have no counterparty risk so this really works and there's maybe something important to notice there might be highly connected hubs if that's implemented because highly connected apps they offer the advantage that you have shorter routes between two participants and there's a

motivation to run these subs because you can earn transaction fees so in this decentralized network there might be some points of centralization but which are not necessary and they will have a lot of competition now if we have this in place then something we get basically for free is decentralized exchange how that works is precondition is that you have two different assets and pensions for two different assets and then you could for example broadcast an exchange in chance say I want to i offer ten of asset a and want to exchange this for three of SP and then somehow this would be broadcasted to those interested

in this kind of exchange and the initially I initiator might get some offers two exchanges and would acknowledge the other party that one of those parties that Chris and then what you would do is we would have two transfers one of us at a safe from Alice three to eight today and one from Dave to Alice for SSB and they would use the same hash lock and if they used the same hash lock then either none of or both of those transfers execute so there's still no risk there's no central party and you can be sure that this option as a

transfer of chain asset exchange just works okay okay and then we're talking about etherium so there's a bonus we can lock these transfers to unchain conditions this is similar like an acid exchange but we would lock one of those transfers the second one also to condition on the chain and well we would not write the complete condition but just provide a hash of it and you can see let's say let's look at examples say off chain betting would say Alice could say I

transfer of the same asset now let's say that's u.s. dollar coins Alice would give ten coins to Bob to Dave if Dave transfers a hundred coins to Ellis in the case that you're certain condition on chain is true for example that an Oracle confirmed that Lauren's blessing one in the next elections or something similar is of chain option through kind of options Alice would give ten today if Dave gives 100 to Alice if a certain condition on ten is true in this case

it's the price of for example US dollar to e theorem to ether would be ten at a certain block and this can be generalized but you basically lock something with code and data so you can create pretty complex of chain agreements which could be settled on chain they don't have to usually date will not be set launching because every participant will can evaluate for themselves what would happen if she's at Lamont chain okay so if you compare this to the Lightning Network um I think the the implementation is easier because in a theorem we have accounts and we have DBM there's an issue if someone does not

provide the secret for hash lock then a channel becomes stale this is something which I might explain later something we can mitigate also very good and then we can if you think about the deposit on the pair mention of like a prepaid account if we can add more funds to that channel if you want to and then of course it works just any token and we have this smart contract interoperability so all we get from this is instant as a transfers really they'll cross transaction costs we can't scale out transaction capacity or at least

asset transfer capacity we have transaction privacy because you remember just machine transactions are only known to those involved that might be two or more parties the hops along the plants the transfer we get truly decentralized after the change for free we have no central auto book we have no mentioning engine and we can have pretty complex option agreements so status of your project the current version of aetherium brings everything we need to implement this so there are no protocol updates needed this is currently working progress in our company we have shown that we can

have 500 transfers on a standard notebook per second and so you can imagine you can scale this out to two more transfers if you add more notes well help us welcome in the project and the code is available on github what's fastest right if you like your 5 minutes for questions it's okay it has it questions okay you're regarding the anonymity part yeah

so transactions in a payment channels would not be public but wouldn't the actual payment channel be on chain they will be public but they not necessarily correspond to whom you're actually transacting with on off chain so they would go by a sum payment sir so they would if you do direct person-to-person payments on of them be visible but if you go through some payments hub yeah so have you thought about general transaction obtaining contract States as

si si version like you can have a payment channel that is the you know you're playing a game or something and it's all off chain until one person leaves and then the other person can can basically submit the dream of the state the state of the game to the chain have you thought anything about those things yeah what you might need to do here is that you need to replay all the transition steps you have on chain which is a lot of data on which will be very expensive on seeing what we have here's more we only have updated balances so you would not settle the whole transaction history but only the last

updated balance which is probably cheaper so if the game is decided this decides in a way that you only need the last state invalidate that then that would be possible - can you elaborate on how it's possible that payment channel does not get stale if secret is not published yep short answer mirco trees instead of having the hash lock in the updated balance we have a merkel route which is like a fingerprint of all pending transfers so you can have interval from asset transfers

all right thank you