how Blockchain is storing images and videos?
Blockchain usually does not store large files directly, such as images or videos. This is because blockchain has limited storage capacity and storing large data on it is very expensive. Therefore, other methods are used to handle this.
1️⃣ Off-Chain Storage + Hash on Blockchain
This is the most common method.
How it works:
The image or video is stored on an external storage system.
That system generates a hash (a unique digital fingerprint) of the file.
The hash is recorded on the blockchain.
Anyone can verify the file later by comparing its hash with the one stored on the blockchain to confirm that the file has not been changed.
Examples of storage systems:
IPFS
Arweave
Filecoin
📌 Example:
When an NFT image is minted, the image is usually stored on IPFS, while the link or hash is stored on the blockchain.
2️⃣ On-Chain Storage (Rare)
In some cases, images can be stored directly on the blockchain, but:
The image is usually compressed or encoded.
The files are typically very small.
Examples:
CryptoPunks (partially on-chain data)
Autoglyphs (fully on-chain art)
In these cases, code or pixel data is stored directly on the blockchain.
3️⃣ Encoding (Base64 or Hex)
To store an image on the blockchain:
The image is converted into text format.
For example, Base64 encoding is used.
The encoded data is then placed inside a smart contract.
However, this makes:
the blockchain heavier, and
gas fees more expensive.
✅ Summary
Method
Where the image is stored
On-chain
Directly on the blockchain
Off-chain
On systems like IPFS or Arweave
Blockchain role
Stores the hash or link
💡 In the crypto and NFT ecosystem:
Blockchain is used to verify ownership.
Storage networks like IPFS or Arweave are used to store the actual images or videos.