SlideShare ist ein Scribd-Unternehmen logo
1 von 44
Downloaden Sie, um offline zu lesen
Markus Völter
voelter@acm.org
www.voelter.de
@markusvoelter
Declarative
Smart
Contracts
Context
1
An actual
contract,
executed
automatically.
Any
Turing Complete
Program
running on
a Blockchain.
over time
SMART CONTRACT
An actual contract,
executed automatically.
Multiple Parties.
Decision | |
Agreement | |
Coordination.
(Legally) Binding &
Trusted.
Formal Language.
Checkable.
Understandable.
„Event Tracking“
Progress over time
Contract
Definition
Contract
Execution
Contract
Definition
Contract
Execution
Understand Behavior
Functional Correctness
Non-Repudiability
Verified Behavior
Non-Gameability
}BC
Blockchains
can provide certain
non-functional properties
to executable contracts.
Blockchains
are a suitable (partial)
implementation technology
iff these properties are needed.
Verification
Ensure that the program performs
correctly the things the program
text tells it to do.
Validation
Ensure that the program does
the correct things, wrt. to the
requirements.
Verification
Ensure that the program
performs correctly the things
the program text tells it to do.
Validation
Ensure that the program does
the correct things, wrt. to the
requirements.
Contract
Execution
Contract
Definition
Correct-by-Construction
The language/framework/
API/modeling tool doesn’t allow
a particular class of mistakes.
Analysis-and-Fix
You analyze the code/model after the
fact and try to find problems which
devs then fix.
Formal Language.
Checkable.
Understandable.
DSLDomain
Specific
Language
„
Well, people realize that
these contracts have to
run reliably, after all, the
programs deal with real
values now.
“
Some Blockchain Guy
Not the first community to realize ... J
Lots of History & Research
Computational Law
Obligation, Permission
Ordering, Causality, Time
Event, State
Lots of History & Research
Blockchains
Composing contracts: an adventure
in financial engineering
https://lexifi.com/files/resources/MLFiPaper.pdf
POETS Process-oriented event-driven
transaction systems
https://github.com/legalese/poets/blob/master/doc/
Henglein%20-%20POETS%20Process-oriented%20event-
driven%20transaction%20systems.pdf
https://github.com/legalese/poets/blob/master/
doc/hvitvedmaster.pdf
Domain-Specific Languages for
Enterprise Systems
https://bitbucket.org/jespera/poets/raw/c0ee7194ce57d2ad6ca8894c
8a44e88e546d5f4a/doc/poets-techreport/tr.pdf
Contracts in Programming and in
Enterprise Systems
Solution
2
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
MPS / Convecton
Distribution, Trust Correctness
Validation
Simulation
Collaboration
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
Generate to verification tools to build more
confidence beyond type checking.
Declarative Description
MultiPartyBooleanDecision
A declarative, configurable specification of
how a number of parties makes a (Boolean)
decision.
Execution and Test
A MPBD instance maintains the state of a
decision process as it evolves over time.
Here, we play with an instance in the
interactive REPL.
Combination with State Machines
More complex contracts are modeled as
state machines; events are the API.
Internally, the use BPBDs.
Combintation with State Machines II
Here, a transition action creates a new
AccessControl instance ...
The state of that instance is then used in
guard condition for the top level SM.
Preventing Game Theoretical Attacks
Only „valid“ senders can enter this state.
Events can only arrive at limited rate.
States must be entered turn-by-turn.
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
MPS / Convecton
Distribution, Trust Correctness
Validation
Simulation
Collaboration
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
I D E A
Example: HyperCSL
Blockchains
Lisp (Clojure) based internal DSL for specifi-
cation of general commercial contracts.
Inspired by Simon Peyton Jones and Jean-Marc
Eber and the POETS group at CPHU and ITU in
Denmark.
Uses Ken Adams’
Categories of Contract
Language as fundametal semantic building
blocks. Interpreter and UI in prototype stage.
Example: HyperCSL
Blockchains
Example: HyperCSL
Blockchains
A UI to visualize the interactive
execution of CSL contracts.
Tooling
3
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
MPS / Convecton
Distribution, Trust Correctness
Validation
Simulation
Collaboration
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
KernelF is an extensible functional
language used at the core of DSLs.
DSL Development
New Language
GPL Extension
Formalization
Reuse GPL incl. Expressions and TS
Add/Embed DS-extensions
Compatible notational style
Reduce to GPL
Analyze Domain to find Abstractions
Define suitable, new notations.
Rely on existing behavioral paradigm
Reuse standard expression language
Interpret/Generate to one or more GPLs
Use existing notation from domain
Clean up and formalize
Generate/Interpret
Often import existing „models“
KernelF
Functional Features
Functional, no state at its core.
Purity + Effect Tracking
The usual types, literals and op‘s
Various Conditionals
Functions and Blocks
No null, only opt<T>
Error Handling
Immutable Collections and higher-order functions
Enums, tuples, records, all immutable
Constraints on types and functions
Boxes (like Clojure‘s ref)
Transactional Memory
State Machines
Interactors
Stateful Features
Extensible/Embeddable through modular
language implementation and other means.
(Meta-) Tooling
Language Workbench
Open Source, by Jetbrains
Very Powerful
Used for years by itemis and others
Vast Experience
MPS: Language Toolkit
MPS: Notational Freedom
MPS: Language Composition
Verifying
Infrastructure
4
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
MPS / Convecton
Distribution, Trust Correctness
Validation
Simulation
Collaboration
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
MPS / Convecton
Distribution, Trust Correctness
Validation
Simulation
Collaboration
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
<x
TRUST?
Verifying Blockchain Infrastructure
Blockchains
Formal Semantics of the EVM in K
https://www.ideals.illinois.edu/bitstream/handle/2142/97207/hilden
brandt-saxena-zhu-rodrigues-guth-daian-rosu-2017-tr_0818.pdf
IELE: Register-Based VM for the Blockchain
https://runtimeverification.com/blog/new-technologies-for-the-blockchain-
iele-virtual-machine-and-k-universal-language-framework/
ERC20-K: Formal Executable
Spec of ERC20
https://github.com/runtimeverification/erc20-semantics
Formal Verification for Solidity Contracts
https://forum.ethereum.org/discussion/3779/formal-verification-for-solidity-contracts
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
Distribution, Trust Correctness
Validation
Simulation
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
Did I program/specify the right behaviors?
Will the infrastructure execute the behaviors faithfully?
Ethereum
VM/Network
Iulia
Hyperledger
Java
Executable Multi-Party Contract Language
DSL
Logistics
DSL
Finance
DSL
…
KernelF
Distribution, Trust Correctness
Validation
Simulation
Expressiveness
SMTLIB
Z3
HTML
JavaScript
CSS
Interaction, Integration
An Architecture For Smart Contracts
Did I program/specify the right behaviors?
Will the infrastructure execute the behaviors faithfully?
Wrap Up
Further Reading
Blockchains
Mutable State in KernelF
https://medium.com/@markusvoelter/
dealing-with-mutable-state-in-kernelf-e0fdec8a489b
A Smart Contract Development Stack
https://languageengineering.io/
a-smart-contract-development-stack-54533a3a503a
A Smart Contract Development Stack, Pt. 2
https://languageengineering.io/a-smart-contract-development-
stack-part-ii-game-theoretical-aspects-ca7a9d2e548d
KernelF Reference
http://voelter.de/data/pub/kernelf-reference.pdf
DSLs in Safety-Critical Development
http://voelter.de/data/pub/MPS-in-Safety-1.0.pdf
We need better languages
Integration of verification tools
Simulation, Experimentation and Test
to describe contracts in a meaningful way
can be an important step to assure correctness
should be available in an interactive, local environment
Contracts must be functionally correct
in order for stakeholders to trust them.
Deployment to Blockchain is non-func,
it provides guarantees beyond functionality
Other deployments are useful,
that provide other trade-offs (secure , fast )

Weitere ähnliche Inhalte

Ähnlich wie Deklarative Smart Contracts

Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Simone Onofri
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxGene Leybzon
 
What is Solidity basic concepts_.pdf
What is Solidity basic concepts_.pdfWhat is Solidity basic concepts_.pdf
What is Solidity basic concepts_.pdf101 Blockchains
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word documentSIVAJISADHANA
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .netMarco Parenzan
 
02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric  02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric Merlec Mpyana
 
Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Dr. Ketan Parmar
 
Interesting Facts About Ethereum Smart contract Development
Interesting Facts About Ethereum Smart contract DevelopmentInteresting Facts About Ethereum Smart contract Development
Interesting Facts About Ethereum Smart contract DevelopmentDevelopcoins
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewJorgen Thelin
 
Encode Educate session 2 - Learn to code using Concordium
Encode Educate session 2 - Learn to code using ConcordiumEncode Educate session 2 - Learn to code using Concordium
Encode Educate session 2 - Learn to code using ConcordiumVanessa Lošić
 
@lis agent communication, ontologies, protocols, semantic web 2003
@lis   agent communication, ontologies, protocols, semantic web 2003@lis   agent communication, ontologies, protocols, semantic web 2003
@lis agent communication, ontologies, protocols, semantic web 2003Luigi Ceccaroni
 
