Hot answers tagged

94 votes
Accepted

How can an Ethereum contract get data from a website?

You can use an Oracle. An oracle is any device or entity that connects real-world data with the blockchain. There are several examples of oracle technologies. Chainlink and Provable (formerly Oraclize)...
user avatar
43 votes

How can an Ethereum contract get data from a website?

You can't do this directly; Ethereum contracts can't hit URLs, because Ethereum needs everyone to be able to independently validate the outcome of running any given contract, and you can't guarantee ...
user avatar
  • 16.4k
35 votes
Accepted

How do oracle services work under the hood?

Edmund Edgar from Reality Keys here. Basically what needs to happen is that somebody says what data they want, the trusted service provides an ID that identifies it (in our case a hash of the data) ...
user avatar
  • 16.4k
32 votes

Oracle (oraclize.it) with Truffle and Testrpc

It is very possible to use the Oraclize service with testrpc alongside truffle. Firstly, you need to follow the naming convention of contract filenames in truffle. As per their docs: Truffle ...
user avatar
  • 1,021
26 votes
Accepted

How does Oraclize handle the TLSnotary secret?

Oraclize stores the TLSnotary secret in an Amazon Web Services (AWS) Virtual Machine. Using the techniques described here, they are able to provide some additional guarantees regarding the software ...
user avatar
26 votes

How do oracle services work under the hood?

I'll take a stab at a very high-level overview by describing a generalized goal, the limitations of Smart Contracts, and the outlines of a solution. This will hopefully provide some context for the ...
user avatar
  • 51.8k
19 votes
Accepted

What is a blockchain oracle?

A blockchain oracle is any device or entity that connects a deterministic blockchain with off-chain data. Smart contracts cannot make API calls themselves because they are deterministic, but without ...
user avatar
14 votes
Accepted

Why does this Oraclize query only works once?

Thomas from Oraclize here. You probably are having this issue because you are not sending any value along. The Oraclize API calls come at a cost, the small fee we charge is paid in advance when ...
user avatar
14 votes
Accepted

How does "Gas Price Oracle" work?

This blog post (old since default gas price is currently 0.02 szabos) from Stephan Tual has the hint: The default gas price is set at 50 shannon (0.05 szabos, or 0.00000005 ether). Remember that ...
user avatar
  • 5,030
11 votes
Accepted

How to wait Oraclize result before running code further?

Thomas from Oraclize here. When you call Oraclize the query is asynchronous, this means that one transaction is needed to send the query and another transaction to receive the result - this is the "...
user avatar
11 votes

How do oracle services work under the hood?

They have themselves a contract that interfaces with the real world. you register with their contract and define a function they should call their contract is read by an external entity, that sees ...
user avatar
11 votes
Accepted

Is it secure to read USD / ETH rate from exchanges directly without using price oracles?

TL;DR: It is not secure to read pricing information from an exchange or other protocol. Always use a decentralized oracle. You're setting yourself up to be hacked when building smart contracts. ...
user avatar
10 votes

How can an Ethereum contract get data from a website?

A detailed tutorial for how a contract can obtain data has been written for the Python Ethereum client (pyethapp): https://github.com/ethereum/pyethapp/wiki/Making-a-User-Service:-Tutorial One of ...
user avatar
  • 78.8k
10 votes
Accepted

Is Chainlink's price reference data free to consume?

On mainnet, sponsors are paying the LINK associated to keep those feeds live, decentralized, and secure, so they are not free. This allows the network to be a shared resource where everyone chips in a ...
user avatar
9 votes

Smart contracts and IoT: how will they call the physical world?

Smart contracts will contact the physical world in a similar way that the Internet calls the physical world. The Internet doesn't call the world: the world watches the Internet then acts. Similarly, ...
user avatar
  • 78.8k
8 votes

Bitcoin price oracle

Thomas from Oraclize here. One simple yet quite secure way to get a Bitcoin reference price into your contract is to use existing exchanges as datasources thanks to their APIs. I suppose here that ...
user avatar
8 votes
Accepted

Non Deterministic External Service Call

Miners never make external calls on behalf of your contracts. Oracles are done by a user (or machine, of course) sending a tx into the Oracle contract putting the data there. Your contract then reads ...
user avatar
  • 10.8k
8 votes
Accepted

How does CryptoKitties track time?

now is a Solidity special variable, which equates to the current time since the epoch, in seconds. From the documentation (linked above): now (uint): current block timestamp (alias for block....
user avatar
8 votes
Accepted

How often are Chainlink price feeds updated?

There are currently 2 "trigger" parameters that kick off Chainlink nodes to update. 1. A deviation parameter The Chainlink nodes are monitoring the prices of the assets off-chain. If the ...
user avatar
7 votes
Accepted

How does Codius differ from Ethereum?

Codius is/was a offchain smart oracle platform. These are basically sandboxed virtual machines running Google’s Native Client. The sandboxed VMs can be paid to run untrusted native code and to report ...
user avatar
  • 3,282
7 votes

Oracle Corruption

Yes, that's absolutely possible. Using some specific service is the way of centralization. Since then, you depend on it. They can pass whatever data they want. One of the ways to solve an issue is ...
user avatar
6 votes

How can an Ethereum contract get data from a website?

As others have stated, you must use an Oracle. Some projects like ChainLink and Oracleize will do this for you. To set up an oracle on your own, the process looks like this: Create a smart contract ...
user avatar
6 votes

What is the Oracle Problem definition exactly and briefly?

The oracle problem is: "If oracles allow corrupt data to be imported on-chain, auto-executing smart contracts can have disastrous affects" Once data is reported to a blockchain, that data ...
user avatar
6 votes

Does Ethereum 2.0 still have use cases for oracles, why?

The basic ideas of blockchain remains the same in Ethereum 2.0; one of the basic concepts is they are deterministic. For our purposes that means that external data needs to be input into the ...
user avatar
6 votes
Accepted

Does Chainlink store Oracle response for a transaction somewhere on blockchain?

Short answer to your question: Yes, oracle responses are stored on-chain. Long Answer: You can read more about how the requesting model works for chainlink, and how it gets data on-chain, but here is ...
user avatar
5 votes
Accepted

Using Oraclize to assign value to another contracts variable

As @Thomas Bertani mentions in the comment, Oraclize can be used directly in MyContract. If you need to use 2 contracts, expanding on his comment, then you need to create a setter, and invoke the ...
user avatar
  • 78.8k
5 votes
Accepted

Contracts as data feed?

Ultimately you're going to be relying on somebody to tell the truth, because somebody is going to have to be in charge of the thermometer. The information from the thermometer then needs to be ...
user avatar
  • 16.4k
5 votes
Accepted

Can't get oraclize to work

That line is meant to be replaced with the actual content of the Oraclize api.sol file (or to your local path to the api.sol file) so.. get rid of the "import .." line and copy paste the http://dev....
user avatar
5 votes

How can an Ethereum contract get data from a website?

An oracle can be a manually controlled human account that feeds data in a timely manner or better an automated bunch of bots on traditional servers that scrape a website and feeds in data via the ...
user avatar
  • 421

Only top scored, non community-wiki answers of a minimum length are eligible