Ontology Aided Smart Contract Execution for Unexpected Situations - - PowerPoint PPT Presentation

ontology aided smart contract execution for unexpected
SMART_READER_LITE
LIVE PREVIEW

Ontology Aided Smart Contract Execution for Unexpected Situations - - PowerPoint PPT Presentation

Ontology Aided Smart Contract Execution for Unexpected Situations Farhad Mohsin, Xingjian Zhao, Zhuo (Robin) Hong, Geeth de Mel, Lirong Xia, and Oshani Seneviratne Blockchain and Smart Contract Blockchain enables trustworthy data sharing


slide-1
SLIDE 1

Ontology Aided Smart Contract Execution for Unexpected Situations

Farhad Mohsin, Xingjian Zhao, Zhuo (Robin) Hong, Geeth de Mel, Lirong Xia, and Oshani Seneviratne

slide-2
SLIDE 2

10/27/19

2

Blockchain and Smart Contract

  • Blockchain

enables trustworthy data sharing between untrusting parties in a tamper-proof manner

  • Smart contracts enables us to add logic to

govern updates via transactions

  • Once the smart contracts are set in motion,

they cannot be changed! Can we predict, detect, and fix unexpected situations in smart contracts?

slide-3
SLIDE 3

10/27/19

3

Limitations of Smart Contracts

  • Immutable
  • No way out for a break-glass-in-case-of-emergency scenarios
  • Need to foresee all unexpected situations
  • We need a solution when smart contracts aren’t as smart as they need be

Our Proposal

Use Oracles to change how smart contracts execute, so unexpected situations may be resolved

slide-4
SLIDE 4

10/27/19

4

Oracles in Blockchain

https://developer.ibm.com/articles/cl-extend-blockchain-smart-contracts-trusted-oracle/

  • Trusted system for information transfer
  • Good for extending smart contracts with
  • ff-chain complex logic
  • To integrate volatile knowledge, e.g., stock

price

  • Complex business rules
slide-5
SLIDE 5

10/27/19

5

Ontology based Oracle for Smart Contract Execution

  • Blockchain to will act as a verifiable data structure
  • Logic for each transaction will be performed off-chain

Smart Contract Oracle

Send necessary data to check transaction status Return true/false on transaction constraints Check if current status satisfies conditions Completes/rejects transaction

slide-6
SLIDE 6

10/27/19

6

Example: Decentralized Course Selection 4 2 1 3

CS1

4 2 1 3

CS1

1st Day 2nd Day

But, no proper function in the

  • riginal Smart Contract!

Unexpected Situation

A freshman student with a very good GPA gets a special permission to enroll in an already full course.

slide-7
SLIDE 7

10/27/19

7

Decentralized Course Selection (DCS) Ontology

Legend rdfs: = Resource Description Framework Schema dcs: = Decentralized Course Selection

slide-8
SLIDE 8

10/27/19

8

Off-Chain Rule Update

Updated Rule

Student(?s) ∧ hasYear(?s,?y) ∧ Course(?c) ∧ hasRequiredYear(?c, ?ry) ∧ hasMaxCapacity(?c, ?mc) ∧ hasCurrentSize(?c, ?curr) ∧ swrlb:greaterThanOrEqual(?y, ?ry) ∧ swrlb:lesserThan(?curr, ?mc) → canAddCourse(?s, ?c) Student(?s) ∧ hasGPA(?s, ?g) ∧ hasRequiredGPA(?c, ?rg) ∧ hasYear(?s,?y) ∧ Course(?c) ∧ hasRequiredYear(?c, ?ry) ∧ hasMaxCapacity(?c, ?mc) ∧ hasCurrentSize(?c, ?curr) ∧ swrlb:greaterThanOrEqual(?g, ?rg) ∧ swrlb:greaterThanOrEqual(?y, ?ry) ∧ swrlb:lesserThan(?curr, ?mc) → canAddCourse(?s, ?c)

Initial Rule

slide-9
SLIDE 9

10/27/19

9

DCS Instance Graph

slide-10
SLIDE 10

10/27/19

10

Governance Structure

  • Pre-processor determines an action list
  • Smart Contract Execution Engine executes

the action that was selected by the peers

Model asset A{ a1 a2 } participant B{ b1 b2 } Script{ transaction t1{ //... } Model asset A{ a1 a2 } participant B{ b1 b2 vote_data } Script{ transaction t1{ //... } //new transactions start_vote{} submit_vote{} end_vote{} //action list change_a1{} change_a2{} change_b1{} change_b2{} }

Analyze Smart Contract

Model asset A{ a1 a2 } participant B{ b1 b2 vote_data } Script{ transaction t1{ //... } //new transactions start_vote{} submit_vote{} end_vote{} //action list change_a1{} change_a2{} change_b1{} change_b2{} }

voting

Smart Contract Execution execute change_a1() Preprocessor Smart Contract Execution Engine

Strengthening Smart Contracts to Handle Unexpected Situations;

Shuze Liu, Farhad Mohsin, Lirong Xia, Oshani Seneviratne; International Conference on Decentralized Applications and Infrastructures 2019

slide-11
SLIDE 11

10/27/19

11

Future Work: Proposed Voting Mechanism for Updating the Ontology

Submit proposals in form of rules

Other Users Oracle

Check condition for proposers

Initiator

Request proposals from select users

Smart Contract

Provide users satisfying proposer constraint Start vote with necessary conditions for proposers and voters defined Provide users satisfying voter constraint Request votes on proposals from select users Vote on proposed rules Report winning consistent rule Check condition for voters Implement consistent change to transaction constraints

slide-12
SLIDE 12

10/27/19

12

Implementation Concerns

  • Rules and attributes should only be changed to an extent.
  • E.g. course.MaxCapacity may be changeable, student.GPA should probably not be changed
  • For privacy concerns, the oracle should receive data necessary for forming

instances for each transaction and never store a complete knowledge graph

  • Update on the rules should only occur from the smart contract and protected

against external tampering

slide-13
SLIDE 13

10/27/19

13

Summary

  • Utilization of external rules to augment the

smart contract logic

  • If there is a gap in the logic, the external
  • racle could be updated
slide-14
SLIDE 14

10/27/19

14

Questions?

https://idea.tw.rpi.edu/projects/scales SCALES – Smart Contracts Augmented with LEarning and Semantics

senevo@rpi.edu