Can IPFS pinning be monetized in a decentralized way using only oracles and smart contracts?

Basic functionality:

  1. First of all, the pinner and the user (demander of the service) make a smart contract in which the pinner only gets the money if he fulfills some conditions: time period, availability...
  2. In the contract, there's a list of several oracles chosen by both the pinner and the user.
  3. The job of these oracles is to check periodically that the file is available through IPFS.
  4. If a determined percentage of the oracles report that the file is missing for some time, the conditions of the contract decide who gets the money (either the user or the pinner).

The problem is, how can oracles verify that the pinner has the complete file without needing to send the whole file to each oracle? As I see it, each oracle should have already a copy of the file for this to work, thus it would make sense that the oracle be also a pinner, and vice versa.

The verification step:

  1. Checking that the file is IPFS accessible: If each oracle has the file, then they only need to ask the pinner for a few random bytes of data through IPFS. The smart contract determines how much delay there can be in receiving those bytes. However, this only proves that those bytes of the file are reachable through IPFS, but not that the pinner has the whole file. Also, the minimum size IPFS allows sending is 250kB blocks. Wouldn't that be too much overhead?
  2. In order to prove that the pinner has the entire file, let's suppose that there exists an algorithm that provides something like this:

    a. There's a random nonce generator which generates a new nonce at random intervals (the generator could maybe be an oracle).

    b. The nonce is sent to the pinner and the smart contract, with a timestamp.

    c. The pinner hashes the file with the nonce and his signature (using some special hash function), and sends the new hash to the smart contract.

    d. If there's too much delay in sending the new hash, the contract is broken.

    e. If the delay is within the limit, then the smart contract uses the algorithm which:

  • Can prove that the new hash could only be produced with the entire file; it wouldn't work if the pinner only had the hash of the original file.
  • Having only these four elements (original hash, new hash, signature of the pinner, and nonce) it can be proven that the whole file has been hashed with the nonce and the signature.
  • Does such an algorithm exist?
submitted by /u/deojfj to r/btc
[link] [comments]
Quelle: bitcoin-en