IPFS: A Global CID - Matt Ober
Ethereum Denver·Sat, Oct 9, 2021, 12:00 AM
This talk is from ETHDenver & ColoradoJam , the world’s largest Web3 BUIDLathon and Community Gathering. ETHDenver’s content is crypto and blockchain focused. Learn more: ethdenver.com Subscribe to our channel to learn more + connect on Twitter: https://twitter.com/EthereumDenver. Speaker: Matt Ober, IPFS This talk was recorded Friday, February 5th, 2021 ETHDenver 2021’s content themes included DeFi & Money Legos, NFTs & the Creator Economy, ColoradoJam & the Next Frontier of Statehood, Protocols & Interoperability, Open Source & Public Goods, The Ownership Economy & Digital Orgs, Usability Design & Adoption and Legal, Privacy & Identity. Industry experts also weighed in on topics like decentralization, privacy, identity, non-fungible tokens, scaling, governance, diversity, and arts and culture in blockchain technology. The 2021 event was February 5-12 and hosted virtually in 2021 with 5000+ blockchain enthusiasts, developers and community members from 80 countries and 50 U.S. states. 🔴 SUBSCRIBE ETHDenver’s YouTube https://www.youtube.com/channel/UCgz9NU06t_FkT0Py1Vadczw 💡 LEARN ETHDenver’s Official Website https://www.ethdenver.com/ 👋 CONNECT ETHDenver Twitter https://twitter.com/EthereumDenver 📖 READ ETHDenver News on Medium https://medium.com/ethdenver 🛍️ SHOP ETHDenver Official Merchandise bufficorn.com 💬 CHAT Telegram https://t.me/Ethdenver Discord https://discord.gg/AxFmNdCVnU 📱 FOLLOW LinkedIn https://www.linkedin.com/company/ethdenver Instagram https://www.instagram.com/ethdenver/ Facebook https://www.facebook.com/ETHDenver/
Transcript
moving on to our next uh we have ipfs talking about uh global cids so we've got matt ober joining us from that group do we have matt hey matt hi there you guys all hear me yeah you got the you got the right uh t-shirt on the pinata i've got it on twitch i can't hear it all right cool well thank you for that great talk matt um that was super informative and it's actually a great segue into the talk i'm giving today so instead of talking about on-chain data i'm going to be talking about off-chain data and this talk is called ipfs the global cid so i am matt ober i am the co-founder of cto and cto of pinata and we like to call ourselves the easiest way to use ipfs at our core we are an ipfs pinning service that runs ipfs infrastructure we actually started as ethereum developers building blockchain applications and this is our fourth east denver so we're super excited to be back we really love this hackathon and look forward to coming back for many years um so this week at pinata we were creating an nft on ethereum and if any of you have been trying to deploy smart contracts recently you'll be familiar with what we experienced uh to deploy a very basic smart contract token uh it cost us about two hundred dollars uh in ethereum were we perfectly optimized you know of course not we're not smart contract developers we're ipfs developers uh but the contract was still pretty simple when we tried to buy our token on the network things got even crazier major wallets were estimating that it would have cost anywhere from fifty dollars to about uh one point two thousand dollars to buy our own nft which was uh pretty crazy so now while gas prices are necessary uh to run ethereum and ethereum 2.0 is probably going to help solve a lot of these problems i bring this story up uh to point out one thing and that it's storing any amount of data on chain that is more than absolutely necessary is often counterproductive to building a good application on ethereum so what should you as an ethereum developer do the answer is to go off chain so putting your images or documents off chain or any larger type of data can be often cheaper and accessed quicker than on chain data for this reason many projects are choosing to store their off-chain data in places like say amazon s3 after all storing your off-chain data in a simple s3 bucket seems awfully tempting when the alternative would be to spend thousands of dollars per megabyte of data stored on chain let's wait a little bit here um what are you sacrificing when you store your off-chain data in a traditional web system like s3 and the answer is pretty simple uh you're giving up pretty much everything that makes ethereum and blockchain applications so valuable uh your your off-chain data is not cryptographically secured it's not cryptographically verifiable uh and then finally your off-chain data isn't accessible in a decentralized manner uh so what what can we do here the best answer that we have is to secure as much of your off-chain data using a system like ipfs and why is that uh why is ipfs better than a traditional web system like s3 so let's start from the top ipfs or the interplanetary file system as it's called is a content addressable file system and what this means is that files uploaded to the network are addressed by the file itself instead of where the file is located so let's take a look at what this looks like in practice when you upload data to the ipfs network ipfs is going to provide you back with a unique hash otherwise known as a content identifier or cid for short this is a super important term that you'll see a lot of in this talk so when you want to grab data from the ipfs network you simply provide that same unique cid back to ipfs and it will return you the data that you asked for no matter where it is stored and this can be done in a variety of ways for example you can run a node as part of your application that directly interacts with the ipfs network or you can use one of many ipfs gateways that exist for users to retrieve content from the ipfs network directly in browser or via api the important thing to note here is that you're not restricted to a singular method of accessing content on the ipfs network and this is super important for decentralized access to data it doesn't matter where or how the content got onto the ipfs network what matters is that you can retrieve it from anywhere and then with all of these different ways of accessing content though how do you know that you're getting back the right content so we need to trust the data and we can do this through the cid a contents cid natively allows you to trust the data itself instead of who or where that data came from and why is the cid so trustable many of you are probably watching carson farmer earlier today he had a great image that he so kindly let me utilize for this presentation and it it displays this pretty well so let's take this nice image of a cat we have here when you add a file to ipfs it starts by breaking the file down into multiple chunks that are often or that are ran through a hashing algorithm if there's more than one chunk for the file a base cid is created that points back to all of the children's cids that the file is composed of so if you upload the same file two times in a row you're going to get back the same cid back twice in a row however if you change even one pixel or one byte of your file the cid is going to be completely different and then when you retrieve the file from the ipfs network you ask for it directly by the cid and then an ipfs node will retrieve the content it's asking for and when it does this it's verifying that content is what the cid says it is so if the file was tampered with or changed anyway and you know the node is trying to give you faulty data your node is going to realize hey this data doesn't match up with the cid that i'm supposed to be retrieving so therefore that we know it has been tampered with and i don't want to trust this data basically things will fail so this means that you know with certainty that when you're retrieving a file you know that it's the original file that was uploaded and it's exactly what you've been asking for so can when combined with ethereum uh ipfs allows you to cryptographically secure verify and distribute data globally based on where it needs to be for your ethereum application we like to say that ipfs is the peanut butter to ethereum's jelly let's relate this to nfts many of you are probably familiar with nfts on this slide uh you can see that we have an nft pointing to a traditional web technology url i'll say you know it's s3 or a traditional server on the back end so we're pointing to myserver.com blue pinata this is the image that we have for our nft token now the problem with this is that this could actually point to three different things it could point to say the image we are expecting which is the blue pinata or at any point in time the data could be moved elsewhere at which point you would receive say a 404 error the server's decided that it doesn't actually want to host the blue pinata at that location anymore maybe it wants to store it at myserver.com images bluepinata so the url has changed and you'll no longer be able to find the file at myserver.com bluepinata and then the last option here is that the server could completely change the underlying data without the user knowing so they could say change blue pinata to instead return a purple pinata and at which point the data has been tampered with and the nft is no longer pointing to the image that it was initially uploaded with uh so this kind of invalidates all of the security that nfts are supposed to represent on ethereum and so how are nf ipfs cids different so let's imagine myserver.
com is now an ipfs gateway so you know ipfs io slash ipfs slash bluepinata or maybe it's an ipfs node trying to grab the content from the network instead of asking the ipfs network for the content based on where it's at aka you know with the url we're going to ask the ipfs network hey get me the content for this cid and since the blue pinata image returned us a cid and that's what we're asking the network for we're guaranteed to get back what was initially uploaded and not a grace not a you know a gray pinata a pinata or a purple pinata or even a missing pinata you're going to get back the blue pinata as long as it's being hosted on the ipfs network okay so another example here let's say we're not using nfts let's say that we have a legal document maybe it's a house deed for example it's been put onto ipfs and that hash that we've gotten back from ipfs is stored on ethereum at a later point in the future the legal system an attorney a judge could say okay who owns this house they'll grab the hash from ethereum and then they will ask ipfs for the content for that hash and they'll get back the content that was initially uploaded the deed says hey it's in this person's name it's verified all the basically metadata of the house is there and you can see the history of it we're getting back what we initially expected this is very valuable in systems where you need to be sure that things happened at a certain point in time [Music] or that the data is you know what you expect it to be so another thing that is important to know about is who is responsible for data on ipfs okay so we know that ipfs is cryptographically secure verifiable globally accessible which matches what i would ethereum applications need very well but who's responsible for that data on ipfs with ethereum a minted nft or other transaction exists forever once the gas fee is paid and put on chain so data exists forever on chain but for ipfs this isn't true and this is because uh the the reason for this uh is the same reason why ipfs is able to uh you know store larger amounts of data than exists on-chain you're not paying for it to be replicated on thousands and thousands of nodes you're basically just making sure that it exists on the ipfs network and is accessible so the question becomes then uh who's responsible for that data should the platform be responsible should the creator of the data what about the buyer of the data or you know the seller uh you know how should responsibilities be defined and this is the biggest friction that we see with over now the 10 000 devs we have building on pinata right now trying to figure out who is going to be responsible for data on ipfs so let's return to our nft example nfts can be transferred transferred between accounts and a platform might mint the token for the creator at a point in time the creator might sell that nft to a buyer and then they might sell it to another person in this process no one has defined who's going to pay for that off chain data to exist there's a disconnect here again the platform the creator of the buyer a collaboration of all of them when data is cryptographically secured on ipfs uh the and the ownership of that cid can be attached to a token or an account so we need to define who pays for data to be hosted or who's responsible for hosting that data that's stored off chain in most cases this turns out to be the person that cares about the data the most in the beginning this is often the artist or the app platform however over time as asset ownership changes the buyers of digital assets may want to host the content themselves to make sure that it never goes offline and then the two two best ways of making sure that the data stays online are either hosting it yourself by running your own nodes or by paying someone else to keep it online for you similarly to how the mona lisa isn't being maintained you know by the artists that created it a long time ago now it's maintained in museums similarly uh artists shouldn't be responsible for keeping their nft data online forever so if you don't want to host your own node and maybe once you get started hosting data quickly for your ipfs or your hackathon project consider checking out pinata to get you going quickly pinata lets developers quickly start using ipfs through an easy to use api that lets you store data on ipfs quickly we've been focused solely on ipfs for about three years now and our entire mission is to make ipfs as easy as possible to work with we've included a free tier of one gigabyte of storage that can help you get started quickly and then for developers that need additional performance and speed as you scale we offer dedicated host nodes and gateways to give your users the extra speed they deserve when working with ipfs and then also as always if you have any questions throughout denver about ipfs or pinata feel free to stop by the virtual ipfs help desk or hop into our community slack we're super excited to see what you're going to be building and then in conclusion trust through cids cids allow applications and users to define data transfer data responsibility and data access globally by building your ethereum application and timestamping ipfsc ids on chain it creates a way for you and your users to trust your off-chain data with the same level of trust that you would expect from your on-chain applications as well uh so happy pinning i'm matt i'm from pinata and we are looking forward to seeing what you guys all create this denver
Automatic transcript — names and jargon may be misspelled.