application-research / outercore-eng-kb

Official Knowledge base repo of Estuary
https://estuary.tech
5 stars 0 forks source link

Estuary FEVM Oracle Library and Oracle Execution Provider #18

Open alvin-reyes opened 1 year ago

alvin-reyes commented 1 year ago

Proposal: Estuary FEVM Oracle Library and Execution Provider

Contributors @alvin-reyes, @kelindi  
Status Draft
Revision  

I had a discussion with @kelindi on potentially creating an Oracle Service that will use Estuary as the execution provider.

Proposal

The idea is to create an Oracle library in Solidity that will run URL or Service request to Estuary.

Components:

Details or the design to follow

alvin-reyes commented 1 year ago

Added the components. We will need queuing to associate each job as a topic on NSQ and execution provider can consume the commands which will return the off-chain results.

alvin-reyes commented 1 year ago

Sharing the flow here from my discussion with Alison Haire (Ally, developerAlly)

1 - smart contract developer wants to "GET" a file on IPFS via http
2 - smart contract developer imports the oracle.sol
3 - smart contract developer calls the oracle.sol, passing the "URL", "GET" function and a execution provider ID. This will be saved on a []mapping.
4 - the execution provider reads the same contract and look to the provider list of request (on the []mapping). It'll then get the meta, execute, persist the result on IPFS, and return the CID
5 - the CID is persisted on the results meta of the oracle contract
6 - smart contract developer will get back the result CID from looking up the results mapping.
alvin-reyes commented 1 year ago

https://filecoinproject.slack.com/archives/C016APFREQK/p1683222898539079