Introduction To Solidity
Introduction To SolidityIntroduction To Solidity
Introduction To Solidity101 Blockchains
 
Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Dr. Ketan Parmar
 

Ähnlich wie Deklarative Smart Contracts (20)

Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
Attacking and Exploiting Ethereum Smart Contracts: Auditing 101
 
thrift-20070401
thrift-20070401thrift-20070401
thrift-20070401
 
Introduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptxIntroduction to Solidity and Smart Contract Development (9).pptx
Introduction to Solidity and Smart Contract Development (9).pptx
 
What is Solidity basic concepts_.pdf
What is Solidity basic concepts_.pdfWhat is Solidity basic concepts_.pdf
What is Solidity basic concepts_.pdf
 
Inside.Net
Inside.NetInside.Net
Inside.Net
 
Fluence.sh
Fluence.sh Fluence.sh
Fluence.sh
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
New microsoft office word document
New microsoft office word documentNew microsoft office word document
New microsoft office word document
 
Developing Actors in Azure with .net
Developing Actors in Azure with .netDeveloping Actors in Azure with .net
Developing Actors in Azure with .net
 
02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric  02 - Introduction to Hyperledger Fabric
02 - Introduction to Hyperledger Fabric
 
Hyperledger Fabric & Composer
Hyperledger Fabric & Composer Hyperledger Fabric & Composer
Hyperledger Fabric & Composer
 
dot NET Framework
dot NET Frameworkdot NET Framework
dot NET Framework
 
Interesting Facts About Ethereum Smart contract Development
Interesting Facts About Ethereum Smart contract DevelopmentInteresting Facts About Ethereum Smart contract Development
Interesting Facts About Ethereum Smart contract Development
 
Interoperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) OverviewInteroperability and Windows Communication Foundation (WCF) Overview
Interoperability and Windows Communication Foundation (WCF) Overview
 
Encode Educate session 2 - Learn to code using Concordium
Encode Educate session 2 - Learn to code using ConcordiumEncode Educate session 2 - Learn to code using Concordium
Encode Educate session 2 - Learn to code using Concordium
 
@lis agent communication, ontologies, protocols, semantic web 2003
@lis   agent communication, ontologies, protocols, semantic web 2003@lis   agent communication, ontologies, protocols, semantic web 2003
@lis agent communication, ontologies, protocols, semantic web 2003
 
Introduction To Solidity
Introduction To SolidityIntroduction To Solidity
Introduction To Solidity
 
Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer Introduction of Hyperledger Fabric & Composer
Introduction of Hyperledger Fabric & Composer
 
Balaji Resume
Balaji ResumeBalaji Resume
Balaji Resume
 

