EB106 – Christian Decker: Scaling Bitcoin With Duplex Micropayment Channels

23 Nov 2015 · 1:07:45

Christian Decker, a Bitcoin researcher and PhD candidate at ETH Zurich, joins Epicenter to discuss the Bitcoin block size debate and his proposal for Duplex Micropayment Channels. The conversation covers how payment channels enable cheap, instant off-chain transactions, the privacy trade-offs between Duplex Channels and the Lightning Network, and whether similar off-chain scaling could work on Ethereum.

Speakers

Topics

Transcript

[Music] this episode of epicenter Bitcoin is brought to you by shapeshift with no account or sign up required it's the easiest way to buy and sell gems counterparty Dogecoin Dash and other leading cryptocurrencies go to shapeshift.io to instantly convert your altcoins and to discover the future of cryptocurrency exchange welcome to epicenter Bitcoin the show which talks about the Technologies projects and startups driving decentralization in the global cryptocurrency Revolution my name is

Brian Fabian Crane and I'm mahoy today we are joined by Christian deer who is a researcher at e Zurich he has he has a very interesting idea about scaling Bitcoin using offchain networks first we would like to have an introduction from you Christian yeah hi thanks for having me I'm uh as you said I'm a researcher at eth Zurich I am also one of the early adopters of Bitcoin you you can say I started in 20 2009 uh a few weeks after the original paper and I thought heck that's that's a nice thing I would like to try that and uh later when it came time to choose a

topic for my PG I didn't have to look too hard to basic basically say hey Bitcoin might be a good topic took some time to uh to convince my professor but in the end it turned out to be the greatest topic he had for a long time wow I I didn't realize it was 2009 cuz I don't know actually who's the person we've had on the show who was earliest involved in Bitcoin so I guess Mike Kar was he 2009 or 2010 Gavin andreon was 2010 I guess no I'm not sure we had we actually had a uh the the first Zurich Bitcoin Meetup was in 2011 with Mike Hearn and uh Stefan

Tomas from uh from today's Ripple right so uh that was that was that's quite amazing how how far we got uh with with Bitcoin and uh similar Technologies uh that was that was an interesting meeting back then yeah so you've been interested in the topic sort of Contin ly since then yeah yeah I I would say I I I have been I I have been following Bitcoin for a long time uh I think my first involvement was trying to reverse engineer the protocol part of the protocol specification or documentation as it's called today uh is uh was made by me and one other guy I guess um and

uh yeah we I was I was in evolved quite a long time um and I just stopped mining a few days ago after six and a half years yeah that kind of hurt so you were you had what like butterfly Labs or or K&C equipment and they were running that at home I had one one of the first edition jalapenos uh and uh yeah that that stuck with me for a long time and now it was time to shut it off because it it's not worth it anymore cool that's that's fascinating actually I didn't I didn't realize you had been such an early adopter and so

deeply involved for such a long time I guess it it was just just lucky and yeah it it also brought me some some headlines when uh in 2012 9,000 Bitcoins were stolen from my wallet so from your wallet yeah I actually I actually managed to lose 9,000 Bitcoins to a hacker and but it got me on the on the on the front page of the New York Times so wow you would have have been a millionaire with with that stash uh yeah so so people keep telling me yeah I personally I don't know if if I would have paid 9,000 uh Bitcoins to

be on the front page of the New York Times but I I mean that that's one of the perks of being an early adopter right you you somehow mined all these coins and uh uh you didn't invest anything and and then you lost them and so yeah it's like you lost a lottery ticket but one that actually won so actually that makes it particularly interesting no because we have talked about this topic again and again and we keep coming back to it which is the sort of topic of uh scaling Bitcoin and and one of your ideas that we we'll talk about in a little bit does relate to that but I'm sure you as someone who's

sort of you know been through that whole history you have a lot of opinions on that in general so how have you how have you been participating and and and thinking about you know this debate and controversy and arguments that are going on about you know the block size increase and how Bitcoin can be scaled yeah I mean the uh the the whole topic of of the blockchain block size increase is uh less of a technical problem I I have to say it's it's more about uh economics and incentives um and it also strongly depends on on what we want to we want to achieve with this with this network um I

mean in my first publication I basically showed that there are some natural limits to how many transactions can uh the the network can support and that was three years ago um and uh I I basically used that as a starting off point uh for for the REM remainder of my research um but the limits were a lot higher than what we are talking uh talking about today which is one or two or eight megabytes uh I don't have the current numbers but I I would I would believe that that we can support 16 megabyte blocks without uh too many problems um that's that's a natural

limit I'd say at at that point the network just isn't fast enough to propagate the block uh through the network so that the majority knows about this block before a new block being found in the remainder of the network um that being said we have some lower limits uh which are uh of an economical nature um meaning that at some point it just becomes unfeasible for people to participate in this network um I'm definitely not an expert on on those kind of issues but uh I would I would say we can definitely support uh support slightly larger blocks today so so this

