ORACLES

 

Instructors: Andreas Park and Zissis Poulos




 

Agenda for the presentation

  • What is "off-chain" reality?  
  • How can smart contracts learn about it?
  • The Oracle problem and solutions

What is "off-chain" reality?

Smart contracts need data

  • Decentralized exchanges
  • Token programming/management 
  • Lending/Derivatives
  • Prediction markets
  • Insurance
  • Betting
  • NFTs???

How do we feed external data to smart contracts?

  • Trust a third party to write the data
    • Goes against decentralization 
    • Natural failures
      • link goes down
      • website goes down
      • API fails etc.
    • Malicious
      • betting outcome manipulation
      • insurance fraud
      • DeFi pool exploits

The Oracle Problem

  • Do it in a way that respects decentralization and is failure-resistant

<standings: 7,3,8,4,2,1,6,5> + digital signatures

The Oracle Problem

  • Do it in a way that respects decentralization and is failure-resistant

Disagreement? 

Majority Vote

The Oracle Problem

  • Do it in a way that respects decentralization and is failure-resistant

Multiple Values? 

Report Median

1 ETH = $4780

1 ETH = $4789

1 ETH = $4781

The Oracle Problem

  • Do it in a way that respects decentralization and is failure-resistant

1 ETH = $4780

1 ETH = $4789

1 ETH = $4781

DEXes can be used as on-chain price oracles

Time-Weighted Average Price (TWAP)

Challenges

  • Participation incentives?
    • rewards, payments...

Oracle nodes form their own ecosystem

 

  • Incentives for honest reporting?
    • penalties, collateral...

 

  • Reputation?
    • Uptime, correctness, penalty history, collateral amount....
  • Fee collection from dAPPs
  • Nodes stake LINK
    • More LINK staked more jobs taken

staked LINK can be slashed

Chainlink

Chainlink Market

https://market.link/overview

 

  • Arbitration?
    • Tier-2 high-stakes oracle network
    • Chainlink uses zk proof by DECO

Chainlink Flow

https://blog.chain.link/understanding-the-security-impact-curve-and-future-fee-opportunity/

  • Does an oracle system need its own token?
    • Control over tokenomics, development funding etc
    • Integration/Interoperability with multiple blockchains
    • But also, put yourselves in an attacker's shoes:
      • ​Would you rather invest (supply as collateral) the oracle's token or ETH in order to attack the oracle network?

Oracle nodes form their own ecosystem

Other applications

  • Off-chain computation
  • Verifiable randomness
  • Cross-chain token wrapping

Example Oracle Jobs

  • Price feeds
  • Random number generator
  • Liquidations
  • Rebalancing portfolios
  • Rebase token supply adjustments
  • Auto-compounding
  • Limit orders
  • Proof of Reserves
  • Aggregation of data from multiple oracles
  • Explicit user requests

Oracle manipulation

  • Centralized off-chain oracles
    • Synthetix, June 2019
      • fault in central oracle -> price x1000 -> exploit

 

  • On-chain oracles
    • bZx, February 2020
      • Flash loan -> inflate sUSD price on Uniswap
      • deposit sUSD on bZx -> borrow x2 more than they should
      • abandon the now underwater loan
      • net profit 600K

 

Generally, "thin" liquidity in a pool makes it prone to epxloits

@financeUTM

andreas.park@rotman.utoronto.ca

slides.com/ap248

sites.google.com/site/parkandreas/

youtube.com/user/andreaspark2812/

Copy of Oracles

By zpoulos

Copy of Oracles

  • 329