How do I get oracle data into a computation?

The docs state:

We currently do not support TLS or HTTP requests within a computation. We suggest that developers utilize a relayer model where applicable to obtain and submit this type of data.

  1. Could this be elaborated upon? Are you referring to a 0x-style relayer? These typically use HTTP or encrypted WebSockets (TLS).
  2. Could I use ZeroMQ?
  3. Could I use unencrypted WebSockets (and handle encryption myself)?
1 Like

You wouldn’t be able to solicit TLS / HTTP requests from within the secret contract. You could, however, identify some trusted (or otherwise constrained) “user” who submits the data to the smart contract. This is what we mean by relayer. I’m not familiar with options 2 or 3, but to re-state the challenge:

  • you need to submit data to the smart contract (say, the weather)
  • you cannot ask the smart contract itself to read from HTTPS/TLS
  • however, a user with special permissions can be asked to submit the required data as a task to Enigma
  • the design issue for the application-side is: how do you want to constrain that user / trust that users data input?

The easiest solution here I found was just to serialise any data needed and chuck it in as a function argument. Store in the contract state and update with any new function calls.