one is this so This higher limit of you're saying 16 MB is does it come through through your paper uh information propagation in the Bitcoin Network yes that's that's exactly the the uh the publication was talking about that's basically us trying to point out the natural limits of what the network can support and we thought we could analyze how blockchain Forex came to be and then take the the blockchain Forex as an sort of uh um a symptom of of not being able to reconcile the the global state of of the Network anymore

um and we have found that larger blocks also uh lead to a slower propagation in the network no not much of a surprise there uh but we have a few numbers in there as well namely that at the at the time about 1 kilobyte of extra data was would result in the median time of uh node noticing a block was delayed by 80 milliseconds so that is probably faster today um and we do have a new publication coming out hopefully uh sometime soon uh which actually shows that there has been an improvement over

time um but uh it it it Still Remains the the the problem that we cannot uh we we cannot scale too quickly uh to to larger block sizes so let's get like an on the ground feel for this for this number so what you're saying is if you add 1 kilobyte to the block uh the the median propagation time increases by 80 milliseconds so that means if you had one one MB to the block uh it uh it would affect the median propagation Time by 80 Seconds right mhm so um so basically that was back then I have to say so back that was back then so so so let's say let's let's just just to see

um just as a thought experiment let's say that that number held true today uh so what when you go from say um 1 MB to 10 MB so you are adding N9 more MBS uh then the the median propagation time would be say impacted uh 9 times into 80 so that's like 7 720 uh 720 seconds right so that is over over 10 minutes yeah uh what and 10 minutes is the block time for Bitcoin what would happen happen if one block needs more than 10 minutes to propagate to the network what would happen to the network in that scenario so our expectation is that uh the the first block would basically

split the network in half because the by the time we have reached a majority of of the network we already have a second block propagating through the network um or we have an expectation one block propagating in the network already um so that that way we would definitely create a hard uh a blockchain fork um now the resulting network is smaller so the the two partitions of the network are smaller but they will work on indep on on uh competing blockchain Forks right um now it is possible that we uh that we then lose that that we

then find another Block in one of these partitions and and find again uh another Block in this partition at this point we have a three-headed uh uh blockchain fork and this we uh this this will not be resolved in in a um in in in a single next round of of blocks being found right so what we what we actually lose is one confirmation on the uh on the uh on the number of confirmations we have to a wait for for us to be certain that the transaction goes through and the extreme case is that we actually Fork off

indefinitely yeah so so basically you start having uh but let let's say if you take the if you take this skillus back a little bit we say okay it's not 720 seconds so you know 12 minutes but let's say it's 4 minutes that it takes to propagate then we are still left with a scenario that there are a lot of forks all the time and they go deeper than just you know one block they can have you know two blocks deep or maybe even three in a worst Casa in a in a bad case so you start having a very probably behaviors that you don't want so so I mean the the the the one

thing we will have for sure is that we lose certainty into what this being confirmed in a in a transaction actually means uh today we can be reasonably sure that if if my transaction ends up in in a block then that means that yes it it is being confirmed right uh today's blockchain Fork rate is about 1.5% uh meaning that we have about two and a half Forks every day um if we if we go uh if if we have this uh this sort of higher Fork rate then we suddenly lose this this certainty and and we need more

confirmations for us to regain this certainty on the other dimension we have now a lot of computational resources being spent in a network to work on Forks which are eventually going to be orphaned and that might be even the the the the the scenario which is worse because now uh we are having this huge number number of fights between mining pools and lots of resources being being wasted and we actually facilitate a large minor who might not have 50% or more uh suddenly he needs much less he has to fight only against uh against other pools that are that suffer this

delay in propagation while he doesn't have have to so this this all plays into into sort of selfish mining again which uh which gets easier if you have a high uh blockchain for rate so uh so in ESS sense what you're saying is um let's assume that 60% of the mining power is in China and then 40% is in the United States just just just quite simply so what you're saying is be uh because a block made in China needs a lot of time to propagate to a block made in the United States the 60% of the miners in China because they hear about the blocks earlier as a cartel they can they can come to a situation

where they keep dominating the American miners um every time and uh effectively in order to get like 51% of the network you just have to be in China Chinese minor and have more than half of their 60% which is like 30% and like your effective power in the network is like a 51% minor because you can always outco compete the American ones due to the block propagation problem yes you are with with the by adding delay into into the into the uh propagation then you you are basically weakening the remainder of the network compared to the block finder so we we don't need to go as far as saying hey

this is China and this is this is uh the rest of the world we just need to say this is we we have a group here which is strongly connected with really really fast connections and the the next block is being found in this cluster and then we have a weekly connected other cluster and the we and the cluster which has not found the block will be at a disadvantage over the cluster that has found the block because they will hear it later right I mean I think that's that's why uh you know the episode we Mayer and did on Pon NG I thought is such a nice uh such a nice proposal no because just

gets rid of so many of these problems yeah you you resolve quite a quite a lot of of the of the races there uh it's uh it's uh it's a really interesting proposal and uh uh IM Guna one of the authors will be present at my defense later in January so I I hope I get to talk to him about that proposal as well and see what we can do with it so defense of course being for your PhD thesis cuz you're doing a PhD thesis about Bitcoin at the moment yeah so talking about PhD thesis I think perhaps this is a good uh a good segue to to talk about your research and uh

