Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bounty #2 - Flight Delay Detector DOracle #14

Closed
julienbrg opened this issue Jul 4, 2019 · 41 comments
Closed

Bounty #2 - Flight Delay Detector DOracle #14

julienbrg opened this issue Jul 4, 2019 · 41 comments

Comments

@julienbrg
Copy link

julienbrg commented Jul 4, 2019

What you will learn

  • Feed API data into your Ethereum smart contract using a decentralized oracle.

Prerequisite

  • You must know at least one programming language
  • Basic knowledge of how Ethereum and smart contracts work

App requirements

  • Use case: flight insurance services
  • Data source: a flight API (example)
  • Input: a flight ID
  • Output: delay in minutes

What I need to do?

An iExec DOracle needs two parts: Off-chain dockerized application, and on-chain smart contract.

1. Dockerized application (off-chain)
You need to write a logic that does the following steps:

  • Fetch the data from the API
  • store the hash of the result in the determinism.iexec file
  • store the encoded result (using ABI.encode) in the callback.iexec file

Then, push you docker image on Dockerhub, and deploy it on iExec using the SDK.

2. Smart contract (on-chain)

  • Use the provided template with your app ID
  • Use truffle to deploy the smart contract

Going further: About Decentralized Oracles (optional read)

Programmable blockchains and smart contracts are a big deal, but they live in siloed environments and as such have very limited access to the outside world (i.e. the Internet). The iExec V3 makes it trivial for anyone to deploy his own decentralized oracle, hence allowing developers to leverage the terabytes of data available on the Web 2.0 to build a whole new range of useful and impactful dapps without compromising on the security.

The iExec DOracle uses iExec to execute the oracle logic off-chain and return certified results to the blockchain. Certification can be achieved using a combination of hardware security (TEE - Trusted Execution Environment) and on-chain consensus (iExec’s PoCo). These two mechanism provides tools to ensure results of a DOracle execution can be trusted for the on-chain settlement of off-chain events.

Documentation of the iExec platform, including details about de PoCo protocol can be found at https://docs.iex.ec.

Components of an iExec DOracle.

In order to run, an iExec DOracle needs three essential components:

  1. A dockerized application = off-chain logic that fetches the data your dapp needs.
  2. The output = The data your on-chain dapp needs.
  3. A receiving smart contract = The smart contract that will consume the output.

The app & the output

The dockerized oracle app contains the logic that will be executed and verified by the iExec platform when a call is requested. This logic can be implemented in any language and access any data as long as it can be dockerized and it follows below simple guidelines:

  1. Given a set of input parameters, multiple execution of the same app must provide the exact same results (we say it is a deterministic application).
  2. Output must be encoded in a way that makes it readable on the blockchain. Consider using the abi.encode format.
  3. The result fetched by the appEncoded results (bytes) must be written to the /iexec_out/callback.iexec file. Additionnaly the keccak256 hash of the results (bytes32) must be written to the /iexec_out/determinism.iexec file.

The iExec middleware will perform the consensus on the determinism.iexec file, and will store the callback.iexec file on Ethereum.

The receiving smart contract

The receiving smart contract will be the on-chain receiver that will consume the output. This contract can contain any logic, but it should inherit from the IexecDoracle (available on Github) which provides a routine to retrieve and verify the result of an oracle execution. The PriceOracle shows a good example of such contract.

Security considerations

The iExec framework proposes all the tools to build a secure decentralized oracle. However, simply using the iExec framework won’t prevent issues in the oracle design from threatening the security and the decentralization of the oracle. Here are some points that should be considered:

External resources (such as Web 2.0 APIs) are centralized point of failure. DOracles can forward data from such APIs to the blockchain in a trustless manner, but the data reported on-chain is still subject to manipulation by the API administrator.

If trying to report random values from an off-chain source to the blockchain, be aware that the requester of the call might be able to control the seed. You may want to use additional proof of origin or use commit reveal pattern that only accept oracle calls for which the request has been registered on-chain before the actual value was predictable. In general, providing cryptographically secure randomness to a blockchain is difficult, so don’t try it unless you really understand the different attack vectors.

Design your receiver smart contract to be trustless and censorship resistant. If only a single actor can update it then your oracle might not be properly designed. Anyone with an interest on updating a value must be able to pay for an oracle call that will provided an updated value to the blockchain which nobody can argue against.

Need help?

Again, the documentation is here: https://docs.iex.ec.
Feel free to ask for more information on our Slack.

@julienbrg julienbrg changed the title Flight Delay Detector DOracle Bounty #2 - Flight Delay Detector DOracle Jul 4, 2019
@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This issue now has a funding of 300.0 RLC attached to it as part of the iExecBlockchainComputing fund.

@erazhu31
Copy link
Contributor

erazhu31 commented Jul 5, 2019

Hi i would like to have more info about the app requirement
Use case: flight insurance services
Data source: a flight API (example)
Input: a flight ID
Output: delay in minutes
thanks

@sulliwane
Copy link
Collaborator

