IPFS And Metadata Immutability

Transcript

Toggle full transcript
00:00

Hello and welcome to chapter five of the Create, Configure and Sell NFT collections on ImmutableX course. In this chapter we're going to be talking through how to Mint at scale.

00:10

What are the different techniques that can be applied to Mint at scale, and what are some of the recommendations that we have that are useful techniques based on our

00:20

experience to assist with doing this. The first lesson is IPFS and Metadata Immutability.

00:30

Immutability is a really important property when it comes to NFTs. It's something that is talked about a lot and there are a number of different

00:40

techniques and capabilities that can be used to exhibit this property. A key thing to talk about is IPFS or the InterPlanetary File System.

00:50

IPFS is a peer to peer decentralised storage network.

01:00

And the way that it works is it allows you to store immutable content addressable storage. So what does that mean? Well, immutable basically means it can't be modified.

01:10

Once the data has been entered into IPFS, you guarantee that that data cannot be tampered.

01:20

And then content addressable storage is the way that IPFS implements immutability. The basic idea is that the content of the data that you store determines

01:30

the ID that looks up that content. Thus, if some data was "tampered with" and modified,

01:40

it would actually have a different ID. So as long as you have one of these what's called a content ID, which is the mechanism that's used to address content, then you can guarantee that if IPFS

01:50

has that data still, that it will return the exact same data that was originally entered that resulted in that ID.

02:00

Now content can either be a single file of pretty much any file type, or it can actually be an archive with multiple files within it.

02:10

Now similar to the way that you would reference a web page using the http:// or https:// protocol.

02:20

IPFS has a protocol defined of ipfs://. So often you might see an IPFS URL expressed as

02:30

ipfs:// and then the content ID. So here's an example of a real IPFS URL for a

02:40

single text file that has the text "HelloWorld" in it. Now, a key thing to point out is that you can't go into a web browser

02:50

and type in ipfs:// and then this content ID, or any other content tied for that matter, because web browsers, at least at this point in time, don't understand IPFS natively.

03:00

Now, in order to create a bridge from the IPFS protocol to the let's call it Web 2 world that we all know and

03:10

understand and are used to, there are things called IPFS gateways that essentially expose IPFS functionality over HTTPS.

03:20

There's a whole heap of different gateways out here. Here's a couple of examples. ipfs.io and cloudflare-ipfs.com.

03:30

But there is hundreds of others. Now, it's worth pointing out that sometimes when you request a file in IPFS,

03:40

the file will not get returned because that gateway didn't have the content and it either timed out or wasn't able to find that content in

03:50

other nodes in the network. Now, to give you an example of how this content ID works, let's look at this example here.

04:00

These two content IDs both correspond to a single text file with some simple text in it. The first content ID corresponds to a text file with the text: "HelloWorld".

04:10

The second content ID corresponds to the text: "HelloWorld!".

04:20

Those two values are very, very similar. But as you can see, the content ID for IPFS are quite different between them and this has content addressable storage at work.

04:30

The content in the data that you are storing literally determines the ID that you use to look up that data.

04:40

And that's how immutability is guaranteed. If you have an IPFS URL, then assuming the IPFS network is able to retrieve that data, you can guarantee that the data it retrieves is the

04:50

exact same data as it was when it was first entered into the network.

05:00

Now talking about IPFS leads on nicely to a discussion about metadata mutability. Broadly speaking, if you want to represent metadata on ImmutableX, you've got

05:10

two broad options. One would be to use IPFS or something like it, and the second one would be to use a traditional "Web 2 API".

05:20

And this might be something like a link to, say, AWS S3 Storage or Google Drive or any URL that you decide.

05:30

From an IPFS perspective, it's worth pointing out that because IPFS is immutable, once a file is uploaded to IPFS,

05:40

it cannot be modified. It also can't be deleted. But it is possible for that data to disappear because IPFS

05:50

as a protocol doesn't guarantee permanence. Now there is a concept called pinning, and what this means is that you can pay an

06:00

IPFS provider to pin a piece of content such that it is always made available to the IPFS network.

06:10

The interesting thing about IPFS is because it's a decentralised protocol. You can pin any content that you care about.

06:20

So an individual NFT owner potentially could pin the metadata for their NFT. And separate to that, the collection owner of an entire

06:30

collection of NFTs could potentially pin the metadata for all of the NFTs in that collection. Now, if we look at a Web 2 API, the difference here is that it's really easy

06:40

to modify or delete metadata because you can be in full control over what is returned. So this gives you a great deal of flexibility,

06:50

but it does mean that there's a vulnerability for unauthorized changes or deletions because the Web 2 API does not give you any

07:00

guarantee of immutability or permanence. So it's worth keeping these pros and cons in mind when designing your metadata strategy and how much you and maybe your users

07:10

and community care about immutability for the metadata of your NFTs.