the one project that I think you are known for that has some attention in in is is your duplex Network and duplex being essentially uh like the lightning Network which I think a lot of people know and and you know we've done a show about as well so can you talk a bit about how you came to work on that so we we had some research before that concentrating on on how to extract application data from blockchain from the Bitcoin blockchain and once we finish that we noticed that there is uh a possibility to to actually scale up the number of transactions that uh that the current blockchain can

support but Simply Having moving all of these transfers off the blockchain um and uh we then started we we basically took uh the uh the simple microp payment Channel which is implemented in uh which was implemented by Mike Hearn uh into uh Bitcoin J and which we had used before and thought okay that there's there's a there's a limitation there uh we can we lock in funds into this channel and uh we can transfer it at most once from one end to the other simply because well there is no way to move this these coins back uh so what we thought we

would uh we would like to do is to Simply have uh construction where we can send money both ways hence the duplex in in the title um and we use we use the construction which uh which starts creating two simple micro payment Channel network uh two simple micro payment channels between two peers one going in One Direction and the other one going in the other direction now the problem is that I mean if you charge these channels uh on on both ends with one Bitcoin and you send one Bitcoin in One Direction and the other Bitcoin in the other direction then there is the

this guy still has uh some some credit on uh on these construction of two channels but it's on a wrong Channel he cannot send it back to this so what we tried to do is basically just take these sets or these pairs of of uh simple microp payment channels flip them over and now having credit back on the channel That that you can actually spend from um that took a bit more uh more of a detour than we were planning to but in the end we had a uh I would say really nice and really clean construction that that actually achieved this um having two simple microp payment channels which can be reset uh if the capacity on one

of them is consumed and you'd like to transfer capacity from one to the other so so maybe just to give a little bit of background because I'm sure some people will will not be familiar with payment channels and basically the idea is as far as I understand it and of course feel free to correct me is that right you say on bitcoin the the number of transactions is sort of limited but what you can do is you can sort of lock up Bitcoins or you can sort of put them in a multisig address that you know only several people can spend together and then you sort of go offline and you send each other um signed transactions so you can basically move

money around and you still can do it securely because uh the person can sort of go back to the Bitcoin Network to sort of claim their money but uh while you're moving these transactions around well you don't actually have to you know you don't have to wait for confirmations you don't have to put them in the block right so you you can sort of have your cake and E it too in terms that you have the security of the blockchain but you don't have all the downsides of it such as you know uh limits and to costs and to speed but you can you can do it immediately and um much cheaper much faster so yeah the the um basically the microp payment channels both the simple

one as well as as a duplex microp payment Channel as well as uh the lightning Network are a form of smart uh smart contracts uh smart contracts basically allow you to encode part of your business logic into the scripting Language by used by Bitcoin and at any point in time the parties participating in this contract have the assurance that uh what has been what has been agreed on will will eventually take effect and we use we use the blockchain only to set up these contracts and in the end to either uh settle them or to mediate some uh some conflict we we had we had between us and the important part

in all of this is that at any point in time all parties have uh have the assurance that what what has been agreed upon will will actually take place and this assurance comes in the form of a transaction which if we want to settle or if you want to uh have conflict mediation then we just take these transactions broadcast them into the Bitcoin Network and the Bitcoin network will take care of resolving our conflict so uh in your in your in your like around five minutes ago you went through kind of three iterations of micro payment channels you started with the simple one and then then you moved into one where um so you started with

the simple one which is mAh paying Christian yeah and only Mah can pay Christian uh and that's it so this is the kind of micro payment channel that our listeners would be aware we discussed on the episode with streamium where somebody's streaming a video and the other paying is other person wants to look at the video and pay him money so in that case the money only needs to flow from the person who is seeing a stream to the person who is creating a stream so it's only in One Direction yeah that was the simplest one that was invented by Mike and Spielman yeah then then you went into these two other kinds of channels in which um uh money can initially money can flow in both directions like from Mah to

Christian and Christian to Mah and then you went into the third most complex one in which not only can the money flow in both directions but the liquidity is also saved like you don't need to lock up as much money as in the second design right yes so uh so the difference is um in the second scenario you mentioned we just have two channels in in both directions right uh and we cannot transfer more than what has been allocated to to either of the channels uh in the second case we are actually using we are still using simple microp payment channels for uh for both directions but what we can do now is we

take the money that or the coins that are bound to one channel and are therefore bound to move only in One Direction and we flip them from one channel to the other in an atomic way so that way suddenly if if I transfer uh 0.5 Bitcoins to you and you transfer your whole Bitcoin on your channel to me back then you still have uh credit for 0.5 coins but they they are bound to the wrong channel so what we do now is we destroy the two channels we build up two new channels and now I have a channel which from which I can send one 1.5 Bitcoins to you or uh and you have a

