2

The following is what the Ethereum documentation of Oraclize says:

Firstly, in the most common case, a transaction executing a function of a smart contract is broadcasted by an user. The function contains a special instruction which manifest to Oraclize, who is constantly monitoring the Ethereum blockchain for such instruction, a request for data.

Secondly, according to the parameters of such request, Oraclize will fetch or compute a result, build, sign and broadcast the transaction carrying the result. In the default configuration, such transaction will execute the __callback function which should be placed in the smart contract by its developer: for this reason, this transaction is referred in the documentation as the Oraclize callback transaction.

What kind of instruction is executed? What messages are passed around when calling the oraclize_query function?

Is the "special" instruction and oraclize_query the same thing? As far as I understand, oraclize_query is the request for data, right?

The other answers, don't address what the "special" instruction is, etc.

Shuzheng
  • 1,855
  • 3
  • 19
  • 31

1 Answers1

2

EDIT: I found out in the comments at the question suggested by others to be the original one where the answers are that it actually does work the way I suggested (the events part was what I was unsure about)

I am not completely sure about this, but this is my assumption of how things work under the hood:

  • when oraclize_query is invoked, it publishes an event with the data about what kind of query etc.

  • oraclize monitors the blockchain and filters those events

  • after finding out the answer, they send it to the contract that asked for it using __callback function (implemented by the requester)

This is the reason why it takes few blocks for the answer to be delivered.

I tried to confirm those assumptions by looking at the code, but got lost in it.

kruk
  • 110
  • 5