🧐 Problem
Web3.storage offers the possibility of storing a file on Filecoin and IPFS by simply uploading it to the website interface. But what if a client of another blockchain (the “host blockchain”) wants to store a file it on Filecoin natively from the host blockchain? To be able to offer this service, we aim to provide a Web3.storage bounty.
This is a contract that automatizes the storage of files on Filecoin and IPFS giving host chain clients storage guarantees on the host chain itself.
💫 Solution Overview
👥 Users
We have two main entities:
- Host chain clients: Clients who want to store a file on Filecoin/IPFS without directly interacting with those. For example, host chain clients are Ethereum clients.
- Storage Dealers: Special users that can read the state of the host chain and can make deals on Filecoin/store on IPFS. In our context we are focusing on web3.storage as the storage dealer.
📌High level protocol
In the high level, we need a smart contract to have three main functionalities
- Create Deal Proposal: The host chain has a “Propose Deal” function where the host Client can specify the file he wants to store and other storage parameters (eg, duration, payment, etc). Note currently web3.storage services are free of charge for the client, so there is no need of payment for now.
- Accept Deal: The host chain has a "Deal Acceptance” function where a Storage Dealer accepts a deal from an host Client.
- Bounty Claim: A Storage dealer who accepts a Storage Deal on the host chain, stores the file on Filecoin/IPFS and provides evidence of the storage being successful on the host chain. Note that, in principle, after this step is finalized, the storage dealer gets a “bounty’ (the payment) for the service provided. This not apply to our scenario for what we already mentioned above.
- If we consider the storage deal (web3.storage) trusted, for this last functionality we don’t need any other trusted party, who provides the evidence of successful storage;
- Otherwise, we would need a “Storage Oracle”.
🎯 Tools needed:
In order to implement the protocol mentioned above, we need two main tools:
- File Sharing Tool: The file should be made available to the Storage Dealer from the host Client. This can be done via IPFS
🖇️ Links
Spec:
Code: