Oracles Discussion


#1

Questions or comments about æternity’s approach to oracles? Add them here!


#2

You can read an interesting piece about blockchain oracles in the blog. If you have questions, this is the place to ask them!


#3

i guess,pow is for ae blockchain safe and workable,so stack have to pay for the miner work,pos is for enrich the function of ae blockchain


#4

is my assumption right that following steps will always need to be performed on-chain?

  • query oracle (client)
  • answer query (oracle operator)
  • action based on answer (client)

and it is consciously not wanted and probably wouldn’t make sense that smart contracts might automatically perform an action based on the response of an oracle right? could you also give your opinion about that topic, specifically why this is not wanted?

my personal view is that if my contract would somehow allow the oracle to automatically perform an action based on the response to the query then the oracle operator would need to pay the fees for the execution. this is my view why it probably wouldn’t make sense


#5

Hey @marc0olo,

Thank you for this question, our developers will get back to you as soon as possible.

Best regards,
Albena


#6

Hey @marc0olo,

It is certainly possible to interact with oracles using contracts. You have to be a bit careful, just as you mention, with who is paying. But for some scenarios it would make good sense to do several operations as part of a contract call.

Regards,
Albena


#7

ok I get that contracts itself and clients can perform requests to the oracle. just to avoid confusion -> it is NOT possible to automatically let the contract perform an action based on the answer of the oracle provider, right?

I always need a system that tracks the event and perform actions on the client side based on the response-event, correct?


#8

There is nothing that stops the oracle to be run inside a contract, with additional services. One additional service could be a “callback” mechanism where you can register a function to be called once a particular query is answered. There are no plans to bloat the core oracles with this kind of functionality, there are lots of features that could possibly interact (maybe register a name depending on the outcome of an oracle, etc.) - instead all core mechanisms are useable from contracts and automation can be achieved there. Do note, that it would in either case be the contract/oracle that would have to pay gas/transaction fees - and thus the additional service contract has to be setup such that this is accounted for (in the simplest form by paying for the callback up front).

Regards,
Albena


#9

Hey @marc0olo,

To be even more concrete, if the additional service being mentioned is an external one that waits for oracle responses and makes contract calls, this certainly is not part of the epoch. It is not possible to have a core oracle perform such operation.

However, there are ways to do this using contracts.

Regards,
Albena


#10

seems like I explained my question not concrete enough based on the first 2 answers I got.

with automatically I always meant an action without the need to set up an external service which is currently not possible and probably won’t ever be possible because it is just not wanted.

  • for this specific case I just wanted to get opinions why it would probably never make sense to have automatically (without the need of external services) performed actions based on the oracles response

thanks for clarifying it! I hope I didn’t confuse other people too much :smiley:


#11

Thank you for your question, it’s always useful to have a discussion and look at each matter from different points of view :slight_smile:


#12

Is it possible that certain transaction will need to be verified by oracles. These holders could be within a certain industry that needs high level verification,would this need more verification from oracles, then driving more query’s to them/more transactions?


#13

Oracles are a mechanism to provide truth for the outside world. They can be built to accept any type of data, transactions’ hashes included.

Is it possible that certain transaction will need to be verified by oracles.

Alice makes a TransactionA1. It has a hash TransactionA1Hash. Alice sends a query to an oracle CheckTransaction. Oracle CheckTransaction receives the query, using the hash provided tries to get TransactionA1's state - if it is already included in the chain or not. Based on whatever the oracle is looking for, it posts a response to the query. This response might be based on the TransactionA1's contents and some references to an external data source. This is the time for the high level verification you’re talking about.
Alice then can use this response in an contract call.

I am not sure if this answered your question. If you were asking if an Oracle can prevent Alice’s transaction of being included in the chain - no, it can not. If that’s what you want, please use a couple of phases interaction:

  1. Alice posts TransactionA1
  2. Alice calls oracle CheckTransaction with the hash of the transaction
  3. Oracle CheckTransaction does the high level checks off-chain and posts a response
  4. Alice uses this response to call a contract to finish the process

Of course steps 1 and 2 could be combined into a single contract call transaction. Here I’ve split them to bring more clarity of the sequence of thge different phases.