Hi @johnlenin00 !

Thank you for your interest in learning how to build a Decentralized Oracle.

Congrats, we just approved your application.

Let's start!

  1. Please join our Slack #tech-support channel so that you can ask your questions to the iExec tech team.
  2. Please post your Slack username in this thread (so we can make the link between your slack and github profiles).
  3. Make sure you read the article: How to build a Decentralized Oracle on Ethereum — A Step-by-Step Guide.

Don't forget to push your code so we can review it.

As soon as your DOracle is working, the RLC are yours!

Reminder: That's part of the Learn iExec & Earn RLC program.

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

18 similar comments
@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@gitcoinbot
Copy link

@johnlenin00 Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@johnlenin00
Copy link

sorry, was gone for a while and forgot about this
I'm freeing up the job for whoever would like to take on it.

@sulliwane
Copy link
Collaborator

Hey @johnlenin00, no problem. Thanks for notifying us!

Hi @mlekena !

Thank you for your interest in learning how to build a Decentralized Oracle.

Congrats, we just approved your application.

Let's start!

  1. Please join our Slack #tech-support channel so that you can ask your questions to the iExec tech team.
  2. Please post your Slack username in this thread (so we clearly make the link between your profiles).
  3. Make sure you read the article: How to build a Decentralized Oracle on Ethereum — A Step-by-Step Guide.

Don't forget to push your code in this repository (as a subfolder) so we can review it.

As soon as your DOracle is working, the RLC are yours!

Reminder: That's is part of the Learn iExec & Earn RLC program.

@gitcoinbot
Copy link

@mlekena Hello from Gitcoin Core - are you still working on this issue? Please submit a WIP PR or comment back within the next 3 days or you will be removed from this ticket and it will be returned to an ‘Open’ status. Please let us know if you have questions!

  • reminder (3 days)
  • escalation to mods (6 days)

Funders only: Snooze warnings for 1 day | 3 days | 5 days | 10 days | 100 days

@mlekena
Copy link

mlekena commented Aug 31, 2019

Slack name: Theko

@sulliwane
Copy link
Collaborator

Thanks @mlekena. Don't hesitate to ask questions in the slack #tech-support channel, and make a PR as soon as you have something so we can give you feedback. Good luck!

@mlekena
Copy link

mlekena commented Sep 3, 2019

@sulliwane Sounds like a plan.

@nikhil3000
Copy link
Contributor

is this bounty still available? I would like to work on it.

@emmaodia
Copy link

Hi @sulliwane If this Bounty is still available, I'd love to get it done. Thank you!

@sulliwane
Copy link
Collaborator

Hi @johnlenin00, @mlekena, @nikhil3000, @emmaodia, this bounty is still open! 300RLC (~200$ at today's rate). Your contribution is welcome!

@nikhil3000
Copy link
Contributor

@sulliwane I have opened a #40 . Please have a look at it.

@sulliwane
Copy link
Collaborator

@nikhil3000 thanks! we'll have a look at it. Don't forget to "submit work" on the Gitcoin bounty page as well: https://gitcoin.co/issue/iExecBlockchainComputing/iexec-apps/14/3197

@nikhil3000
Copy link
Contributor

@sulliwane there is no option to submit the work on the gitcoin issue page as the bounty is marked as a traditional project i.e one worker at a time and the issue has already been assigned to mlekena, that is the reason why I asked here in the comments before starting working on it.

So if you can assign the issue to me on the gitcoin page, I'll submit there as well.

@janus
Copy link
Contributor

janus commented Dec 2, 2019

I am free , can I join? @sulliwane

@sulliwane
Copy link
Collaborator

Hi @janus, You are welcome to submit your code of course! Deadline for contribution is set on December 11th.

For this bounty there will only be one winner, meaning the best overall contribution on Wed. 11th Dec. will take all the 300RLC price (trying to differentiate oneself from existing submission is important ;) Happy coding Gents!

@sulliwane sulliwane pinned this issue Dec 10, 2019
@nikhil3000
Copy link
Contributor

@sulliwane any update?

@sulliwane
Copy link
Collaborator

Hi @nikhil3000, sorry for the delay! The tech team couldn't find the time to review your submission. Should be done before Jan. 8th. I'll keep you informed 🙂

@gitcoinbot
Copy link

⚡️ A tip worth 300.00000 RLC (200.34 USD @ $0.67/RLC) has been granted to @nikhil3000 for this issue from @sulliwane. ⚡️

Nice work @nikhil3000! Your tip has automatically been deposited in the ETH address we have on file.

@gitcoinbot
Copy link

Issue Status: 1. Open 2. Started 3. Submitted 4. Done


This Bounty has been completed.

Additional Tips for this Bounty:

  • sulliwane tipped 300.0000 RLC worth 200.34 USD to nikhil3000.

@sulliwane sulliwane unpinned this issue Jan 23, 2020
@sulliwane
Copy link
Collaborator

Congrats to @nikhil3000 for your great work! Closing the issue :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants