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

Loading player…

Haseeb Rabbani: ENS & IPFS | ETHDenver

Ethereum DenverTue, Oct 9, 2018, 12:00 AM

#BUIDL the future at https://ethdenver.com Haseeb Rabbani: https://twitter.com/haseebrrr This talk was part of the ETH Stage at ETHDenver 2018 on 02.16.2018. ETH Stage is ETHDenver’s Main Stage which features talks and workshops by top leading blockchain impactors, influencers and experts. ETHDenver is the largest Web3 #BUIDLathon in the world (fka hackathon) for Ethereum and other blockchain protocol enthusiasts, designers, and developers. The community attending ETHDenver shows up to contribute to the global blockchain ecosystem, whether by #BUIDLing decentralized applications (dApps), contributing to or starting infrastructure level projects, writing documentation/tutorials/white-papers, designing UI/UX, or info-graphics, or to learn, connect, and get more involved. So bring your inner awesomeness and some friends. We’ll provide mentors, resources, and all of the educational content you can consume. Follow ETHDenver on Twitter: https://twitter.com/ethereumdenver Follow ETHDenver on Instagram: https://instagram.com/ethdenver Join the Bufficorn #BUIDL Brigade on Opensea: https://opensea.io/collection/bufficornbuidlbrigade Join the conversation on Discord: https://discord.gg/sporkdao Subscribe to our channel: https://www.youtube.com/ethdenver

Transcript

okay thank you for your patience we're gonna start this this presentation welcoming hasib back to the stage he's going to talk about ENS and ipfs two awesome things that combined are even more incredible thanks Ken so yeah let's get started with ENS which stands for aetherium name service can I get the screen back sweet ok so I'm actually gonna cover I pee FS first and then we'll try to see how we can use ipfs with ENS right so what is ipfs so ipfs describes itself as an open source peer-to-peer hyper media distribution protocol right and that can be a mouthful right so a simpler way to put it is that it is just a peer-to-peer it's peer-to-peer file sharing right peer-to-peer storage yeah its peer-to-peer storage and it's not just for any file right it's not just for you know like your photos or your mp3s it's actually for all files on the internet all files on the web are sort of like that's the goal behind ipfs to store to provide a decentralized distributed storage layer for the web and this project isn't actually directly part of the etherium project it's a separate standalone project but it plays very nicely with block chains and we'll see how it does that in a second to use ipfs it's really simple you just upload a file to ipfs and ipfs will give you back a hash this hash this ipfs hash serves as a unique identifier for your file globally right so if anyone else around the world were to upload that exact same file to ipfs they would get the exact same hash so that's one of the properties of ipfs that it sort of uniquely identifies a specific version of a file right but if I modify that file then the hash will change right then the ipfs hash will change and I'll have to re-up load that changed file to get the new hash so that's how I PFS you know works in a nutshell and the purpose of ipfs is to replace HTTP right so right now when we download a file over HTTP we're usually we usually connecting to one central server and we download one file at a time right and what ipfs is saying hey don't don't just connect to one server right if there are peers around you who are closer to you who have that file you can actually get that file or parts of that file from multiple peers right so it kind of becomes like almost like a torrent like you're receiving parts of the file from different peers in the network instead of connecting to only one central server to download the file so that's kind of the idea behind EFS and it's actually trying to replace HTTP there are some other inefficiencies with HTTP that is covered on the IP FS website but I'm not going to go into details on that here I encourage you to check out their website at ipfs IO check out their documentation examples lots of great knowledge on their website and yeah like I said it can be used with block chains like aetherium so if you're familiar with the area Miu may know that storage is actually kind of expensive right and you can actually store large files on the blockchain because of how expensive it is so IP FS is sort of like this complementary technology that you can store your large files on and you get you would only have to store the ipfs hash on the blockchain right so that kind of becomes a way to reference a file that lives off the blockchain but the hash guarantees that the file hasn't changed right as long as the hash is the same the file is the same so that's kind of how they would interoperate with each other I'm just gonna show you quick demos of how to use IP FS so to install it you go to ipfs dot IO and just click on the install tab I'm not gonna do that right now but yeah you just download a simple installer and install it to your machine and then we can use it on the command line I'm just gonna move this over okay so once you have ipfs installed right you can check real quick that you have it by just checking your IP FS version all right so it's installed and it's working and the first thing you have to do is initialize your IP FS local repository right and you do that really easily by just saying ipfs init my repo is already initialized so it's gonna complain saying hey you already have a configuration file and you shouldn't override it right and so it creates this ipfs cache or local repo in your home folder right so that dot ipfs folder is gonna store my ipfs files that i request from ipfs and another thing that i PFS in it does is it generates a what's called a peer identity right which is just a key pair that identifies you on the ipfs network right just like aetherium you have a key pair that identifies you on the network with IP FS in it you get a separate key pair to identify you on the ipfs network and yeah if you want to see more available commands just ipfs help we're gonna look at a few simple commands there's quite a bit over here but we're just gonna look at some simple stuff so let's try uploading a file to ipfs first and I'll try to I'll try to use the same file as I did in one of my earlier workshops right and I can see that I have three files in this folder one is my key file when is my HTML file and now there is a a ether slug that I was using to deploy but let's try and upload this index.html to ipfs so we would just say ipfs add index dot HTML all right let's run this awesome so it's it added it to the ipfs Network and it generated this ipfs hash that uniquely identifies this index.html file right so as an example to see how the hash changes I'm just gonna change one character in index.html and then we'll try to add the file again I'm gonna show that in a second all right and all I'm gonna insert is one space right that's all I did I'm gonna save the file alright and now if I try to say ipfs add index.html again it gave me a different hash right so it's kind of like a version timestamp for the file right so we can refer to specific versions of this index.

html and we can sort of create like a history using these ipfs hashes right where we can keep track of that history of the changes to that file right and if anyone else in the world were to upload that exact same index.html they would get the exact same IFS hash right so ipfs would just attack that hey this file already exists on my network and oh here's the hash so it wouldn't have to re-upload it again because it's already there so that's a simple ad now once you have the hash right once you've added it to the ipfs network we can then run some other commands on it right like we can view a specific IP FS hash by typing ipfs cat and then the hash of the file right and it will print out the HTML that we had that I wrote earlier on and we can see that it has the space as well so ipfs cat only works for files right so if this was a if this hash referred to a folder ipfs cat wouldn't work right I would have to use a different command let me bring this up a bit so if my hash was a folder I would just do ipfs LS and then the hash so that hash isn't actually a folder so I'm not gonna do that okay let's try uploading this folder now right so you want to recursively upload this particular folder that I'm in right now let's see what that would look like I'm just gonna remove my account dot JSON file for now you probably should be more careful doing this but I'm just doing that off-the-cuff so okay let's say I wanted to upload this entire block Explorer folder to ipfs alright so I would still say ipfs add but I would just pass past this our option to tell it to recursively add the files in this folder and I just say dot and we can see that it added so it added the slug file and then it created ipfs hash for it it added the index.html and it's the same hash as we saw before and it also added a entry for the directory itself right so I can take this ipfs hash that references my folder and say ipfs cat oh sorry not cat because it's not a file we have to use LS and it'll print out the contents of that that folder for me okay so that's some basic usage of ipfs you can upload a file and you can view an IP FS hash in your terminal but what if you want to actually view the file itself like in a browser or something right like let's see how we would do that so let's say I want to view this index.html in a browser so what I would do is open up my browser and so there is a main sort of it's called a public gateway for ipfs atom ipfs dot io / IP FS and if we just paste in the hash or the text is kind of small but I just typed in ipfs io / IP FS / the hash right and if I click enter inside the we're sorry let's try that again and so the first time you know we load up a file from ipfs is gonna take it's gonna take some time because what's happening is we uploaded that file and it has to propagate through the network right so now that I've requested it from the public gateway on ipfs io it's gonna it's gonna look around its network and see who actually has this file and since I'm the only person that has this file it's gonna have to connect to me to get that file but okay so since this will take a few minutes where you can actually do to make it appear quicker is run an IP FS node locally right and you can do that through the terminal so while we wait for this to load so back in the terminal we can say ipfs demon right and this will start up an ipfs node running locally and it's running on port 8081 I think I changed the default the default is 8080 but I changed it to 80 81 right so if I go to my browser and this one is still loading and I type localhost 8080 1 / IP FS / will happen there yeah I felt like I heard something turn off as well I felt like I heard like a thud or something no I don't I don't believe it will it will be unique yeah it's not it's not relative to the directory that it's in yeah yeah because like in the example that I saw like when we when we uploaded the HTML file individually it gave me the same hash as when I uploaded the whole file yeah yeah so you can so the reason why it's taking so long is because not a lot of nodes in the network know about this hash right now right but you could proceed like you said right you could sort of you know set up your own notes right that will provide this file to two other users of your network right so that that's another way to get a faster low time from the network than just going through the public gateway that's an interesting question I imagine it would take the contents of the folder into consideration when it's calculating that hash yeah the privacy and security features I mean this is just for like like public file-sharing right there like the the security features you could build by you know integrating it with etherium for instance right so you don't actually give someone the file hash or you you you hold back the file hash from them until whatever they make a payment or something but ipfs itself doesn't I don't believe it it provides encryption I could be wrong about that they could have encryption but I don't think they do it won't find it it won't find it yeah because if you were the only person with that file then yeah like it won't be able to find it no like the hash is public if you have the hash you can access the file ya know so this is only the first time right so because this was the first time we loaded it through the public gateway right it's gonna take some time for it to propagate through the network but the second time we go it'll be like snappy like what's the for a faster pace no time you would have to do something like proceeding where you you know create your own ipfs nodes that already have that file right all the files that you want to distribute and then as other people request that file they'll get copies of it too yeah right right when they request it you get you get you store a copy of it yeah and then you can you can be the sender to someone else that wants that file yeah it resulted in a collision yeah I mean it's it's possible but like highly improbable right just given the size of of the hash but has the same with like aetherium right like you could generate an aetherium account and right like it could be someone already has that account right yeah okay it looks like we're having some screen difficulties here no so you don't have to pay so there's no payment involved in this right like this is like you can run your own IP FS node you know ipfs itself also tries to run nodes for the community but it's a community project right like so you can come and also set up your own IP FS nodes and that will strengthen you know the speed of the network at the speed at which you know files can be propagated because they're more likely to be available at different nodes so how do they choose which ones to host like which files to host well do they choose which block I'm not I'm not sure about that I'm not sure about that can you remove files files can be forgotten but once it's on there it's on there like you can't say hey remove this file now not to my knowledge you can't you can't remove it yeah because you don't know who else has a copy of it right so you can't be like hey remove it like yeah yeah we should have to screen backup shortly to forget a file it just means that like people not enough people requested it they didn't have copies of it and let's say like you were running a node and you had the only copy of that file and you like whatever you couldn't afford to run the node anymore then that file is forgotten yeah okay so those were the basic usages of ipfs that I wanted to show you if you have more questions or you want to learn more about ENS or ipfs just come talk to me off station and we can help you out thank you okay so one thing that was kind of sad just happened as you can tell we had someone tried to plug in a to an outlet over there it tripped a breaker I don't really know what that means but it exploded oh and that meant that we've lost power to things over there that may have made us lost power over here so we are trying to get the screen back on by connecting to a different power source or something these are the trials and tribulations of this 1920s car showroom so that is the sad news but we got Tim here working on it and we'll see what happens the other news is I think so we just had Comcast here for a very extended period of time plus our Wi-Fi internet team working people should try the internet right now and give me a raise in your hand ooh who has internet okay we're kind of getting closer does it feel does it feel better than in the past yeah okay so I think we should have internet back so that's that's good news yeah but we still definitely have that sad news here so in theory Elena is going to talk about non fungible tokens and ERC's 7:21 and crypto kitties like things in a bit but she has a very visual presentation so we'll kind of keep you updated on that I need to be going in five minutes or be going in something like 15 so thank you again for your patience

Automatic transcript — names and jargon may be misspelled.