channel where you can send 0.5 Bitcoins from you to me uh which was the amount I previously sent to you right let let me just interject here CU I think there's there's one thing we need to briefly explain so so people can make sense of that unless they re remember the streamium episode well right which is that uh you can only go sort of in One Direction in a channel right because if I give Mayer you know 0.2 of that Bitcoin in the channel then mayor has the option to like cash in that 0.2 uh in the Bitcoin blockchain now I can say I give you 0.3 and that works right because mayor can cash in either one but of course he's only going take

the bigger one but he can't give me money back on that channel right because let's say he signs a new transaction that gives me only 0.25 I can't rely on that because at any time mayor could cash the 0.3 right so you have that problem that if you've gone in One Direction in a channel well you can't go the other way right and so now what you're saying is there's basically a way to sort of flip that so you can start going the other way yes so so the the problem in a s simple microp payment channel is exactly what I was talking about about before that uh if you receive some money you will always have the Assurance in the form of a transaction giving you that money uh that uh that you can that you can get

that money uh if if you transfer it back I I I cannot destroy your uh your Assurance um but uh so so so what we do is basically we destroy the whole setup com uh until you get to this in assurance replacing the construction um what lightning does is basically give uh have uh finding a way to um replace your Assurance with something that uh basically hurts you if you try to cash in that one so I think I I think this is the This Is The crucial point which uh which is kind of hard to appreciate so let's

just walk through this one um so in a in a so what's happening in a normal micro payment channel in the normal micro payment Channel when uh let's say it's between Mah and Christian in the beginning um so when I want to send you one Bitcoin uh like for example let's say uh let's say you are you this you're creating content and I I want to pay you for the content and then I foresee that the maximum amount we will spend uh I will spend on this content is one Bitcoin m so in the normal case the way it would work is we would create a multi signature address and lock that one Bitcoin in that joint account which is

owned by both you Christian and me mahare so both of us are joint owners of that one Bitcoin and we can imagine this as a cake and then we are just uh so this this cake is is created on the Bitcoin blockchain and uh this cake has a time lock so if nothing happens the the cake will be divided like I will get the one Bitcoin back let's say one day later and Christian will get nothing so that's the cake and one day later I get to eat the cake completely if nothing else happens now offchain off the blockchain Christian and I can uh can figure out a way of dividing this cake amongst each

other so I can send a statement to Christian that says uh okay now Christian gets 2% of the cake and I get only 98% of the cake cake and uh we don't broadcast this to the blockchain but uh once our transaction is over Christian could take that 2% broadcast it to the blockchain and get the actual Bitcoin in return right so that's that's the simple micro payment Channel case now what you're saying is the problem with this case is the the money can only flow from meah to christianh but you could always imagine that we could make two different cakes so yes if if uh If U if Christian so let's say now we are in

a different scenario where um both both the people are providing services to each other so um like Mah is streaming content and Christian is also streaming content and both of them like uh want to pay each other so you can you can create two cakes so one cake for payment flow from meah to Christian and then another cake for payment flow from Christian to me and then you start to decide H how much how what percentage of each cake does me own and what percentage of each cake does Christian own and then once this division is complete both of us broadcast the transactions to the network and we split our funds yeah

right so these are the these are the first two basic scenarios and now what you're saying is the duplex micro payment Channel adds something a third capability to this scenario yeah so so what what we do is uh once we once we have so so I gave you all of my cake uh but I but I do own about let's say half of of the C of the other cake then what we do is we just we just uh we just say okay let's let's forget about all of that now I create I create a new cake which is half of the previous cake which I can send from me to you and on

the other side we create a cake which is worth one and a half cakes which you can send to me and we have reset basically the whole scenario and we can restart trading again so what happens now is that I can actually send you more than one cake in total and you can send me more than one cake in total du due to this reset we can we can actually have millions and million of we we can transfer this coins or cakes or whatever you want to call them uh we can transfer them multiple times so that's the whole idea of of of the of of the construction Yeah so basically in an optimal scenario we are left with millions of cakes in an

optimal scenario I owe you 1,000 cakes and you owe me 1,000 cakes and so we don't have to transfer anything no I'm certainly glad that we' we've extensively talked about cakes because this is a topic we've completely neglected so far in the history of this podcast but it's obviously very important our show today is brought to you by our friends at shapeshift.io shapeshift is the fast and easy way to trade altcoins and they now Support over 50 cryptocurrencies which includes all the ones you have ever heard of unless you have no life and spend way too much time on bitcoin talk so if you want to trade all coins is the old way of doing it which means creating account

somewhere giving them all your data depositing your money and then growing old while hoping for the best or there's a shape shift way which is fast easy and means getting it all done in less than a minute while not even needing an account so here's something to consider shapeshift is a company that really stands by its values and goes out of its way to protect users private data one way they do this obviously is by not requiring you to give them any personal information to use a service since you can't even create an account to use it and secondly when bit license was enacted in US shapeshift was the first company to say screw this we're not standing for this nonsense and what they immediately did was move the company out of the US and into Switzerland so

