SF Scala: Fabrice Drouin Interview
Recording: SF Scala: Fabrice Drouin Interview
[Music] hello everybody I'm Alexa Krav the organizer office of Scala and here on the location that Ascenta Phi which is a company using skull and also this is a joint met up with a certain tag a meet-up we started recently to explore engineering technologists behind modern financial technologists setup such as Bitcoin and blockchain and risk and fraud and who happened to have a lot of these companies in our meet up so kind of focus on this and today with us we have Fabrice drum the CTO of I think you welcome Fabrice thank you so we are here following is killing Bitcoin all right maybe you could tell us a little bit of icing kudos and why it's important for scaling the Bitcoin ecosystem all right so we're a small Bitcoin startup we started two years ago and we work on the Lightning Network so then the Lightning network is a scaling solution for Bitcoin it saw the throughput problem you have on Bitcoin which cannot handle more than about ten transactions per seconds for the whole world so it's it's it's it's a huge problem lightning is what people call a second layer solution it is based on Bitcoin and it's on top of it and basically it's it's a clever protocol based on updating transactions that you do not publish all right and creating a peer-to-peer network of payment channels that can help basically an unlimited throughput because transactions are not published and payments are routed right so it's a very interesting solution to the scaling problem we have on beacon it's an open source project it's a community everything is open source and public you have specifications on github you have mailing lists icy channels and right now we're about to release the the first version of the specs and to have a first interrupt demo on on main net with real money between the three major implementations of lightning so there's us there is lightning labs just right here in San Francisco just a few minutes away and block stream also working on implementing us also local company yeah right so you guys use scour I think one of those other guys you just go yes which is wedding lightning nap Jesus go and block stream is is si si and suppose possible yes okay so first of all right I'm meeting you to the space so I want to scare me and it it struck me how complex lighting Network is right basically the description they gave in training and the main conference is in currently ephemeral you basically establish this channel bye bye so you you plug into the main blockchain by its at a few points you first you open the channel yes see force the collateral is like an escrow account so you see how many coins are gonna commit to this channel yeah right and then you turns out within this channel which is promise which is of shame yes and then finally close the channel then you publish the final balance right and so basically there is a whole bunch of questions is understand through intermediate states right so basically every transaction is a state and they publish the state in the peer-to-peer network you publish basically what lightning is about is suppose we open it a pensioner between ourselves so I found it so I will create a transaction that sends me for example that sends ten bitcoins to a multi-sig output which is something that's you and I must sign if we want to spend it it's like a joint bank account mm-hmm and we create what we call commitment transactions this spans the funding transaction there are varied at all times they're signed by the both of us so the value at all times but we don't publish them mm-hmm so when I open the payment channel I send ten bitcoins that multisig address it's it says publish it's on the blockchain and we each have a community transaction that spends from it mine gives me back my 10 becomes and euros gives you zero because I am and what we'll do then is update how much our transactions give to us how we split the balance of the funding deduction suppose I if I want to pay you one Bitcoin mm-hmm we will update our commitments as actions and we end up with I'll have a commitments direction that give me nine bitcoins and one for you and you'll have a communication that gives you one Bitcoin and nine for me and we will keep on updating our communities actions but we don't publish them right we could but we don't write and what we want to close the channel we agree on on what the final amounts would be in our case nine and one and we publish a closing transaction and it's over right it's back to the blockchain it's back to our own Bitcoin wallets and we can do what we want with it all right and so the kind of the promise of scalability here is that you don't overload the main book change yes every introduction and also there is supposedly peer-to-peer network so again correct me if I'm wrong I'm a new guy in this space right so I was not in doctrine aided with the blockchain context and that the fact that it's it's basically the major problem with scalability it strikes me as extremely complex right so my first Direction is this gonna work for end-users right so I'm at the you know pharmacy I'm at the supermarket right suppose let's say basically one to replace Visa or MasterCard with no chain so you basically want to tell me that this is a way for the merchant to transact with a bunch of customers we want to replace people on supermarket so do I let's say I'm coming in with an iPhone right so I am if they're dumb like I'm you know I'm not you know I cannot create a website right so I'm imagine that basically this is much beyond me so how can you implement this at the end-user application where now this is comprehensible to the user what happens with Alice well like so Bob now is is not a person Bob is a supermarket right so so basically can you imagine what will the end user setup look like where it becomes easy right there I come and I swiped by a phone or a shake it I pointed or something yes I don't know anything about anything right it's it's a good question one of the one of the challenges for pecan is UX and how to make it simple for users to use right so right now if you want to play something with Bitcoin you you will typically scan a QR code mm-hmm that says how much you want to pay anything the final address where you want to send money to and lightning will work like this if you want to buy something you'll see your QR code which encodes a payment request and the payment request encodes the amounts and the destination mm-hmm so we you will scan that QR code with your with your phone and instantly almost instantly since it takes maybe two or three tenths of a second mm-hmm you see that you've paid and the merchant would see that they've been paid mm-hmm so it would be instant all Learning Channel yes but does it mean that my world has to have a sufficient balance and I will it will be the end user will font this channel yes with a merchant what we think is at least to start with lightning we will use for for small payments mm-hmm a bit like your wallet all right and your bank account right you in your wallets you don't have that much money and you need to pay for small things exactly we believe that at least to begin with I think will be used to buy cups of coffee or small things local markets and so the balance problem won't be an issue you you you you will always have enough to pay for the things you want to pay with with lightning okay so explain to me right so let's say Starbucks so Starbucks is a very digital you know advanced company and they speak it you know scale by the big conference we have in two weeks they use color there are the very men so there are very so so they they can certainly implement the server for this right yes so but now I am the the user so I come into the coffee shop so so you know latte in the u.s. costs about five bucks right so it's expensive but you know I like it so I can I'm willing to pay so when I open basically when I you know wake my phone at the cash register do you want me to find the channel for how much $5 $10 $30 how much should I effectively put into this call what I believe is that users will typically open maybe three to five channels with with different nodes mm-hmm with maybe the equivalent of thirty to fifty dollars on each channel and they will use them to pay for for that coffee and once a channel is empty that will close it get but whatever is left on it and maybe use it to open a new channel but basically you will always have a future as for about $200 when you aggregates what you have in the challenges I mean and you will just use them to pay for small things okay so effectively you commit to you prepay yes right so I mean this works great right like I know that for sure I'm gonna spend every day at least five or ten dollars for coffee so I can I can give you fifty dollars in advance knowing that I'm gonna buy this company now because people say that money is locked in 19 channels it is true but you can always get it if if the other side of the channel is is is responding you get your money back instantly if I have a channel with you and I want to close it and you you you are still responding to my closing messages then the transaction that will be published will be usable right now yes if for some reason you stopped responding you go where your server dies or whatever then I will publish my commitment reduction and I need to wait a bit before I can spend it but typically otherwise one day before I can spend it so it's with small amounts it is not really an issue yes but you would not create a channel just before you want to pay for something because you still need to confirm the funding deduction and that takes about one hour an hour so it is not practical to open the channel when you need it right you need to have a few channels open a lot all right interesting so so typically right if I know that I'm a customer a kind of coffee drinker right I want the channel open with my favorite coffee shop but you say that the first time I do this I should put in advance because you know I'm catching the ferry right so I can buy my coffee in you know before the fair attendants before and I'm running to the ferry so this case it's not gonna work I need to plan yes but the thing is with lightning and that's a huge change compared to see that the pension is that we had before is it's a network of channels and you can pay anyone on the network so you don't have to open the channel with Starbucks or subway or whatever if as as long as you have a channel to know that is connected to Starbucks you can say Starbucks okay which is why you will only need maybe three channels to pay basically everyone okay the channels we had before you had to open a channel with every mention we see which is which was not practical right it's not true anymore Visa MasterCard charges every single version for the term oh so okay let's so let's consider this scenario of like several hops so let's say Walgreens is a big pharmacy chain here right so I have a channel stammers Walgreens and it's not urgent so I ran out of paper towels so I go at night Walgreens and if you know my kids are asleep so they're open 24 hours so I I will wait right so I can if I want to establish channel with them I waited an hour I know it's confirmed I went there you know I paid for the paper towels and I give it the whole box in there so next day I go to Starbucks and I realized I want coffee I don't have the time I'm catching my ferry but now I know that I have the shadow Walgreens yes so how will Walgreens channel work in case of Starbucks what do I need to do what needs to happen in the network that you know I come to the terminal Starbucks you know it's the first time I want to do something there how do Starbucks know that the research angle with Walgreens and that I'm going to be paying through the channel first to them because routing is a hard problem but some will start with gossip routing system where everybody knows as a complete map of the network so if I want to pay Starbucks my phone will have on my my lightning but it would have a complete map of everything of the Lightning Network so I will find the route to Starbucks of global I think yeah you know every single terminal yes okay you know every channel or show that that wants to be published all right you could you could have hidden channels seven billion people in the world who are on the live network this should be a seven billion times smaller channels to open you know what's all the German hops are not not necessarily because and for example and end users don't need to advertise their challenges correct so so you mean in the merchant channels channels we in the hops which are willing to pass through payments yes okay like the payment request includes routing information so you could very well not publish your channel because it's you're an end-user and you you will not route payments but you will include routes to you a few nodes in your payment request this should be enough hopefully to find the roots to you and so you'll need to leave for you to find the roots to the version you want to pay all of the nodes not only yes okay and right now we know that's broadcasting and having everyone have a complete map of a network is not going to scale a lot it can handle maybe dozens of thousands of channels maybe a few hundred thousands of channels but it will be limited mm-hmm but it's good enough to start with we believe we will be able to bootstrap a lightning Network that people can actually use and there are optimizations that such as not publishing leave nodes mhm that's will let you use lightning even with a lot of people some people say that lightning will be centralized because obviously huge hubs where everybody is connected will handle of traffic that's right but it's not because these works that something else could not work so I don't believe that lightning would be fully centralized because if you compare it to mining for example everyone can mine but if you mine at home you will never ever find a block mm-hmm so because it's as a threshold mm-hmm a barrier to entry it doesn't exist with lightning anyone can can run a lightning node and anyone can connect to it and start paying paying things so that is absolutely no buyer to entry no threshold effect that will prevent you from effectively running lightning nodes okay is there any way for the merchants or you know like n plus m come to Starbucks and you know I'm a user I'm protecting about my privacy here I don't have Starbucks channel directly but I have all greens I have you know you know Safeway basically can I choose as the user and because the merchants choose the routing like is the routing completely round-robin or is it preferential do you have to say say how we do what wrong we use to begin with we will use sauce routing which means you choose the route to the merchants the yes okay completely it works a bit like the Tor network you will compute the routes mm-hmm and nobody else can change it mm-hmm so if you don't want to go through specific nodes okay so the first example Starbucks basically you mentioned that some kind of routing choices will be presented to me like I'm on GPS I have multiple routes of destination right so you know better GPS gives me like here's the route through highway here's the route of local streets no highway here is the route of no u-turns here's not know you know no unprotected left turns so you're basically saying that I will I be seeing this or we will you know it's like if it's too overwhelming for the customer it will be hidden I I think it's it will be like advanced settings most people don't need to see the roots how it works but since it is computed locally you could very well ask for your wallets to display the roots and you can you could very well decide to add rules like don't go through these nodes or yeah right because somebody can basically set up a trap node which will be accepting all routing requests right like that's a and the same wants to intercept all the pending requests and collect all your data so that's the village should know they'll fund it and they will route your data right in order just to know who you are so read source but it's not that easy because we use that there was a lot of attention to privacy issue and issues and the transit traffic is encrypted edit and when you are relating payments you don't know the origin or the destination of the payments you know where it comes from and know that gave it to you you know you you know who to give it to that's all you know you don't know who started at payments and you don't you don't know the final destination it's it's it's the addressing system is different basically every node we'd have a private key and a public key and the public key is used to identify knows you be the address of a node is it is its public key mm-hmm okay so I think we were from time so I'll ask you why Scala right we've used Scala before we use color mostly because it's it's a nice language and the JVM is one of the best runs on that is to build servers mmm it's underrated because it's it's Java and it's all in it and enterprise-e but it's extremely extremely good for as a platform for winning servers and I think that's why we chose it's kind of so I'm a huge fan of French school of programming languages that's my first big let me show you fell in love with those ADA you know we should still Soviet Union so it's brought me all the way to the US and then I I probably no camel we should think people still are in school so how does this kind of context function programming with a caramel influence your choice of skull is this that a lot of folks along keval can switch to skull easily we actually come from Java we didn't use functional programming languages a lot before scanner it was the first one we used and our choice was was mostly driven by wanting to keep on using the JVM and having something that is less clumsy to use than Java mm-hmm so we started with Scala as a better Java for the JVM did you have to lower common school yes oh no no no already other team members obviously don't think so we focused on on algorithm design and computer science but I never classes with functional programming languages just purely Java kind of better Java kind of simplification yes yes environment so how do you feel I mean like you know I just on the scaling right like this bit cortical space you know some examples are in gold right so I certainly felt in a minority and when I talk to some of the elders I feel like you know they said like this is a very conservative Network right like this is basically C++ dye my folks would need security for 20 years so they have the processes they're pretty comfortable that they can do stuff even in C++ because they have very rigorous testing and they're a slow-moving process right so how do you feel kind of being surrounded by the C of C and sometimes go skyrise is is not as I guess widespread as people thought it would be five six years ago so we used having something that is a bit exotic mmm-hmm but it's not a problem because [Music] for low-level things see and go are really nice but Scala gives us access to the JVM that is a very good platform and also the the tooling and libraries that you get with Java and that is extremely useful there's a Java library for for absolutely everything yes and a popular Java libraries I used by millions I guess actually millions of users so they're pretty good mm-hmm they work and it it is really a good platform for for what we're doing because we can put a type very quickly whatever we need we find we we don't we never spend time redeveloping low-level stuff that is not necessary for what we do yes we always were as it is cryptography networking whatever or even competing crafts and and root finding roots as always tools we can reuse so we don't feel like outcasts because we use connects it is exotic but it really works as a development platform yes that's you know in in the US but Eris is every year it's less exotic as I can tell you're right like we you know run the fifth year scale by the conference now and every year have new companies coming in and all companies doubling down so you know Apple is a huge user of scholars so it's it's serious business called Apple Maps right so it's not really exotic anymore so I think you're in a good good group so last question I have I'm really curious about this whole ecosystem because it's really to me it's it's kind of Renaissance technology because you need to know psychology right because people it's the people facing system in the end people will make decisions right then it's math and cryptography and computer science right so you know phrase school of math is obviously very well established so do you think you guys have an advantage in the way that you know you know you know fresh education very strong in math it's very strong theoretical computer science and algorithms do you think you guys by virtue of you can scale having you know your team in France you are kind of competitive positions to work on this slide Network maybe not because of the math and things but I think mostly because SCARA and the tooling we have enable us to build things really quickly I would say that compared to other teams working on Bitcoin we really have two that enable us to to try things extremely quickly and without having to throw away what we've done when it comes to changing it to two into something we can use in production the development environment is really good as for the the math and cryptography in France that's one of the things that thing is really sad but we have a lot of mathematicians and cryptography is but the French are not really interested in Bitcoin right now so we are trying to get academics you look into what we're doing on Bitcoin and lightning and routing and everything but it's it is very very hard so yes lots of mathematicians and cryptography is but right now there are they are not looking at Bitcoin hopefully you know the increase of the rate will cause them to look at it but we are very happy to have yourself is good anytime so thanks for coming and looking forward to a technical token good luck with I thank you all right thank you very much [Music]