Mehr von Markus Voelter

Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?Markus Voelter
 
Using language workbenches and domain-specific languages for safety-critical ...
Using language workbenches and domain-specific languages for safety-critical ...Using language workbenches and domain-specific languages for safety-critical ...
Using language workbenches and domain-specific languages for safety-critical ...Markus Voelter
 
What's Missing in Language Workbenches
What's Missing in Language WorkbenchesWhat's Missing in Language Workbenches
What's Missing in Language WorkbenchesMarkus Voelter
 
How Domains Shape Languages
 How Domains Shape Languages How Domains Shape Languages
How Domains Shape LanguagesMarkus Voelter
 
Why Modeling Suck Sucks
Why Modeling Suck SucksWhy Modeling Suck Sucks
Why Modeling Suck SucksMarkus Voelter
 
Fusing Modeling and Programming into Language-Oriented Programming
Fusing Modeling and Programming into Language-Oriented ProgrammingFusing Modeling and Programming into Language-Oriented Programming
Fusing Modeling and Programming into Language-Oriented ProgrammingMarkus Voelter
 
The future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsThe future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsMarkus Voelter
 
Lessons Learned from building mbeddr
Lessons Learned from building mbeddrLessons Learned from building mbeddr
Lessons Learned from building mbeddrMarkus Voelter
 
The Design, Evolution and Use of KernelF
The Design, Evolution and Use of KernelFThe Design, Evolution and Use of KernelF
The Design, Evolution and Use of KernelFMarkus Voelter
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesMarkus Voelter
 
Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific LanguagesMarkus Voelter
 
Generic Tools - Specific Languages (PhD Defense Slides)
Generic Tools - Specific Languages (PhD Defense Slides)Generic Tools - Specific Languages (PhD Defense Slides)
Generic Tools - Specific Languages (PhD Defense Slides)Markus Voelter
 
Language-Oriented Business Applications
Language-Oriented Business ApplicationsLanguage-Oriented Business Applications
Language-Oriented Business ApplicationsMarkus Voelter
 
Generic Tools, Specific Laguages
Generic Tools, Specific LaguagesGeneric Tools, Specific Laguages
Generic Tools, Specific LaguagesMarkus Voelter
 
Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language DesignMarkus Voelter
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back AgainMarkus Voelter
 
Faszination Segelfliegen
Faszination SegelfliegenFaszination Segelfliegen
Faszination SegelfliegenMarkus Voelter
 
Professional Podcasting Guide
Professional Podcasting GuideProfessional Podcasting Guide
Professional Podcasting GuideMarkus Voelter
 

Mehr von Markus Voelter (20)

Consulting
ConsultingConsulting
Consulting
 
Build your own Language - Why and How?
Build your own Language - Why and How?Build your own Language - Why and How?
Build your own Language - Why and How?
 
Using language workbenches and domain-specific languages for safety-critical ...
Using language workbenches and domain-specific languages for safety-critical ...Using language workbenches and domain-specific languages for safety-critical ...
Using language workbenches and domain-specific languages for safety-critical ...
 
What's Missing in Language Workbenches
What's Missing in Language WorkbenchesWhat's Missing in Language Workbenches
What's Missing in Language Workbenches
 
How Domains Shape Languages
 How Domains Shape Languages How Domains Shape Languages
How Domains Shape Languages
 
Why Modeling Suck Sucks
Why Modeling Suck SucksWhy Modeling Suck Sucks
Why Modeling Suck Sucks
 
Fusing Modeling and Programming into Language-Oriented Programming
Fusing Modeling and Programming into Language-Oriented ProgrammingFusing Modeling and Programming into Language-Oriented Programming
Fusing Modeling and Programming into Language-Oriented Programming
 
The future of DSLs - functions and formal methods
The future of DSLs - functions and formal methodsThe future of DSLs - functions and formal methods
The future of DSLs - functions and formal methods
 