shapeshift is a company that really believes in the core values and core ideals of Bitcoin and we think that's very honorable and very cool and and plus by sponsoring shows like ours they really help entertain people like you and help promote growth in the industry so good job shape shift for doing what's right and we' like to thank shapes shift for their support of epicenter Bitcoin so one of the ways or one of the things we should talk about here and and we've talked about this in the lightning Network context as well so in night lightning Network there's this concept of um I don't remember what their name is but basically you have these like hubs that connect different people right because if it's between me and you then

we we can set this up and it's pretty simple but of course you don't want to have to set up these connections between every single party that's doing business CU that's going to be even less efficient than Bitcoin today but you want to set up a few and then somehow you can like hop like between different sort of routes so you can have a ag person can have a bunch of connections and if everyone has a bunch of connections you can sort of route through everyone and pay between each other so how does that work and and you call it payment service provider what do those entities look like and what is their function so uh the idea of payment

service providers actually comes from uh internet service providers because well uh if I if I want to contact Google for example I'm not drawing a new cable from my PC to Google every time I want to to to do a transfer uh but I I am connecting to my ISP and my ISP will forward that payment on my behalf right um if we were to draw a cable every time we want to we want to do connection we would actually pretty soon deplete the copper resources we have in the world and and we would make use of this shared medium which is well copper um in the Bitcoin case we have we also have a

shared medium it's called the blockchain it's size is limited we cannot do too much uh too much about it so we try to keep as much as possible in a local fashion we don't we don't Comm we don't just shout out into the world hey I'd like to talk to Google but we are actually sending our packets to our local ISP which will then forward them um so that's the way that's why we called them pay payment service provider um and uh yeah that that that's the basic idea of it um in the end it turns out that unlike P ISP we do not really have to trust these pay payment service providers because we we have a number of

options uh which we can use to ensure that if we send them some money they will actually forward it to to the end point um the most trivial one of course being since we now do local transactions only we can I mean if if I'm okay with losing a scent I can just send one cent to to the next top see if it arrives and if it deres if I get an okay from from from the merchant I'm trying to buy my coffee to from I can just send the next scent uh a much more complex uh construction would be the htlc the or the hash hash time lock contract um which actually allow us and to to build

endtoend security and uh ensure that uh the one uh the one transfer actually ends up at the uh uh at the destination so uh let's walk through a scenario in which uh Brian is our payment service provider so I want to transfer you money and and now like in my head I'm imagining this as two kicks there's a kick between me and Brian mhm that we can let's say that let's I want to be very rich so in my imaginary scenario I want to have 100 BTC in the cake between me and Brian and let's also make Brian very rich by having 100 BTC in the in the cake between uh Brian and

Christian and now Mah wants to pay Christian so how would that work like I want to pay you one Bitcoin and I have one 100 BTC lock in a Channel with Brian and Brian has 100 BTC locked in a duplex Channel with with you so B basically what uh well we already have this the network set up right uh all you need to do is basically you send send the money to Brian then Bri ran sends it to me and then I tell you hey by the way I received your money all is good um now how we achieve that is is a bit dependent on on on what we on how we want to do it um there is this small incremental uh type of of transactions

where you send a millionth of a of a Bitcoin to Brian Brian sends a millionth of Bitcoin to me and then I say hey go ahead for the next millionth until we eventually have transferred the whole amount and all Brian can do is basically say yeah sorry I um uh I I'm not forwarding this and he may have gained one millionth of Bitcoin um in the htlc scenario what we do is we basically secure the transfer uh using a secret so I invent a secret uh I transfer you a derivative of that secret from which you cannot uh derive the secret the you

cannot reconstruct the secret anymore specifically it's a hash um and what you then do is you tell Brian hey I will transfer you 100 mli Bitcoin if you can tell me the secret matching this hash and then Brian does not know the secret to matching that hash so he is forced in order to get his money to contact me and ask me and tell me hey if you you if you can tell me the secret matching this uh this hash I will get you uh I will give you 100 milit coin so me being the one who invented the secret can now say okay here's the here's the uh here's the secret and give me my 100 milit coin please now Brian goes to you and and

tells you hey here's the secret please give me my 100 m Bitcoin and by doing that we have completed the whole transaction and and at the same time I have given uh you a a receipt that I have actually received the money otherwise I couldn't have claimed it so so let's let's let's let's look at the leg between you and Brian so in a sense um you are giving Brian the secret and Brian is supposed to give you 100 mli Bitcoin yeah but how does that work can't you just uh take that 100 mli Bitcoin and not give Bri the secret on the other side can't uh can't Brian uh

just take the secret and not give you the 100 mli Bitcoin uh no because that is part of the smart contract we have we have constructed right um in the smart contract we uh both parties are always assured that uh one party misbehaving cannot work against the contract and so the the contract is set up in such a way that that in order to claim the money I actually have to reveal on the blockchain the secret and that is uh that is being done with uh well the scripting language in Bitcoin uh and hence hence I call it uh encoding part of the business logic in

