SlideShare a Scribd company logo
1 of 12
Download to read offline
Mastering Ethereum
Oracles
Song Je-Ho
qwerwon@gmail.com
이더리움의 문제점
 EVM 실행은 EVM Context라는 제한된 상태(Smart contract chapter 참조)에 기반하여 작동한다. 외
부 데이터를 참조하기 위해서는 모든 데이터를 트랜잭션을 통해서 전달되어야 하는 문제점이 존
재하고, 전달되어도 그 데이터를 제공하는 집단에 대한 신뢰성의 문제가 존재한다.
 또한 어떤 노드에서 실행해도 같은 결과가 나오도록 결정적이어야 한다(rand() 함수 불가능).
 현실 세계의 데이터를 이더리움 스마트 컨트랙트에서 이용할 수 있도록 다리 역할을 해주는 데
이터 제공자를 오라클(Oracle)이라고 한다.
오라클이 제공하는 데이터 예시
 물리적 인 소스로부터의 난수 / 엔트로피 (예 : 양자 / 열 현상) : 예. 추첨 스마트 계약서에서 우승
자를 공정하게 선택하는 것
 환율 데이터 : 예 : 안정된 동전을 정확한 화폐로 화폐 화하기
 자본 시장 데이터 : 예 : 토큰 화 된 자산 / 증권의 가격 결정 바구니
 정적 / 의사 정적 데이터 : 보안 식별자, 국가 코드, 통화 코드 등
 시간 및 간격 데이터 : 정확한 SI 시간 측정에 근거한 이벤트 트리거
 날씨 데이터 : 예 : 일기 예보에 기초한 보험료 계산
 스포츠 이벤트 : 예측 시장 분석 및 판타지 스포츠 계약
 지리적 위치 데이터 : 예 : 공급망 추적에 사용되는
 다른 블록 체인에서 발생하는 이벤트 : 상호 운용성 기능
 이더리움 시장 가격
 인증 : 예 : 학업 성취 또는 정부에서 발행 한 권리 - 식별 서류 제공
오라클의 유형
 Immediate-read Oracle
• 데이터의 변동이 없고, 쿼리에 대한 반응이 실시간으로 필요한 데이터에 적합한 형태의 오라클
• 외부의 데이터를 이더리움 스토리지에 한 번 저장하고, 쿼리가 발생하면 로컬 스토리지에서 읽고 반응하는 형태의 오라클
• Gas 소모가 없으며, 트랜잭션이 아니기 때문에 즉각적으로 쿼리의 반응을 수신할 수 있다.
 Request-response Oracle
• 실시간으로 업데이트되는 데이터에 적합한 형태의 오라클
• 분산 어플리케이션에서 쿼리가 발생하면, 트랜잭션의 형태로 외부 데이터를 가져와 반환한다.
• 일반적인 트랜잭션과 똑같은 수행시간이 걸리고 gas가 소모된다.
오라클 스마트 컨트랙트
Oraclize
Oraclize.sol
executeRequest()logError()
Response()
DataAuthentication
데이터 인증
 신뢰할 수 있는 소스로부터 데이터를 받았어도, 오라클의 요청과 응답 메커니즘 사이에서 데이
터가 변조될 의혹이 존재한다.
 본 챕터에서 예시로 제시하는 대표적인 오라클 서비스인 Oraclize에서는 소스로부터 받은 데이터
가 변조되지 않았음을 증명하는
 Publish-subscribe
• 효율적인 브로드캐스팅 방식의 오라클로, 주기적으로 이더리움 네트워크(on-chain)에 데이터의 업데이트 여부를 수신하여
비교적 최근의 데이터를 요청에 응답하는 방식이다.
 Request-response
• 가장 복잡한 방식으로, 직접 이더리움 네트워크에 쿼리 요청을 보내서 on-chain
Oraclize 사용 예시
Oraclize 사용 예시
Data authentication 과정
Oraclize 사용 예시
쿼리 호출
Oraclize 사용 예시
API 호출
BlockOne IQ
참고 자료
 https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.4.sol
 https://dev.oraclize.it/
 https://github.com/ethereumbook/ethereumbook/blob/develop/oracles.asciidoc

More Related Content

Featured

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by HubspotMarius Sescu
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTExpeed Software
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsPixeldarts
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthThinkNow
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfmarketingartwork
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024Neil Kimberley
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)contently
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024Albert Qian
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsKurio // The Social Media Age(ncy)
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Search Engine Journal
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summarySpeakerHub
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next Tessa Mero
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentLily Ray
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best PracticesVit Horky
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project managementMindGenius
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...RachelPearson36
 

Featured (20)

2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot2024 State of Marketing Report – by Hubspot
2024 State of Marketing Report – by Hubspot
 
Everything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPTEverything You Need To Know About ChatGPT
Everything You Need To Know About ChatGPT
 
Product Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage EngineeringsProduct Design Trends in 2024 | Teenage Engineerings
Product Design Trends in 2024 | Teenage Engineerings
 
How Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental HealthHow Race, Age and Gender Shape Attitudes Towards Mental Health
How Race, Age and Gender Shape Attitudes Towards Mental Health
 
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdfAI Trends in Creative Operations 2024 by Artwork Flow.pdf
AI Trends in Creative Operations 2024 by Artwork Flow.pdf
 
Skeleton Culture Code
Skeleton Culture CodeSkeleton Culture Code
Skeleton Culture Code
 
PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024PEPSICO Presentation to CAGNY Conference Feb 2024
PEPSICO Presentation to CAGNY Conference Feb 2024
 
Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)Content Methodology: A Best Practices Report (Webinar)
Content Methodology: A Best Practices Report (Webinar)
 
How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024How to Prepare For a Successful Job Search for 2024
How to Prepare For a Successful Job Search for 2024
 
Social Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie InsightsSocial Media Marketing Trends 2024 // The Global Indie Insights
Social Media Marketing Trends 2024 // The Global Indie Insights
 
Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024Trends In Paid Search: Navigating The Digital Landscape In 2024
Trends In Paid Search: Navigating The Digital Landscape In 2024
 
5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary5 Public speaking tips from TED - Visualized summary
5 Public speaking tips from TED - Visualized summary
 
ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd ChatGPT and the Future of Work - Clark Boyd
ChatGPT and the Future of Work - Clark Boyd
 
Getting into the tech field. what next
Getting into the tech field. what next Getting into the tech field. what next
Getting into the tech field. what next
 
Google's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search IntentGoogle's Just Not That Into You: Understanding Core Updates & Search Intent
Google's Just Not That Into You: Understanding Core Updates & Search Intent
 
How to have difficult conversations
How to have difficult conversations How to have difficult conversations
How to have difficult conversations
 
Introduction to Data Science
Introduction to Data ScienceIntroduction to Data Science
Introduction to Data Science
 
Time Management & Productivity - Best Practices
Time Management & Productivity -  Best PracticesTime Management & Productivity -  Best Practices
Time Management & Productivity - Best Practices
 
The six step guide to practical project management
The six step guide to practical project managementThe six step guide to practical project management
The six step guide to practical project management
 
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
Beginners Guide to TikTok for Search - Rachel Pearson - We are Tilt __ Bright...
 

Mastering ethereum(oracle)

  • 2. 이더리움의 문제점  EVM 실행은 EVM Context라는 제한된 상태(Smart contract chapter 참조)에 기반하여 작동한다. 외 부 데이터를 참조하기 위해서는 모든 데이터를 트랜잭션을 통해서 전달되어야 하는 문제점이 존 재하고, 전달되어도 그 데이터를 제공하는 집단에 대한 신뢰성의 문제가 존재한다.  또한 어떤 노드에서 실행해도 같은 결과가 나오도록 결정적이어야 한다(rand() 함수 불가능).  현실 세계의 데이터를 이더리움 스마트 컨트랙트에서 이용할 수 있도록 다리 역할을 해주는 데 이터 제공자를 오라클(Oracle)이라고 한다.
  • 3. 오라클이 제공하는 데이터 예시  물리적 인 소스로부터의 난수 / 엔트로피 (예 : 양자 / 열 현상) : 예. 추첨 스마트 계약서에서 우승 자를 공정하게 선택하는 것  환율 데이터 : 예 : 안정된 동전을 정확한 화폐로 화폐 화하기  자본 시장 데이터 : 예 : 토큰 화 된 자산 / 증권의 가격 결정 바구니  정적 / 의사 정적 데이터 : 보안 식별자, 국가 코드, 통화 코드 등  시간 및 간격 데이터 : 정확한 SI 시간 측정에 근거한 이벤트 트리거  날씨 데이터 : 예 : 일기 예보에 기초한 보험료 계산  스포츠 이벤트 : 예측 시장 분석 및 판타지 스포츠 계약  지리적 위치 데이터 : 예 : 공급망 추적에 사용되는  다른 블록 체인에서 발생하는 이벤트 : 상호 운용성 기능  이더리움 시장 가격  인증 : 예 : 학업 성취 또는 정부에서 발행 한 권리 - 식별 서류 제공
  • 4. 오라클의 유형  Immediate-read Oracle • 데이터의 변동이 없고, 쿼리에 대한 반응이 실시간으로 필요한 데이터에 적합한 형태의 오라클 • 외부의 데이터를 이더리움 스토리지에 한 번 저장하고, 쿼리가 발생하면 로컬 스토리지에서 읽고 반응하는 형태의 오라클 • Gas 소모가 없으며, 트랜잭션이 아니기 때문에 즉각적으로 쿼리의 반응을 수신할 수 있다.  Request-response Oracle • 실시간으로 업데이트되는 데이터에 적합한 형태의 오라클 • 분산 어플리케이션에서 쿼리가 발생하면, 트랜잭션의 형태로 외부 데이터를 가져와 반환한다. • 일반적인 트랜잭션과 똑같은 수행시간이 걸리고 gas가 소모된다.
  • 6. 데이터 인증  신뢰할 수 있는 소스로부터 데이터를 받았어도, 오라클의 요청과 응답 메커니즘 사이에서 데이 터가 변조될 의혹이 존재한다.  본 챕터에서 예시로 제시하는 대표적인 오라클 서비스인 Oraclize에서는 소스로부터 받은 데이터 가 변조되지 않았음을 증명하는  Publish-subscribe • 효율적인 브로드캐스팅 방식의 오라클로, 주기적으로 이더리움 네트워크(on-chain)에 데이터의 업데이트 여부를 수신하여 비교적 최근의 데이터를 요청에 응답하는 방식이다.  Request-response • 가장 복잡한 방식으로, 직접 이더리움 네트워크에 쿼리 요청을 보내서 on-chain
  • 8. Oraclize 사용 예시 Data authentication 과정
  • 12. 참고 자료  https://github.com/oraclize/ethereum-api/blob/master/oraclizeAPI_0.4.sol  https://dev.oraclize.it/  https://github.com/ethereumbook/ethereumbook/blob/develop/oracles.asciidoc