ProofOfThought

Does Storing a File's Hash on a Blockchain Mean the File Is Stored There?

Does Storing a File's Hash on a Blockchain Mean the File Is Stored There?

It is possible to save a hash of a file to a blockchain without having the entire file saved to the blockchain. This is something completely different, and this distinction should be clearly understood.

A hash is a constant length string of digits that represents the result of hashing of any kind of information through cryptographic function. No matter how big the text file or image may be, it is able to produce a short hash. If the file is changed in any way, its hash will also be different in most cases.

For instance, consider the situation when one uploads a document to the Internet, and then records its hash through the SHA-256 algorithm in the blockchain. At a later time, some user will download this file, and calculate its hash with the use of the same function. This will serve as a proof that the document downloaded corresponds to the original.

However, the blockchain itself will not have the document. The document should be stored somewhere else, e.g. on a server.

As per Ethereum documentation, storing a hash in blockchain allows verification of off-chain data without saving the entire file. <Cite refs={["turn489754search1"]}/>

In cases where a blockchain stores only the hash, the corresponding file may be stored on a traditional server, on users' computers or even on a distributed network like IPFS.

The IPFS storage system works with content identifiers (CID) used to identify content using its data. The CIDs have something to do with cryptographic hashes, but the CID is not necessarily equal to just a file hash. IPFS may break a big file into chunks and arrange them somehow. <Cite refs={["turn489754search0","turn489754search6"]}/>

And here is the last point: a hash does not guarantee that the file will stay available. If the server is lost or no one will store this file any more, the blockchain still can have its hash, but retrieving this original file may become rather hard or even impossible.

Which means that the storage strategy does matter. A distributed network may help make copies, but the availability of a file depends on other factors.

So, to put it shortly, the blockchain helps verify that a certain file corresponds to a certain value stored in the blockchain, while another system stores this data itself.

How do you rate this article?

4


ProofOfThought
ProofOfThought

Just someone curious about crypto and the future of finance. I write about Bitcoin, blockchain, investing, and the lessons I've learned along the way. No hype, just honest opinions and real conversations.


ProofOfThought
ProofOfThought

Honest thoughts on Bitcoin, crypto, and investing. No hype, no unrealistic predictions just simple ideas, market insights, and lessons from the journey.

Publish0x Publish0x

Reward the author with $0.01 in crypto, and earn yourself as you read!

20% to author / 80% to me.
Rewards are FREE. Publish0x pays them, not you.

Page not displaying correctly?