Lessons Learned from building mbeddr
Lessons Learned from building mbeddrLessons Learned from building mbeddr
Lessons Learned from building mbeddr
 
The Design, Evolution and Use of KernelF
The Design, Evolution and Use of KernelFThe Design, Evolution and Use of KernelF
The Design, Evolution and Use of KernelF
 
Envisioning the Future of Language Workbenches
Envisioning the Future of Language WorkbenchesEnvisioning the Future of Language Workbenches
Envisioning the Future of Language Workbenches
 
Architecting Domain-Specific Languages
Architecting Domain-Specific LanguagesArchitecting Domain-Specific Languages
Architecting Domain-Specific Languages
 
Generic Tools - Specific Languages (PhD Defense Slides)
Generic Tools - Specific Languages (PhD Defense Slides)Generic Tools - Specific Languages (PhD Defense Slides)
Generic Tools - Specific Languages (PhD Defense Slides)
 
Language-Oriented Business Applications
Language-Oriented Business ApplicationsLanguage-Oriented Business Applications
Language-Oriented Business Applications
 
Generic Tools, Specific Laguages
Generic Tools, Specific LaguagesGeneric Tools, Specific Laguages
Generic Tools, Specific Laguages
 
Domain Specific Language Design
Domain Specific Language DesignDomain Specific Language Design
Domain Specific Language Design
 
From Programming to Modeling And Back Again
From Programming to Modeling And Back AgainFrom Programming to Modeling And Back Again
From Programming to Modeling And Back Again
 
Faszination Segelfliegen
Faszination SegelfliegenFaszination Segelfliegen
Faszination Segelfliegen
 
Introduction To MDD
Introduction To MDDIntroduction To MDD
Introduction To MDD
 
Professional Podcasting Guide
Professional Podcasting GuideProfessional Podcasting Guide
Professional Podcasting Guide
 

Kürzlich hochgeladen

call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️Delhi Call girls
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionSolGuruz
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️anilsa9823
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AIABDERRAOUF MEHENNI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsArshad QA
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Steffen Staab
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsJhone kinadey
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceanilsa9823
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...kellynguyen01
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxbodapatigopi8531
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdfWave PLM
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...OnePlan Solutions
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Modelsaagamshah0812
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...MyIntelliSource, Inc.
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...ICS
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...panagenda
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfkalichargn70th171
 

Kürzlich hochgeladen (20)

Microsoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdfMicrosoft AI Transformation Partner Playbook.pdf
Microsoft AI Transformation Partner Playbook.pdf
 
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
call girls in Vaishali (Ghaziabad) 🔝 >༒8448380779 🔝 genuine Escort Service 🔝✔️✔️
 
Diamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with PrecisionDiamond Application Development Crafting Solutions with Precision
Diamond Application Development Crafting Solutions with Precision
 
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online  ☂️
CALL ON ➥8923113531 🔝Call Girls Kakori Lucknow best sexual service Online ☂️
 
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AISyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
SyndBuddy AI 2k Review 2024: Revolutionizing Content Syndication with AI
 
Software Quality Assurance Interview Questions
Software Quality Assurance Interview QuestionsSoftware Quality Assurance Interview Questions
Software Quality Assurance Interview Questions
 
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS LiveVip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
Vip Call Girls Noida ➡️ Delhi ➡️ 9999965857 No Advance 24HRS Live
 
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
Shapes for Sharing between Graph Data Spaces - and Epistemic Querying of RDF-...
 
Right Money Management App For Your Financial Goals
Right Money Management App For Your Financial GoalsRight Money Management App For Your Financial Goals
Right Money Management App For Your Financial Goals
 
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female serviceCALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
CALL ON ➥8923113531 🔝Call Girls Badshah Nagar Lucknow best Female service
 
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
Short Story: Unveiling the Reasoning Abilities of Large Language Models by Ke...
 
Hand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptxHand gesture recognition PROJECT PPT.pptx
Hand gesture recognition PROJECT PPT.pptx
 
