97
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)...
44
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 ...
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) ...
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 ...
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 ...
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 ...
20
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 ...
17
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 ...
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 ...
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 ...
13
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 ...
12
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. ...
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 "...
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 ...
11
votes
Accepted
Do all Chainlink feeds return prices with 8 decimals of precision?
Non-ETH pairs: 8 decimals
ETH pairs: 18 Decimals
Hence, ETH/USD is a non-ETH pair, so it has 8.
But if it were USD/ETH, it would have 18
For reference
EDIT: Each contract has a decimals function you ...
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 ...
eth♦
- 85k
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, ...
eth♦
- 85k
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 ...
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 ...
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....
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 ...
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 ...
7
votes
Accepted
What is the cost of using a Chainlink Oracle?
A few clarifications
Chainlink is not mined, but paid to operators to request data
Node operators set their own prices, so when you see a node operator is charging 0.1 LINK that is per API call / ...
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
...
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 ...
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 ...
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 ...
6
votes
Accepted
How can I protect my Chainlink oracle fulfill method?
Your assumptions are correct, it needs to be public but modifiers can help in this case. ChainlinkClient has recordchainlinkfulfillment modifier for fulfillment callbacks.
This modifier specifies that ...
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 ...
eth♦
- 85k
Only top scored, non community-wiki answers of a minimum length are eligible
Related Tags
oracles × 454solidity × 165
chainlink × 102
contract-development × 49
contract-design × 34
blockchain × 31
truffle × 30
remix × 27
external-api × 26
go-ethereum × 20
testrpc × 19
web3js × 12
randomness × 12
ether × 11
gas × 11
private-blockchain × 11
dapps × 10
transactions × 8
security × 8
ethereumjs × 8
provable × 8
tokens × 7
price × 7
events × 6
uniswap × 6