in the Bitcoin scripting language um so either you give the secret or the transaction is not valid so how does that comp with the lightning Network what are the main differences here so uh the construction of the htlc of the htlcs is identical to lightning which also means that duplex microp payment channels and lightning Network are interoperable um we can we can imagine we can easily imagine a network which is composed of a number of lightning network of lightning nodes and the number of uh duplex microp payment payment service providers um because we can by uh by having the

same htlc construction we can ensure that independently of how the transfer is uh is implemented we have this back tracing phase in which a secret is sent back through the same route to the um to the origin of of the transfer okay that that's great to hear because I recently talked with with Taj from uh from um the lightning Network who wrote the paper right at the time when we had on the show and they weren't working on implementing it but you know now they are and as host Joseph and then also at blog stream right they hired uh Rusty Russell who's also working on

implementing a lightning Network and I think they are sort of coordinating to make sure that that's also going to be compatible so uh does that mean are you also working on on actually implementing that and act bringing that to bitcoin yeah I'm I'm I'm currently working a bit on the preliminaries uh but I do plan on on implementing the the whole uh Network stack of uh of uh the duplex microp payment Channel um we also had one student here at eth uh doing the next layer of uh of things which is basically uh bgp inspired routing protocol um because even if we have uh lightning Network or or duplex micro

payment Channel today we would still need a way to somehow find a way uh find a route from from the center of a payment to the end point of a payment through this network of of interconnected payment service providers or lightning hubs so I I am I am planning on implementing it uh it's going a bit slow because this whole business of uh of pushing a bip which we need to to actually secure all of this through the the review process is slow and um yeah there have been a few setbacks on that side so is that the transaction malleability fix yes uh in order for all of this to be secure we

actually need to ensure that there is no way of disconnecting a transaction from its predecessor uh with this off off blockchain uh protocols we build chains of of dependent of interdependent transactions which are not confirmed on the blockchain um and we need to ensure that if this transaction is uh is building on this one then we cannot change this uh the the hash of this one otherwise the reference from this transaction back to the first transaction would not be valid anymore that's what what generally is called transaction relability okay and so all lightning and and duplex they depend on this in the same

way yes so transaction malleability has uh uh it would be really nice to to have a fix for that also because Mount go then couldn't claim anymore that it is to blame for their half a billion loss there well well they can still say that was was the cause no so well we we have a paper actually proving that it wasn't the case but right right yeah I mean it was never very plausible today's magic word is duplex dle X head over to let talk bitcoin.com to sign in enter the magic word and claim your part of the listener

[Music] award so that's great and what so let's say that fix happens with transaction availability I mean is there a significant resistance or some people saying we don't want that or or are there people who think it should be done in different ways and can't come to agreement or what's what's the sort of Roadblock there so it's it's always the devil is in the detail it's uh uh I published about what was it I think August I published a prop uh Bitcoin Improvement proposal uh for normalized transaction IDs uh which changed a little bit the the way the hash used to

reference a transaction is computed um basically it was stripping out all the information that could have been modified on the flight without uh without uh invalidating the uh the hash uh the signature um and initially it was a hard for proposal uh that did not sit too well with a few developers so I made it a software uh proposal um which I published in September and now well everybody wants their nice feature in there as well so we I have been rewriting it a few times now and uh while discussing with Peter we actually came up with a much better

solution and uh um so Peter and Greg basically came up with a way to implement the segregated Witnesses which are implemented in uh elements Alpha um to to basically backport that to to bitcoin and uh hopefully fix meability forever okay and and there people can align around that idea or that sounds plausible that that's going to happen so I think the segregated Witnesses uh proposal is so far the the easiest if even if not the the the easiest to implement so the segregated

Witnesses is of course in production in elements Alpha and uh it is a good solution for the problem at hand um my proposals were a bit easier to implement actually I have implemented them and uh but segregated Witnesses seems to be the proposal everyone uh is rallying behind and so I I guess that that has a good chance of of being merged sometime in the future so uh assuming that that transaction malleability is solved um could you uh can you go into how somebody could be become a payment service provider and make money building

a business around it um so the requirement for you to become a payment service provider is uh have some Bitcoins uh because you in initially when you set up these channels you need some coins to f on the channel so that you can actually start transferring uh transferring Bitcoins um that being said we have not figured out how yet to do addressing in this network um and how to assign addresses in this network simply because for this kind of routing to be efficient we need to have uh uh some sort of structure in this in this uh in this

network for example isps use prefix BAS routing um and that would be cool if if we could do that in PSPs as well so the second requirement would be to actually be integrated into that Network and start opening Channels with other people now on the earning money part uh you can attach fees to these transfers as well so just as you would attach a fee to a transaction you sent into the into the blockchain you can attach a fee to the transfer you're doing in the uh in the duplex microp payment Channel network and uh every hop in the network

would then draw some of u a part of that fee from uh from your transfer until at the end the last toop eats up all the fees and what comes out at the end is is just the amount you wanted to transfer in the first place um basically with with every hop May her get some cake yes so so so basically like um if I become a payment service provider um what I really need is to be Bitcoin Rich so I need a stash of Bitcoins that I can put in creating Channels with a lot of different people right that's that's what I need and uh what what what would

