I’ve been trying to understand how NFTs work on the blockchain. Some people say the whole digital file is stored there. But that doesn’t make sense to me. Wouldn’t that make the blockchain super big?
I thought maybe it’s just a hash of the file and where to find it online. That seems more logical. But I’m not sure.
If it’s the whole file, how would that work for big stuff? Like if someone wanted to make an NFT of a full-length movie. That would be huge!
Can anyone explain what’s really stored on the blockchain for NFTs? Is it different for small files vs big ones? I’m curious how it all works under the hood.
def store_nft_data(asset):
# Example of what might be stored
hash = generate_hash(asset)
location = upload_to_storage(asset)
blockchain_entry = {
'hash': hash,
'location': location,
'metadata': get_metadata(asset)
}
return blockchain_entry
This is just my guess at how it might work. Can someone who knows more about NFTs explain the real process?
Your understanding is correct. The blockchain doesn’t store entire digital files for NFTs - that would be impractical and expensive. Instead, it typically contains a unique identifier, metadata, and a URI pointing to where the asset is stored off-chain (often on IPFS or similar decentralized storage systems).
This approach allows for efficient on-chain transactions while maintaining the integrity and uniqueness of the NFT. The hash ensures the asset hasn’t been tampered with, and the metadata provides essential information about the NFT.
For larger files like movies, the process is similar. The blockchain entry would still be relatively small, containing just the necessary identifiers and links.
It’s worth noting that this off-chain storage model does introduce some potential risks, such as link rot or service failures. Some projects are exploring ways to mitigate these issues, like using multiple storage solutions or implementing on-chain backups for critical metadata.
hey there pixstar! i’ve been digging into nfts too and its pretty fascinating stuff. you’re on the right track with your thinking about hashes and file locations. from what i’ve learned, the blockchain usually just stores a tiny bit of info - like a unique identifier, some metadata, and a link to where the actual artwork is stored (often on IPFS or similar).
it’s kinda like how ur computer doesn’t store all ur photos directly on the hard drive - it has a system that knows where to find them. same idea with nfts.
but here’s a question that’s been bugging me: what happens if the off-chain storage fails? like, if IPFS goes down or something? does that mean the nft becomes worthless?
anyone have thoughts on that?
also, i’m curious about how different blockchains handle nft storage. does ethereum do it differently than, say, solana? might be worth looking into!
ur right, storing whole files on the blockchain wud be crazy expensive. NFTs usually just store a pointer to where the asset is (like IPFS) + some metadata. the actual image/video/whatever lives off-chain. its more efficient that way. for big files like movies, same deal - blockchain just has a reference, not the whole thing.