New Ethereum talks, every Monday. The week's conference uploads by event, in your inbox.

Loading player…

Dan Nickless: Bringing Fairdrop into production with fds.js and Swarm

SwarmWed, Oct 9, 2019, 12:00 AM

Dan Nickless: Bringing Fairdrop into production with fds.js and Swarm Fairdrop enables a secure and encrypted file transfer over Swarm and it provides a privacy centric alternative to centralised solutions. The talk will give a deep dive into the challenges presented in releasing Fairdrop dapp and how we overcame them during our journey to release a ‘totally decentralised’ production level app on the Ethereum and Swarm Web3 stack.

Transcript

okay hi guys i'm dan from data funds and i'm going to present bringing fair drops to production using swarmin FDS Jess so for those of you that don't know already fair drop is adapt that we've built using swarm and a theory and blockchain it is built around file storage and originally intended to be a drop-in replacement for we transfer and we decided to add encryption and messaging and all sorts of stuff so that's that's the story with that you can access that fair drop XYZ and it is working at the moment there's also a an Easter Egg here if you go so about fair day a society and click 11 times the file size maximum file size gets upgraded so you guys can check that I so I'm gonna just set off a new account to be made so that's how you create an account and hopefully that will all make sense at the end so I get back to the presentation now I'm gonna go through this quite quickly cuz and they were a bit pushed for time so fair drop what we said to thee was making an app that's indistinguishable from a web to app to end-users so and you nobody needs there anything about blockchain it just works for people they don't need to know anything extra they can just carry on with it but under the hood it's completely web 3 decentralized architecture and of course to go into production you need a stable infrastructure which was really the challenge that we've been focusing on lately so this was the initial release that they've gone in 2018 fair drop at the top was a single page app but with all of the JavaScript that handled all the swarm feeds and interaction with the blockchain if they included in it and they were using Broxton swarm and they that this wasn't particularly stable so we started sort of a bit more about how we're gonna integrate with web 2 and like one of the main challenges we found is that we need to have TLS everywhere and DNS root domains though the people aren't used to dealing with going through gateways and there's maybe some security issues so we've been focusing on kind of how to resolve those to make it it seems the end user like it's just like a normal website we also went to work cross browser so no plugins and on mobile too so he came up with this and two major changes here one is that the we've split the JavaScript application layer into two sections ones FD SJS which I'm going to talk about in a little bit and the other ones now quite a thin react app layers it's just something that normal developers would be would be used to but using FD SJS since the normal server architecture the other end you've got this FDS node layer and we've released their own public test net which welcome to use it's got an insanely ambitious block time of 1 seconds so might get reset at some point but then obviously we've got northern can swarm then fed through FPS mode which is docker compose projects consisting of a gift gateway a swarm gateway that's expose the specific gateway URLs through proxy pass from like your HTTP your site comm through to a specific swarm URL that we've uploaded like for example the swarm fee view and update with the website content and then we've made it so it's a one-line deployment or a VPS so it's pretty accessible for the end end-user developers you don't need to know anything about blockchains to do this and then there's also a script which automatically provisions here HTTPS certificates from that sync rate which is really important because now if you go to like a page without HTTPS it says not secure at the top and like this is not the message we want to be giving out right so the the overall kind of aim with this was to make it super easy for app developers to deploy a site using swarm and blockchain architecture but exposed to existing web 2 and actually I forgot to do this but I realized that it was a great metaphor to think about this as a dongle like we're trying to kind of like plug in old tech into new tech and so that's what we've tried to do with this project and after much blood sweat and tears we now do have a project with a hundred percent uptime for quite some time so that's good so move now on to FD SJS which is a project that we we pulled out of the initial fare drop proof of concept so kind of make it available to other people so the idea is to make it easier cheaper and better to build and deploy apps using swarm and blockchain than it is using existing web 2 technology it's it's no mean feat to kind of deploy apps at the moment yeah after you have to have like a server architecture and then have your single page after those have to talk to each other you have to build like an authorization there and it's not easy it's difficult where and it's not great either it's kind of put together with rubber bands and silver tape what we wanted to do is make something that's really coherent like leverages this great new tech that's being built because I mean is better it's like built with trust baked in from the bottom layer so that's what we've tried to do with FD SJS and this is the sort of API that we're aiming for we just want to keep it simple so it's literally you instantiate the objects create an account and then send a file that suit JavaScript file object which you can get out of like file import or whatever and for that you get any a nest of sub domain registrar's you got public/private key encryption scheme with the public key saved on the NS register so you've got identity as well end-to-end encrypted file transfer offline messaging don't need to be online to get the message while its management both dates of storage over swarm also encrypted and these are all different components we use to do it I kind of probably imagine this smart contract CNS and then the whole swarm suite so the outcome of this is there we've got from that initial fair drop app we pulled it out into FDS and there we've got another sort of like playground demo app that today has done some amazing stuff with and in a relatively short amount of time even though it is a pinball wizard I think many of those could follow suit and then where you'll see tomorrow the way of planning so integrating to swarm city as well to provide them with their infrastructure functionalities this is this is just from the readme on the github repo which is at feds github.com /prayer data say again it just gives you an idea of the sort of stuff that's in the API and then what's next that fds is some form of decentralized push notifications some ways to do use around acquisition analytics that's ethical and and subscribe to the fair day earth society principles databse in some management as answer mentioned it's on the cards and it's something we really needs at the moment we're just accumulating a lot of data we don't really know what is and very large file sizes you'll hear from suhoor he's also undated fund later on about that right okay so this is the bit where i did do a lot this is where i do a live demo or try to so you can that i've created earlier this swarm 20:19 what i'm going to do is going to try and make a react app that integrates with this so unfortunately you have already done most of the hard work here and this is just a really like tiny create rat create react app projects is just it's got drop zone and it's just all it does is it if when you drop the file it fires this callback and that's the javascript file object there so I've got some bits of FDS curried I've prepared earlier and how well you guys can see this but the first line just creates a random number the second line creates an account that's like a throwaway ID that's now normally where the sort of sub domain would go no password for this one but you is password encrypted and stored into local storage the wallet file and then we're gonna send it to my new address swarm 2019 okay I think that's right so this this wormhole put it in here and it ends up in swarm that's the plan and you can see in the console here what's happening is therefore city gifting eath now we're doing transactions on the blockchain registering all the different bits for ans we've registered the sub domain and in the network panel now we'll be going crazy going hitting up all the various different stuff that we need to do to make this happen since okay looks like we might have some success and then yeah so it's popped out in fare drop because we're using all the same infrastructure in the same library you've got interoperability between everything can you look that's the image has been censoring and that's been encrypted as well over swarm so message complete [Applause] and then actually if we go back so this is chatty and this is our chat app that today is put together using FD SJS he's implemented group messaging phishing all kinds of stuff he may or may not be on the other end of it now so we'll see if he responds but I wanted to show you is that if I change the so my account here is sick 32 there he goes responded this still there if I change the ID here to sick 32 and try and drop another file in then it should actually appear in chatty you can see I've already got something from before I've been trying out all that I'll let that do what we kind of carry on so that was that and then that just brings me on finally as a transition to today's project today's talk he's going to talk about multi box and essentially what multi box does is here we've got a message that's arrived in the fare drop received pile but it's been sent from swarm Hall and this this actually saw presents a problem because in chatty you end up with a bunch of text files that get sent actually I could send it here from swarm 219 again it's a it takes a little while to register the connections and stuff then it gets much faster as you go through okay so you can see because this text files arrived here now you see it's - before so the idea with multi buckets is that we now provide a way to have this interoperability but in a way that we can have different protocols and different expected locations per account so essentially you can receive you can receive chatty messages and Federoff and vice versa so I just go back to the slides so multi box the headlines heart here are there it provides interoperability between apps not just running on FD SJS like were completely open to any kind of infrastructure it's a collaborative key value store in the blockchain it's a very simplistic way of explaining it and central source of information so I'm posting from ans sub domain so in a similar way that you use content fields kind of indicate where you as the website resides on swarm this will show all sorts of different things and then finally it indicates their protocol so it allow the app to correctly interpret data structure so for example is it encrypted 0 what's the data structure how do we deal with it and then this so this is the vision where we were like would like to end up with from so from fair drop where you have just the received sent and stored now we've got all these different kind of repositories of data that are also imposed if by multi box so you're working from bottom up we've got like consents that allow people to use your data and we've got ether get repositories that you are in encode or that maybe you've been sent all of your calendars that we pull in from various sources at the top you've got all the different social stuff stuff that's come from your mobile phone provider they'll send you like what IP allocations they've giving you what geo tracking information that you taking like plot that on the map and see where you've been in the last year some analytics banking so on you kind of get the idea so the idea is to have a central repository of data that you can view through any of these apps and like in the similar way that you've got that like the navigation here a fair drop you could also have that for chatty or swarm city or any other app that you want is to access it as long as you've got the encryption keys for your data right so today is gonna dial in from Skype and fill you in on mati box but for the time being thanks for that and that's where you can get in touch with us I think and yeah thanks very much

Automatic transcript — names and jargon may be misspelled.