Inspiration
Web3 promises to be decentralized, trustless, permissionless, and autonomous technology. A glance at the current popular IPFS pinning services shows that they still stick to the traditional way of doing things:
- They require you to register an account and pay with a credit card.
- They store the pinned data on centralized cloud storage.
- They require you to trust them they will do what they have promised.
This project aims to provide an alternative, more Web3-oriented approach for pinning files on IPFS:
- No need to register an account or obtain API keys.
- Pay with crypto on the blockchain.
- Store the pinned content on decentralized storage.
- Verify on the blockchain that a specific IPFS hash has been requested to pin for a specific period.
- Optionally, smart contracts can use this pinning approach, e.g. during NFT minting.
What it does
The project uses Storj for storing the pinned content. Storj is decentralized object storage that splits the content into small encrypted pieces and stores them on tens of thousands of nodes across the globe. The project uses the Storj datastore for IPFS to store the IPFS blocks in a Storj bucket.
Storj has its ERC-20 utility token called STORJ. Storage node operators receive STORJ for their service for storing and serving pieces of the data. Users who store data on the Storj network use the token to pay for the service.
A key component of the project is an Ethereum smart contract with a method:
pin(ipfsHash, tokenAmount)
This method allows users and Dapps to deposit a specific amount of STORJ for a specific IPFS hash.
The pinning service listens for events from the smart contract and pins the IPFS hash to an IPFS cluster backed by the Storj datastore. The pinning period is calculated from the content size and the STORJ amount deposited. This period can be extended by sending another transaction to the smart contract for the same IPFS hash. By anyone who is interested in keeping the content for longer in the IPFS network.
The pinning service provides a restricted IPFS gateway. "Restricted" means that it will serve only the data that is pinned on the IPFS cluster. This IPFS gateway can be used as proof that the IPFS hash is really pinned by the service. The gateway is also the fastest way to retrieve the pinned content back from the IPFS network.
The project is currently demonstrated on the Rinkeby Testnet. It can be deployed on any EVM-compatible blockchain like Ethereum Mainnet, Polygon, Avalanche, zkSync 2.0, etc. Some of these blockchains maintain low gas fees, which makes the micropayment transactions feasible with this smart contract.
How we built it
Here is a high-level architecture diagram of the solution.

The blue boxes are the components that have been implemented for this project:
- PIN contract is the Ethereum smart contract that accepts STORJ tokens for a specific IPFS hash. The smart contract is implemented in Solidity.
- STORJ easypin service is the off-chain service that listens to events coming from the pinning smart contracts and pins the IPFS hashes to the IPFS cluster.
- Storj datastore is an implementation of the IPFS datastore interface.
The prototype is currently deployed on the Rinkeby Testnet. We chose it because it has a test STORJ token already available and everyone can easily mint it on https://wallet.zksync.io/?network=rinkeby.
Challenges we ran into
- Pinning NFTs in a single step requires parsing the NFT's metadata JSON so we could pin both the metadata JSON and the NFT asset in a single transaction. We decided it leave this out of scope for the prototype. At the moment, pinning an NFT requires pinning the metadata JSON and the digital assets separately.
- Smart contracts are quite limited in what they can do. We had to make some trade-offs on what logic to keep on-chain and have the remaining logic off-chain. Therefore, the pinning smart contract just keeps track of the STORJ amount deposited for a specific IPFS hash. The off-chain pinning service does the calculation for the pinning period based on the STORJ amount deposited.
- Having a usable user workflow is always challenging. We had a few iterations to come up with the current state and we still feel it can be much better, especially around showing the progress of the blockchain transactions.
Accomplishments that we're proud of
We believe we have built a prototype of an IPFS pinning service that addresses the Web3 promises in the following way:
- Decentralized: The data is stored on the Storj decentralized object storage.
- Permissionless: No registration or API key is required. The pinning process is as simple as sending a transaction to the smart contract. No credit card is required. Payment is done with the STORJ utility token.
- Trustless: All transactions to the smart contract are kept on the blockchain. Everyone can verify if the pinning service is storing the content pinned on its IPFS cluster as promised using the provided restricted IPFS gateway.
- Autonomous: The project can be easily run by a DAO to ensure its autonomy.
What we learned
Working on the project has been definitely a fun time. We learned a lot of new things, but most notably:
- We improved our knowledge of IPFS internals.
- We feel we are more proficient in using smart contracts.
- We researched different testnets and blockchain, and how they are compatible with EVM.
- We know better how to integrate apps with Metamask.
- Kaloyan learned that Marton loves black tea.
What's next for EasyPin: IPFS Pinning Service With Smart Contract
Our colleagues at Storj are already pretty excited about this prototype. We are going to run it through customer validation. If all goes well, the next step is to turn it into a production-ready solution.
This would require some additional research and development:
- Choose an EVM-compatible blockchain with acceptable transaction fees on their mainnet.
- Learn how to run an IPFS cluster in production for high availability and scalability.
- Improve the UX workflow of the Web UI and Metamask integration.
- Code improvements in the pinning service and the Storj datastore for IPFS to achieve production quality.
Built With
- ether.js
- ethereum
- golang
- ipfs
- javascript
- metamask
- openzeppelin
- solidity
- storj

Log in or sign up for Devpost to join the conversation.