make a good payment service provider somebody who has a lot of channels open with a lot of different people so I mean it it is uh important to make the entry barrier as low as possible so that's that's also why we created these duplex micropayment CHS in the first place if you had a h and spoke model then you have the problem that you have to be really rich to cover all the transfers that go through you uh in the uh in the duplex microp payment Channel network you would have a small amount let's say one Bitcoin uh associated with each Channel and since you can now transfer it multiple times back and forth uh this

this Bitcoin now becomes much more you you get much more out of this single Bitcoin than if you could transfer it once um the barrier to entry is is low in that you're not forced to have an a certain number of connections you have to open all you need to do to get started is to open two connections and then route payments through you uh between the two endpoints you are connecting to and once you have more cash you can then open new connections and position yourself better in the network so that you are more Central to the network and and somehow more payments get routed through

you okay so Perhaps Perhaps this is a a nice opportunity to explain the difference between lightning and and your proposal so um if I understood it correctly what what you are saying is um in scenario one let's assume like Brian and Mah are both payment service providers on lightning and in scenario two Brian and Mah are payment service providers on the duplex Network right now in scenario one so when when both of us are payment service providers uh it's a scenario where um you need money to flow flow frequently from Mah to Brian

and from Brian to Mah because Christian might be a customer of Mah or Sebastian might be a customer of Brian and then sometimes Christian wants to pay Sebastian some sometimes Sebastian wants to pay Christian so the payments are flowing in in a lot of different directions so in scenario one lightning um so the difference between scenario one lightning and scenario 2 duplex is that in scenario one meah and Brian would need to create a channel destroy it again create a new one destroy it again while in dup duplex micro payment meah and Brian create a channel once and they can operate with it uh operate with that single Channel like root many more payments to that

single Channel as compared to lightning is that the advantage of the duplex Network so I I I think the um so in in both cases in the lightning Network case and then the duplex microp Channel case the uh channels have a lifetime uh which is limited um some say that uh that the channel will be active for a month or for a year but in both cases they are not uh endless and they are in fact pretty similar because the um the uh the overall effect achieved by lightning and by a duplex microp payment channel is

pretty much identical where we differ is the construction of uh of uh of the channels um and uh if you so I read an early version of of the lightning paper and it took me so a really really long time to figure out what they are actually doing um and uh what what we did is we basically started from the two single M simple microp payment channels combined them in into a uh into a twood directional Channel and then figured out how to reset them um we have I think our construction is is a bit easier to

understand because it's built on well-known blocks that we basically analyze uh individually and and we can show that they are working uh whereas lightning is uh is a bit more complex in that they all of these parts are very much dependent on each other and you cannot strip them apart and analyze them independently so I wouldn't say that duplex micropayment channels and lightning are completely different because they achieve the same goals with sort of the same guarantees uh but the construction and the ease of implementation varies a lot and hopefully me being the author of duplex micropayment channels uh I of

course would argue that mine is uh easier to implment and hopefully get it correct okay so so the advantage of your approach is uh the ease of implementation yes uh okay and and so one one final question on this topic um so now we have kind of moved from so when we move from Bitcoin the blockchain to the lightning Network or to the duplex Network we are um moving away from something that is decentralized and sensorship resistant M to a stru Ure that uh that has payment service providers like for example me that can be uh that have to comply with government regulations Etc right now um

now the advantage of of this kind of seems to be that because I can't steal any funds as a payment service provider uh for the for the End customer it means that they can use any payment service provider in the world and they don't need to trust any of the payment service providers which in turn means that for the payment service providers I can go and set up in in any country which has easy rules to become a Bitcoin payment service provider set up my business there even if the customer does not trust the country I'm operating out of it doesn't matter because it's trustless right yeah so uh we certainly maintain the security in the sense of

the coins cannot be stolen by a by an intermediary um and I'm I'm pretty sure that that these uh intermediaries will eventually also be regulated that being said it's it should be really easy to set up an intermediary or well a payment service provider uh there is no there is no license all you need to do is is to insert yourself into the network fund a few channels and start transferring coins for for other people and basically start earning as for moving to a country where uh where the uh the regulation is lenient uh that's not strictly necessary I mean you

you can operate all of this over a tour um and uh it's it's relatively low traffic so uh I'm pretty sure we we wouldn't annoy tour uh so much that they would ban us and um and by by basically off fisca your location you have achiev the same goal uh you have achieved the same goal as moving to a country that has lenient policies um and uh so yeah there there is very little trust in in all of this and uh you are free to choose whatever payment service provider you you want to uh we have an an additional Advantage so uh one uh

some people have asked me whether the uh whether there is a privac concern because now all my payments go through uh through a payment service provider uh all that payment service provider sees is what is the equivalent of the information I would have published on the blockchain anyway that and he does know which IP address I'm I'm using so what we what we do is we actually keep this information off the blockchain and I would argue that in that sense we are even more private than we were in in the blockchain scenario right cuz you make it much harder for you know the services like chain analysis or the companies that do uh clustering of entities and all that with with information on the

blockchain but also network monitoring right and that's going to be much harder too yeah exactly yeah so so if you if you want to be private just just open open a connection to a number of payment service providers and and just randomize who you are going to send the transaction to or pretend to be a permanent service provider yourself and you're routing payments on on behalf of other people so there there it it becomes much easier to obfuscate what you are doing in in the network yeah I think that's a that's a big strength so one of the things once when we had Mike Hearn on we talked with him about like n to and I think he made a really important po or and he also wrote about

this elsewhere and and that the problem starts to be that it becomes much more more complicated from sort of a wallet perspective about how you know how do you implement that and of course you do have this the sort of thing that let's say if people you know I can't pay at a restaurant using lightning Network or duplex unless you know the party receiving it has also switched to that so you sort of need the whole network or at least significant portions of the network you know to switch over to that to have to sort of you know the real benefit do you is this a problem that you know it's just too complex to implement for a lot of the wallets

and maybe not for the big ones but we have wallets like the Bitcoin Android wallet or electrum where it's small projects with basically one main developer so yeah there there is definitely added added complexity to to uh to implementing a wallet um but you can get away with implementing only part of it you don't you don't need toh to do all the uh all it's not every wallet that needs to do all of the work um and where uh where there is this bootstrapping uh phase uh you mentioned that some people don't use uh use this

network There's an opportunity for intermediaries to actually do this this translation um so bit pay for example is sucess uccessful because they they allow people to accept uh payments on a network where the uh the receivers are not actually on the network itself but they would like to be able to to accept these payments um I I do see the difficulty in uh with the added added complexity but I think uh if we can make it easier for these protocols to be implemented uh then we we sort of reduce this uh

this downside and that's also what what I've been aiming for is is a is a protocol which is easy to implement and hopefully get it right I would not trust myself to implement lightning correctly so uh so one one final question uh and this is um this regards to ethereum can can you implement duplex microp payment channels in ethereum and would that be easier the second part of this question is um Can ethereum enable like the next generation of lightning networks or duplex microp payment channels um and this I do have to be honest I'm I'm not an expert on ethereum but uh I

think we cannot take duplex microp payment channels or lightning uh and translate them directly to ethereum simply because ethereum makes the assumption that we have this uh global global synchronized State um and on which we on which we are operating and the other problem is that we have uh we have to have fungibility in what we transfer uh in all of the descriptions we had before we we silently accepted that the coins that I want to transfer to you it it you don't care whether I send you directly my coins or whether you receive Brian's coins so the uh the the fact that I can

transfer 100 milit coins to Brian and he can then send you 100 milit coins means that it's not the same 100 milit coins that are directly going from me to you but it's different coins so we do have to we do have to keep this fungibility or exchangeability of of objects we transfer um but I do think there are venues where we can actually have uh have sort of the same things uh or the same setting which would allow uh different applications to also use duplex micropayment channels for example one uh one thing would be if we have asset tracking networks um and I have an

asset which or I have a connection of an asset I want to transfer from from me to uh to Brian and from Brian to to you then uh if if if we all have the same asset and it is fungible then I can transfer it to you without any problem um whether uh ethereum can enable the next generation of of blockchain uh uh smart contracts pretty sure it can I I mean uh the ethereum scripting language which is what we use to encode the business logic in all of this um is basically a superet of of of the Bitcoin scripting

language so I'm also not an expert on this but it would seem to me that probably if if all you're talking about is let's say moving ether then you you should probably be able to do something like the lightning Network on ethereum right but then of course as soon as you start talking about interacting with contracts and uh more complex things then that probably breaks down yes exactly so so ether is just as fungible as Bitcoins are um so I don't see any problem in in transferring ether um you're right I I was talking about about contracts directly and and they rely on on on a global State being

synchronized cool excellent well thanks so much for coming on so we had so we're we're basically up before time we had another topic we want to talk about which is which is an interesting uh proposal you have called a pure census it's sort of like uh quite out there and unusual but very interesting and I was looking forward to talking about that but unfortunately the duplex stuff and lightning Network stuff is is so complex that one just gets s of stuck there uh but we'll link to the paper in our show notes if people are interested in checking out um they can do so and um and yeah we'll see maybe we

can come back to the topic at some point sure love it yeah so thanks so much for coming on it was it was a pleasure talking to you thank you very much for having me that is it from our side and now as as we mentioned like links to Christian's website uh and his papers will all be in the show notes and um and you know we put out episodes of this every Monday so you can subscribe to it on iTunes you can get it on Android or your favorite podcast app and of course you can also watch the videos on youtube.com/ and Bitcoin and uh if you're a loyal listener you know what's

coming now is that we have been doing this t-shirt uh bribery contest which basically means if you leave us a review let us know then we will send you a t-shirt so if you do so please send us an email at show ATS bitcoin.com now one brief heads up here is that we're sort of out of most t-shirts so we'll have to get produced and we'll take take a little bit longer but uh but yeah that's it so thanks so much and we look forward to being back next week [Music] [Music]