Giter Site home page Giter Site logo

filecoin-oracle's Introduction

Filecoin Oracle on Ethereum - smart contracts

This is an experimental proof-of-concept smart contract for a Filecoin oracle on Ethereum.

It was built as part of the Protocol Labs remote hack week held from February 1st, 2020 to February 5th, 2020.

Architecture

The experimental Filecoin Oracle consists of two parts:

  1. smart contracts - Solidity smart contracts for Ethereum

  2. web oracle - A trusted web service which monitors the state of the Filecoin blockchain


The web oracle continuously monitors the Filecoin blockchain, once an hour processes the state for all deals, and produces a merkle tree root hash of the serialized data. This service is backed by the Filecoin Sentinel.

Users are able to query data CIDs of interest on the web oracle and get a merkle inclusion proof with all the relevant data for the data CID at that point in time:dataCid, pieceCid, dealId, provider, startEpoch, endEpoch, signedEpoch

Usage

Once deployed, you can use two of the public methods:

SubmitProof

SubmitProof verifies an inclusion proof and emits a StoredCid event for other contracts to consume.

  function submitProof(
    ...
  ) public {
    ...
  }

VerifyProof

VerifyProof verifies an inclusion proof, similarly to SubmitProof, and returns a boolean to the caller.

  function verifyProof(
    ...
  ) public view returns(bool) {
    ...
  }

References

This code is based on and heavily influenced by the following libraries:

filecoin-oracle's People

Contributors

nonsense avatar zixuanzh avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

Forkers

toure5013

filecoin-oracle's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.