6 ms·
> _share_price here refers to the price of TITAN, as provided by an oracle, which is correctly reporting it as… 0 (somewhere in the distance, you can hear a roo
by aazaa 5y ago
> _share_price here refers to the price of TITAN, as provided by an oracle, which is correctly reporting it as… 0 (somewhere in the distance, you can hear a room full software engineers burst into laughter ).
Aside from the amusing programming error, the main problem with much of the "smart contract" activity today is that doing anything remotely interesting requires an oracle. An oracle is basically a server that reports the outcome of an event. And servers can be attacked in ways that systems like Ethereum can't.
So a lot of the hype around Ethereum and its "smart contracts" is really people just misunderstanding the security model. The weakest link is a server in a dorm room or data center reporting a number.
Here the oracle is doing the right thing. But it could easily go the other way.
- DennisP 5y agoI'd say Uniswap is interesting. That doesn't use an oracle.
- acjohnson55 5y agoBut it also only works with on-chain cryptoassets.
- DennisP 5y agoIf you want to work with off-chain things then necessarily your system is going to include off-chain things. I'm not sure of your point here. However, I can think of an exception. Augur is a prediction market that doesn't use a trusted source to resolve bets. It doesn't get a lot of use these days, and probably won't before scaling resolves gas prices, but the bets that have been live on the system have resolved correctly.
- bikamonki 5y agoOracle is a fancy name for an API, right?
- el_dev_hell 5y agoI've been wondering the same for a few weeks but can't be bothered checking. My uneducated inference is that an oracle is a data source and you can hook into it from the smart contract. The oracle seems to live off-chain and live on a traditional server/DB. Please correct me if the above is way off!
- chrisco255 5y agoAn oracle is a source of truth for information about the outside world to a smart contract. The smart contract doesn't actually call the oracle. This is because smart contracts don't self-execute and can't make external http calls. So a smart contract pauses, and waits for an oracle to trigger an update function. Because oracles have a lot of power over a smart contract (not all smart contracts need them, by the way), they have to be done in a secure way. The market leader in decentralized oracles is Chainlink. They power hundreds of DeFi applications.
- nieve 5y agoAt that point can they really be considered purely code contracts anymore? If their execution requires a trusted third party some of the rhetoric goes out the window.
- lifeformed 5y agoI think they're just other smart contacts that use many data sources. Like if you wanted an oracle that returned the result of a baseball game, you'd have it check various newspaper websites and have it make sure the results were all the same. To attack it, you'd have to attack all the newspaper sources. It's still a weak point, but not quite a single point of failure.
- chrisco255 5y agoThey're sort of hybrid networks at that point, but Chainlink oracles are decentralized: each function is run by several nodes (31 for the BTC/USD or ETH/USD price feed, for example). The nodes have to come to consensus and individual nodes are slashed if they produce bad or late data. You can see an example of a LINK feed here: https://data.chain.link/ethereum/mainnet/crypto-usd/eth-usd https://data.chain.link/ethereum/mainnet/crypto-usd/eth-usd Decentralization is a spectrum. But I would argue this approach is far more secure than naive oracle implementations. Not all applications need oracles. It depends on whether your smart contract needs information about the world outside of the blockchain.
- youdumbaf 5y agono, an oracle is another smart contract that is called by the main contract, the oracle smart contract logs an event, this event triggers sources of truth (servers), each source of truth provides information for the oracle contract by modifying its state, the oracle contract decides if the data is reliable and calls the main contract if so
- polytely 5y agoBut there must always be a point where the oracle interacts with the real world, right? Which immediately becomes a point of centralization, which -seems to me- kinda defeats the purpose of having a decentralized system
- trophycase 5y agoI love your rhetoric of "server in a dorm room" to make it sound way sketchier and amateur than it is.
- BrissyCoder 5y agoAnd without an oracle smart contracts are useless for anything that relates to the real world. And guess what folks... we live and spend our money in the real world. This has been the problem with smart contracts since day one. It is that simple.
- aqme28 5y agoThere are a lot of systems now that don't use oracles. Prices are maintained by people arbitraging any significant difference.
- ikeboy 5y agoFor prices you can use Uniswap's oracle which is time weighted average price and can't be manipulated unless you buy a ton of the token over the entire time period. In this case it was using a Sushi swap oracle (uniswap clone that's on matic) with very liquid pools so it was accurate, just lagged a bit when titan was dropping rapidly.
- 3np 5y agoThe general consensus is that it's a terrible idea to rely on Uniswap (or any other dex) as a price oracle for valuation/pricing for other on-chain defi applications/dexes. With enough capital (which can be acquired through flash loans) you can absolutely perform economic attacks though atomic transaction chains involving moving the dex price. Uniswap, Kyber, and others will tell you the same thing. This makes me think that even things like DAI/MakerDAO (and anything that relies oracles like Chainlink) can start to get brittle when/if the major price discovery and liquidity are on Dexes. This has been seen in practice, for example in the Fulcrum hack: https://gist.github.com/alexvansande/edcc9fe935b61526766c9563667eb8aa https://gist.github.com/alexvansande/edcc9fe935b61526766c956... https://dappradar.com/blog/defi-flash-loan-attack-what-just-happened https://dappradar.com/blog/defi-flash-loan-attack-what-just-...
- ikeboy 5y agoFlash loans are not relevant to the uniswap TWAP oracle, which ignore any transactions in the current block. That oracle was written specifically to be resistant to manipulation and I don't think there's any consensus not to use it.
- 3np 5y agoIt's definitely an improvement. Still, I would advise against it in general, especially for arbitrary pairs. This category of attacks can be difficult to foresee and even arise after deployment due to new incentives outside of the system. While Chainlink has its own host of issues and risks, there are still valid reasons why companies are paying them and their node operators good money to feed price contracts for ERC-20 token pairs.
- snak 5y ago> Aside from the amusing programming error, the main problem with much of the "smart contract" activity today is that doing anything remotely interesting requires an oracle. An oracle is basically a server that reports the outcome of an event. And servers can be attacked in ways that systems like Ethereum can't. Thank you! I've tried to put it into words before but I think this is as close to perfection as one can get while describing why smart contracts are not what people believe them to be.
- RhodoGSA 5y agoOracles have come a long way and very interesting work is being done to solve this problem. You don't always have to rely on one oracle and the amount of capital you'd need to 'trick' an oracle is too high to be economically advantageous. There is a possibility with very low-volume tokens, but good luck not getting eaten alive by arbitrage trying to trick a popular coin.