[ORACLES] Updates, Requests, Questions and Feedback

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

1 Like

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

1 Like

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

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

1 Like

Hey @marco.chain,

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

Best regards,
Albena

1 Like

Hey @marco.chain,

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

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?

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

Hey @marco.chain,

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

1 Like

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:

1 Like

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:

3 Likes

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?

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.

5 Likes

another question about oracles in general (I just had a call with @erik.chain where this question of me came up):

  • at this moment it is only possible to perform oracle actions on-chain, right?

the reason I am asking that is that if we assume we will have many oracles (mainly IoT sensors) in the future we probably will need support for an incredible high amount of on-chain transactions. have you already thought about that? @dimitar.chain

2 Likes

Hi @marco.chain
Yes, oracles are available only on-chain. Regarding the off-chain - you can still have an IoT device that signs messages and sends them off-chain to concerned parties - still off-chain. You can have a certain contract that checks that the received signed message has an origin the IoT’s pubkey (so it is correctly signed) and use its input for your off-chain contract. In this sense the IoT could act as an off-chain oracle and its signed messages can still be used both in off-chain and on-chain contracts and disputes.
Providing a broadcasting service from a single IoT to multiple off-chain channels could be yet another business niche.

2 Likes

Hello,

I am trying to create a client for contract, which calls another contract with an oracle. When I run my unit tests, everything works fine, but when I run the same from from my web app through the JavaScript SDK, I always get an out_of_gas exception and I have no clue where I have to search.

Please, can somebody give me a hint?

Best Regards

Hi Guys,

I have additional question to what @UlfA has already asked before me.

My question: who is going to be debited/charged for Oracle query when one contract creates an Oracle query through another contract? Oracle is registered in constructor of the second contract (i.e. it is in callee).

As I understood, the Oracle query needs to be initiated by the Contract who supposed to cover query fee. So that in my scenario, first contract needs to lookup an Oracle instance and use it to create an Oracle query. Then, second contract should lookup for a query from the blockchain in order to respond with an answer. Still not sure wether I got the existing Sophia API right.

No, this is wrong. Anyone can initiate the query to the Oracle and after a response had been posted to that query - anyone can use it to call their Contract. Nothing in the protocol requires the Contract to ask the oracle. Only restrictions lie in response types and the specific Contract’s internal logic - if a Contract call is provided with a response that fits those - it is valid no matter who initated it (and payed the fee).