5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf5 Signs You Need a Fashion PLM Software.pdf
5 Signs You Need a Fashion PLM Software.pdf
 
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
Tech Tuesday-Harness the Power of Effective Resource Planning with OnePlan’s ...
 
Unlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language ModelsUnlocking the Future of AI Agents with Large Language Models
Unlocking the Future of AI Agents with Large Language Models
 
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
Try MyIntelliAccount Cloud Accounting Software As A Service Solution Risk Fre...
 
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
The Real-World Challenges of Medical Device Cybersecurity- Mitigating Vulnera...
 
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
W01_panagenda_Navigating-the-Future-with-The-Hitchhikers-Guide-to-Notes-and-D...
 
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICECHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
CHEAP Call Girls in Pushp Vihar (-DELHI )🔝 9953056974🔝(=)/CALL GIRLS SERVICE
 
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdfThe Ultimate Test Automation Guide_ Best Practices and Tips.pdf
The Ultimate Test Automation Guide_ Best Practices and Tips.pdf
 

Deklarative Smart Contracts

  • 4. An actual contract, executed automatically. Multiple Parties. Decision | | Agreement | | Coordination. (Legally) Binding & Trusted. Formal Language. Checkable. Understandable. „Event Tracking“ Progress over time
  • 7. Blockchains can provide certain non-functional properties to executable contracts. Blockchains are a suitable (partial) implementation technology iff these properties are needed.
  • 8. Verification Ensure that the program performs correctly the things the program text tells it to do. Validation Ensure that the program does the correct things, wrt. to the requirements.
  • 9. Verification Ensure that the program performs correctly the things the program text tells it to do. Validation Ensure that the program does the correct things, wrt. to the requirements. Contract Execution Contract Definition
  • 10. Correct-by-Construction The language/framework/ API/modeling tool doesn’t allow a particular class of mistakes. Analysis-and-Fix You analyze the code/model after the fact and try to find problems which devs then fix.
  • 12. „ Well, people realize that these contracts have to run reliably, after all, the programs deal with real values now. “ Some Blockchain Guy
  • 13. Not the first community to realize ... J
  • 14. Lots of History & Research Computational Law Obligation, Permission Ordering, Causality, Time Event, State
  • 15. Lots of History & Research Blockchains Composing contracts: an adventure in financial engineering https://lexifi.com/files/resources/MLFiPaper.pdf POETS Process-oriented event-driven transaction systems https://github.com/legalese/poets/blob/master/doc/ Henglein%20-%20POETS%20Process-oriented%20event- driven%20transaction%20systems.pdf https://github.com/legalese/poets/blob/master/ doc/hvitvedmaster.pdf Domain-Specific Languages for Enterprise Systems https://bitbucket.org/jespera/poets/raw/c0ee7194ce57d2ad6ca8894c 8a44e88e546d5f4a/doc/poets-techreport/tr.pdf Contracts in Programming and in Enterprise Systems
  • 17. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF MPS / Convecton Distribution, Trust Correctness Validation Simulation Collaboration Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts Generate to verification tools to build more confidence beyond type checking.
  • 18.
  • 19. Declarative Description MultiPartyBooleanDecision A declarative, configurable specification of how a number of parties makes a (Boolean) decision.
  • 20. Execution and Test A MPBD instance maintains the state of a decision process as it evolves over time. Here, we play with an instance in the interactive REPL.
  • 21. Combination with State Machines More complex contracts are modeled as state machines; events are the API. Internally, the use BPBDs.
  • 22. Combintation with State Machines II Here, a transition action creates a new AccessControl instance ... The state of that instance is then used in guard condition for the top level SM.
  • 23. Preventing Game Theoretical Attacks Only „valid“ senders can enter this state. Events can only arrive at limited rate. States must be entered turn-by-turn.
  • 24. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF MPS / Convecton Distribution, Trust Correctness Validation Simulation Collaboration Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts I D E A
  • 25. Example: HyperCSL Blockchains Lisp (Clojure) based internal DSL for specifi- cation of general commercial contracts. Inspired by Simon Peyton Jones and Jean-Marc Eber and the POETS group at CPHU and ITU in Denmark. Uses Ken Adams’ Categories of Contract Language as fundametal semantic building blocks. Interpreter and UI in prototype stage.
  • 27. Example: HyperCSL Blockchains A UI to visualize the interactive execution of CSL contracts.
  • 29. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF MPS / Convecton Distribution, Trust Correctness Validation Simulation Collaboration Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts KernelF is an extensible functional language used at the core of DSLs.
  • 30. DSL Development New Language GPL Extension Formalization Reuse GPL incl. Expressions and TS Add/Embed DS-extensions Compatible notational style Reduce to GPL Analyze Domain to find Abstractions Define suitable, new notations. Rely on existing behavioral paradigm Reuse standard expression language Interpret/Generate to one or more GPLs Use existing notation from domain Clean up and formalize Generate/Interpret Often import existing „models“ KernelF
  • 31. Functional Features Functional, no state at its core. Purity + Effect Tracking The usual types, literals and op‘s Various Conditionals Functions and Blocks No null, only opt<T> Error Handling Immutable Collections and higher-order functions Enums, tuples, records, all immutable Constraints on types and functions Boxes (like Clojure‘s ref) Transactional Memory State Machines Interactors Stateful Features Extensible/Embeddable through modular language implementation and other means.
  • 32. (Meta-) Tooling Language Workbench Open Source, by Jetbrains Very Powerful Used for years by itemis and others Vast Experience
  • 37. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF MPS / Convecton Distribution, Trust Correctness Validation Simulation Collaboration Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts
  • 38. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF MPS / Convecton Distribution, Trust Correctness Validation Simulation Collaboration Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts <x TRUST?
  • 39. Verifying Blockchain Infrastructure Blockchains Formal Semantics of the EVM in K https://www.ideals.illinois.edu/bitstream/handle/2142/97207/hilden brandt-saxena-zhu-rodrigues-guth-daian-rosu-2017-tr_0818.pdf IELE: Register-Based VM for the Blockchain https://runtimeverification.com/blog/new-technologies-for-the-blockchain- iele-virtual-machine-and-k-universal-language-framework/ ERC20-K: Formal Executable Spec of ERC20 https://github.com/runtimeverification/erc20-semantics Formal Verification for Solidity Contracts https://forum.ethereum.org/discussion/3779/formal-verification-for-solidity-contracts
  • 40. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF Distribution, Trust Correctness Validation Simulation Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts Did I program/specify the right behaviors? Will the infrastructure execute the behaviors faithfully?
  • 41. Ethereum VM/Network Iulia Hyperledger Java Executable Multi-Party Contract Language DSL Logistics DSL Finance DSL … KernelF Distribution, Trust Correctness Validation Simulation Expressiveness SMTLIB Z3 HTML JavaScript CSS Interaction, Integration An Architecture For Smart Contracts Did I program/specify the right behaviors? Will the infrastructure execute the behaviors faithfully?
  • 43. Further Reading Blockchains Mutable State in KernelF https://medium.com/@markusvoelter/ dealing-with-mutable-state-in-kernelf-e0fdec8a489b A Smart Contract Development Stack https://languageengineering.io/ a-smart-contract-development-stack-54533a3a503a A Smart Contract Development Stack, Pt. 2 https://languageengineering.io/a-smart-contract-development- stack-part-ii-game-theoretical-aspects-ca7a9d2e548d KernelF Reference http://voelter.de/data/pub/kernelf-reference.pdf DSLs in Safety-Critical Development http://voelter.de/data/pub/MPS-in-Safety-1.0.pdf
  • 44. We need better languages Integration of verification tools Simulation, Experimentation and Test to describe contracts in a meaningful way can be an important step to assure correctness should be available in an interactive, local environment Contracts must be functionally correct in order for stakeholders to trust them. Deployment to Blockchain is non-func, it provides guarantees beyond functionality Other deployments are useful, that provide other trade-offs (secure , fast )