SlideShare a Scribd company logo
Towards Agent-Oriented Blockchains:
Autonomous Smart Contracts
Giovanni Ciatto1 Alfredo Maffi1 Stefano Mariani2
Andrea Omicini1
giovanni.ciatto@unibo.it alfredo.maffi@studio.unibo.it
stefano.mariani@unimore.it andrea.omicini@unibo.it
1Dipartimento di Informatica – Scienza e Ingegneria—Universit`a di Bologna
2Dipartimento di Scienze e Metodi dell’Ingegneria, Universit`a di Modena e Reggio Emilia
17th International Conference on
Practical Applications of Agents and Multi-Agent Systems
´Avila, Spain – June 27, 2019
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 1 / 19
Outline
1 Blockchain and Smart Contracts: Overview
2 Why Agency is a Better Choice for Smart Contracts
3 Roadmap to Agency for Smart Contracts
4 Tenderfone: Our Prototype
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 2 / 19
Blockchain and Smart Contracts: Overview
Next in Line. . .
1 Blockchain and Smart Contracts: Overview
2 Why Agency is a Better Choice for Smart Contracts
3 Roadmap to Agency for Smart Contracts
4 Tenderfone: Our Prototype
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 3 / 19
Blockchain and Smart Contracts: Overview
Smart Contracts and Blockchain at a Glance
Shared, append-only, and distributed ledger of transactions
tracking changes to the state of some asset
Secured using cryptographic schemes & replication
Transactions are approved and propagated through consensus
Smart contracts (SC) if the tracked assets are reactive processes
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 4 / 19
Blockchain and Smart Contracts: Overview
Layered View of Blockchain Systems
Smart contracts
Interpreter
Consensus engine
Network
Users may deploy custom smart contracts
SC are executed by a replicated interpreter
Replicas kept consistent by consensus engine
e.g. middleware + consensus protocol
Research questions
Which is the current programming paradigm for SC?
Which is the best programming paradigm for SC?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 5 / 19
Blockchain and Smart Contracts: Overview
Layered View of Blockchain Systems
Smart contracts
Interpreter
Consensus engine
Network
Users may deploy custom smart contracts
SC are executed by a replicated interpreter
Replicas kept consistent by consensus engine
e.g. middleware + consensus protocol
Research questions
Which is the current programming paradigm for SC?
Which is the best programming paradigm for SC?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 5 / 19
Why Agency is a Better Choice for Smart Contracts
Next in Line. . .
1 Blockchain and Smart Contracts: Overview
2 Why Agency is a Better Choice for Smart Contracts
3 Roadmap to Agency for Smart Contracts
4 Tenderfone: Our Prototype
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 6 / 19
Why Agency is a Better Choice for Smart Contracts
Smart Contracts – Expectations vs. Reality
What they promise
autonomous entities
augmenting real world
contracts . . .
. . . with self-enforcing clauses
acting as trusted intermediaries
What they actually are
essentially objects, as in OOP
× no control flow encapsulation
× sync. method call
× purely reactive
+ blockchain limitations
× only finite computations
× only deterministic
computations
× no concurrency
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 7 / 19
Why Agency is a Better Choice for Smart Contracts
Smart Contracts – Expectations vs. Reality
What they promise
autonomous entities
augmenting real world
contracts . . .
. . . with self-enforcing clauses
acting as trusted intermediaries
What they actually are
essentially objects, as in OOP
× no control flow encapsulation
× sync. method call
× purely reactive
+ blockchain limitations
× only finite computations
× only deterministic
computations
× no concurrency
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 7 / 19
Why Agency is a Better Choice for Smart Contracts
Our Claim
Takeaway
SC would better match their intended goal if modelled as intelligent agents
through computational autonomy, SC would be able to enforce more
complex rules
rule enforcement steps through perception, deliberation, and action
inference capabilities may let SC autonomously figure out how to
enforce rules
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 8 / 19
Roadmap to Agency for Smart Contracts
Next in Line. . .
1 Blockchain and Smart Contracts: Overview
2 Why Agency is a Better Choice for Smart Contracts
3 Roadmap to Agency for Smart Contracts
4 Tenderfone: Our Prototype
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 9 / 19
Roadmap to Agency for Smart Contracts
Stairway to Agency – How Should SC Achieve Autonomy?
State-of-art
control flow

encapsulation
asynchronous

communication
reactiveness

to time
Tenderfone
reactiveness

to environment

and space
logic

inference
BDI

architecture
“Strong” agency
expressiveness
abstraction gap
Step 1: Computational and social autonomy
how to realise control flow encapsulation?
how to realise asynchronous communication among SC?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
Roadmap to Agency for Smart Contracts
Stairway to Agency – How Should SC Achieve Autonomy?
State-of-art
control flow

encapsulation
asynchronous

communication
reactiveness

to time
Tenderfone
reactiveness

to environment

and space
logic

inference
BDI

architecture
“Strong” agency
expressiveness
abstraction gap
Step 2: Temporal situatedness
how to make SC time aware?
how to make SC time reactive?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
Roadmap to Agency for Smart Contracts
Stairway to Agency – How Should SC Achieve Autonomy?
State-of-art
control flow

encapsulation
asynchronous

communication
reactiveness

to time
Tenderfone
reactiveness

to environment

and space
logic

inference
BDI

architecture
“Strong” agency
expressiveness
abstraction gap
Step 3: Spatial, environmental situatedness
how to model spatial situatedness?
how to model the environment?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
Roadmap to Agency for Smart Contracts
Stairway to Agency – How Should SC Achieve Autonomy?
State-of-art
control flow

encapsulation
asynchronous

communication
reactiveness

to time
Tenderfone
reactiveness

to environment

and space
logic

inference
BDI

architecture
“Strong” agency
expressiveness
abstraction gap
Step 4: Inference capabilities
which sorts of inference may SC exploit?
on which knowledge bases?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
Roadmap to Agency for Smart Contracts
Stairway to Agency – How Should SC Achieve Autonomy?
State-of-art
control flow

encapsulation
asynchronous

communication
reactiveness

to time
Tenderfone
reactiveness

to environment

and space
logic

inference
BDI

architecture
“Strong” agency
expressiveness
abstraction gap
Step 5: Goal-orientation (e.g. BDI)
how to model multiple intentions (i.e. multiple control flows)?
how to model perceptions, and actions?
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
Tenderfone: Our Prototype
Next in Line. . .
1 Blockchain and Smart Contracts: Overview
2 Why Agency is a Better Choice for Smart Contracts
3 Roadmap to Agency for Smart Contracts
4 Tenderfone: Our Prototype
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 11 / 19
Tenderfone: Our Prototype
Tenderfone
Autonomous, logic SC
Tenderfone
Tendermint + tuProlog
Network
Our prototype for a SC interpreter
realises step 1, 2, 4 of our roadmap
provides an interpreter for
computationally autonomous,
logic-based smart contracts
based on the Tendermint [Kwon, 2014]
consensus engine and the tuProlog
framework [Denti et al., 2001]
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 12 / 19
Tenderfone: Our Prototype
Tenderfone Smart Contracts API I
SC programs are Prolog theories, with facts, rules, and callbacks
e.g. init/1 or receive/2
callbacks are executed when particular triggering events occur
e.g. SC creation, users messages, SC messages
in callbacks, SC can send messages (even to self) through primitives
some primitives are for time-related control flow management
e.g. send/2, delay/2 or periodically/2
users can manulate / interact with SC through meta-primitives
e.g. invoke/2 or deploy/2
both primitives and meta-primitives have an asynchronous semantics
full-fledged Prolog standard lib + Dynamic KB as SC storage
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 13 / 19
Tenderfone: Our Prototype
Tenderfone Smart Contracts API II
Callback Executor
Triggering
(meta-)primitives
Initiator
init(A) SC with KB = T deploy(T, A) user
receive(M, S) SC R
invoke(M, R)
send(M, R)
user S
SC S
receive(M, R) SC R
when(T, M)
delay(D, M)
periodically(P, M)
SC R
SC R
SC R
+ contextual predicates
e.g. self/1 or now/1
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 14 / 19
Tenderfone: Our Prototype
SC Program Example
§
init([Delay | OtherArgs]) :-
now(Time),
Next is Time + Delay,
when(Next, foo).
receive(foo, Me) :-
self(Me),
periodically(10 min, bar).
receive(bar, Me) :-
/* does something
once every 10 min */.
receive(Message, Sender) :-
not self(Sender),
Answer = /* compute answer */,
send(Answer, Sender).
¦ ¥
U A B
deploy(Delay)
init([Delay])
when(Now + Delay, foo)
after Delay seconds
receive(foo, A)
periodically(10 min, bar)
once every 10 minutes
receive(bar, A)
do something periodic
in any moment
Message
receive(Message, B)
compute Answer
send(Answer, B)
Answer
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 15 / 19
Tenderfone: Our Prototype
Why is this Challenging? ! more details at [Ciatto et al., 2019]
. . .
Interpreter
Consensus engine
. . .
Common TX workflow
Client → Replicas → Consensus → SC
! each SC is replicated as well
Tenderfone strongly rely on spontaneous
TX generated by interpreters
spontaneous TX are critical w.r.t.
current BCT architectures
in theory, we re-modeled how the
interpreter and consensus engine layers
should interact
in practice, no edits to the Tendermint
internalsCiatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 16 / 19
Conclusions and Future Work
Conclusion
Summarising, we
discuss why SC would be better modelled as agents
provide a research roadmap driving SC towards agency
describe an API for logic-based, autonomous SC
prove it possible through a prototype implementation: Tenderfone
In the future, we plan to
model environment, perception, and actions for SC
realise SC as BDI-like agents
endow SC with higher-level coordination/synchronisation mechanisms
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 17 / 19
Conclusions and Future Work
Conclusion
Summarising, we
discuss why SC would be better modelled as agents
provide a research roadmap driving SC towards agency
describe an API for logic-based, autonomous SC
prove it possible through a prototype implementation: Tenderfone
In the future, we plan to
model environment, perception, and actions for SC
realise SC as BDI-like agents
endow SC with higher-level coordination/synchronisation mechanisms
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 17 / 19
References
References
Ciatto, G., Maffi, A., Mariani, S., and Omicini, A. (2019).
Smart contracts are more than objects: Pro-activeness on the blockchain.
Denti, E., Omicini, A., and Ricci, A. (2001).
tuProlog: A light-weight Prolog for Internet applications and infrastructures.
In Practical Aspects of Declarative Languages, volume 1990 of LNCS, pages
184–198. Springer.
Kwon, J. (2014).
Tendermint: Consensus without mining.
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 18 / 19
Towards Agent-Oriented Blockchains:
Autonomous Smart Contracts
Giovanni Ciatto1 Alfredo Maffi1 Stefano Mariani2
Andrea Omicini1
giovanni.ciatto@unibo.it alfredo.maffi@studio.unibo.it
stefano.mariani@unimore.it andrea.omicini@unibo.it
1Dipartimento di Informatica – Scienza e Ingegneria—Universit`a di Bologna
2Dipartimento di Scienze e Metodi dell’Ingegneria, Universit`a di Modena e Reggio Emilia
17th International Conference on
Practical Applications of Agents and Multi-Agent Systems
´Avila, Spain – June 27, 2019
Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 19 / 19

More Related Content

PDF
Horizon 2020 & EC Innovation policy and Smart Cities EIP by Director Mario C...
PPTX
오픈 데이터, 팹시티와 메이커
PDF
SIP - Open Communications For Smart Grid Devices
PPTX
AI - Media Art. 인공지능과 미디어아트
PPTX
Tech Jam 2015: Global City Teams Challenge
PDF
Smart Contracts are More than Objects: Pro-activeness on the Blockchain
PPTX
Blockchain 2.0
PDF
All watched over machines of loving grace amsterdam
Horizon 2020 & EC Innovation policy and Smart Cities EIP by Director Mario C...
오픈 데이터, 팹시티와 메이커
SIP - Open Communications For Smart Grid Devices
AI - Media Art. 인공지능과 미디어아트
Tech Jam 2015: Global City Teams Challenge
Smart Contracts are More than Objects: Pro-activeness on the Blockchain
Blockchain 2.0
All watched over machines of loving grace amsterdam

Similar to Towards Agent-oriented Blockchains: Autonomous Smart Contracts (20)

PDF
Blockchain & Telecommunication Services Provider
PPTX
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
PDF
Smart contacts and the real world
PDF
SCAT-Final block chain detection .pdf
PDF
From the Blockchain to Logic Programming and back: Research perspectives
PPTX
Smart contract and smart contract oracles
PPTX
Smart contract and smart contract oracles
PDF
Smart Contracts (Qtum) by Alex Norta, PhD.
DOCX
UNIT V.docx cloud service management document anna university regulation 2021
PPTX
Intro to smart contract on blockchain en
PPTX
Smart contract and smart contracts oracles
PDF
Blockchain and smart contracts, what they are and why you should really care ...
PPTX
Smart contractjp smartcontract_about
PPTX
State Of Smart Contract Platforms from Smart Contract JP
PDF
Ibp technical introduction
PDF
The rise of cryptocurrency & smart contract in blockchain industry
PDF
Blockchain and smart contracts: infrastructure and platforms
PDF
Introduction to Blockchain and Smart Contracts
PDF
Blockchain-based Applications
PDF
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
Blockchain & Telecommunication Services Provider
Event Itnig - Smart Contracts by MarketPay, Juan Ignacio Pérez Sacristán
Smart contacts and the real world
SCAT-Final block chain detection .pdf
From the Blockchain to Logic Programming and back: Research perspectives
Smart contract and smart contract oracles
Smart contract and smart contract oracles
Smart Contracts (Qtum) by Alex Norta, PhD.
UNIT V.docx cloud service management document anna university regulation 2021
Intro to smart contract on blockchain en
Smart contract and smart contracts oracles
Blockchain and smart contracts, what they are and why you should really care ...
Smart contractjp smartcontract_about
State Of Smart Contract Platforms from Smart Contract JP
Ibp technical introduction
The rise of cryptocurrency & smart contract in blockchain industry
Blockchain and smart contracts: infrastructure and platforms
Introduction to Blockchain and Smart Contracts
Blockchain-based Applications
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
Ad

More from Giovanni Ciatto (10)

PDF
An Abstract Framework for Agent-Based Explanations in AI
PDF
2P-Kt: logic programming with objects & functions in Kotlin
PDF
Towards XMAS: eXplainability through Multi-Agent Systems
PDF
TuSoW: Tuple Spaces for Edge Computing
PDF
Comparative Analysis of Blockchain Technologies under a Coordination Perspective
PDF
Blockchain and Smart Contracts
PDF
Logic Programming in Space-Time: The Case of Situatedness in LPaaS
PDF
Blockchain & Smart Contracts Basics and Perspectives for MAS
PDF
A gentle introduction to the Blockchain and Smart Contracts
PDF
Introduzione alla Blockchain
An Abstract Framework for Agent-Based Explanations in AI
2P-Kt: logic programming with objects & functions in Kotlin
Towards XMAS: eXplainability through Multi-Agent Systems
TuSoW: Tuple Spaces for Edge Computing
Comparative Analysis of Blockchain Technologies under a Coordination Perspective
Blockchain and Smart Contracts
Logic Programming in Space-Time: The Case of Situatedness in LPaaS
Blockchain & Smart Contracts Basics and Perspectives for MAS
A gentle introduction to the Blockchain and Smart Contracts
Introduzione alla Blockchain
Ad

Recently uploaded (20)

PDF
Paper PDF World Game (s) Great Redesign.pdf
PPTX
Internet___Basics___Styled_ presentation
PDF
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
PDF
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
PPTX
artificialintelligenceai1-copy-210604123353.pptx
PDF
Tenda Login Guide: Access Your Router in 5 Easy Steps
PDF
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
PPTX
artificial intelligence overview of it and more
PDF
An introduction to the IFRS (ISSB) Stndards.pdf
PPTX
522797556-Unit-2-Temperature-measurement-1-1.pptx
PPTX
Power Point - Lesson 3_2.pptx grad school presentation
PPTX
E -tech empowerment technologies PowerPoint
PPTX
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
PPT
Ethics in Information System - Management Information System
PPTX
Slides PPTX World Game (s) Eco Economic Epochs.pptx
PPTX
Funds Management Learning Material for Beg
PPTX
PptxGenJS_Demo_Chart_20250317130215833.pptx
PPTX
Job_Card_System_Styled_lorem_ipsum_.pptx
PPT
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
PPT
Design_with_Watersergyerge45hrbgre4top (1).ppt
Paper PDF World Game (s) Great Redesign.pdf
Internet___Basics___Styled_ presentation
Best Practices for Testing and Debugging Shopify Third-Party API Integrations...
Automated vs Manual WooCommerce to Shopify Migration_ Pros & Cons.pdf
artificialintelligenceai1-copy-210604123353.pptx
Tenda Login Guide: Access Your Router in 5 Easy Steps
Smart Home Technology for Health Monitoring (www.kiu.ac.ug)
artificial intelligence overview of it and more
An introduction to the IFRS (ISSB) Stndards.pdf
522797556-Unit-2-Temperature-measurement-1-1.pptx
Power Point - Lesson 3_2.pptx grad school presentation
E -tech empowerment technologies PowerPoint
Introduction about ICD -10 and ICD11 on 5.8.25.pptx
Ethics in Information System - Management Information System
Slides PPTX World Game (s) Eco Economic Epochs.pptx
Funds Management Learning Material for Beg
PptxGenJS_Demo_Chart_20250317130215833.pptx
Job_Card_System_Styled_lorem_ipsum_.pptx
FIRE PREVENTION AND CONTROL PLAN- LUS.FM.MQ.OM.UTM.PLN.00014.ppt
Design_with_Watersergyerge45hrbgre4top (1).ppt

Towards Agent-oriented Blockchains: Autonomous Smart Contracts

  • 1. Towards Agent-Oriented Blockchains: Autonomous Smart Contracts Giovanni Ciatto1 Alfredo Maffi1 Stefano Mariani2 Andrea Omicini1 giovanni.ciatto@unibo.it alfredo.maffi@studio.unibo.it stefano.mariani@unimore.it andrea.omicini@unibo.it 1Dipartimento di Informatica – Scienza e Ingegneria—Universit`a di Bologna 2Dipartimento di Scienze e Metodi dell’Ingegneria, Universit`a di Modena e Reggio Emilia 17th International Conference on Practical Applications of Agents and Multi-Agent Systems ´Avila, Spain – June 27, 2019 Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 1 / 19
  • 2. Outline 1 Blockchain and Smart Contracts: Overview 2 Why Agency is a Better Choice for Smart Contracts 3 Roadmap to Agency for Smart Contracts 4 Tenderfone: Our Prototype Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 2 / 19
  • 3. Blockchain and Smart Contracts: Overview Next in Line. . . 1 Blockchain and Smart Contracts: Overview 2 Why Agency is a Better Choice for Smart Contracts 3 Roadmap to Agency for Smart Contracts 4 Tenderfone: Our Prototype Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 3 / 19
  • 4. Blockchain and Smart Contracts: Overview Smart Contracts and Blockchain at a Glance Shared, append-only, and distributed ledger of transactions tracking changes to the state of some asset Secured using cryptographic schemes & replication Transactions are approved and propagated through consensus Smart contracts (SC) if the tracked assets are reactive processes Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 4 / 19
  • 5. Blockchain and Smart Contracts: Overview Layered View of Blockchain Systems Smart contracts Interpreter Consensus engine Network Users may deploy custom smart contracts SC are executed by a replicated interpreter Replicas kept consistent by consensus engine e.g. middleware + consensus protocol Research questions Which is the current programming paradigm for SC? Which is the best programming paradigm for SC? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 5 / 19
  • 6. Blockchain and Smart Contracts: Overview Layered View of Blockchain Systems Smart contracts Interpreter Consensus engine Network Users may deploy custom smart contracts SC are executed by a replicated interpreter Replicas kept consistent by consensus engine e.g. middleware + consensus protocol Research questions Which is the current programming paradigm for SC? Which is the best programming paradigm for SC? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 5 / 19
  • 7. Why Agency is a Better Choice for Smart Contracts Next in Line. . . 1 Blockchain and Smart Contracts: Overview 2 Why Agency is a Better Choice for Smart Contracts 3 Roadmap to Agency for Smart Contracts 4 Tenderfone: Our Prototype Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 6 / 19
  • 8. Why Agency is a Better Choice for Smart Contracts Smart Contracts – Expectations vs. Reality What they promise autonomous entities augmenting real world contracts . . . . . . with self-enforcing clauses acting as trusted intermediaries What they actually are essentially objects, as in OOP × no control flow encapsulation × sync. method call × purely reactive + blockchain limitations × only finite computations × only deterministic computations × no concurrency Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 7 / 19
  • 9. Why Agency is a Better Choice for Smart Contracts Smart Contracts – Expectations vs. Reality What they promise autonomous entities augmenting real world contracts . . . . . . with self-enforcing clauses acting as trusted intermediaries What they actually are essentially objects, as in OOP × no control flow encapsulation × sync. method call × purely reactive + blockchain limitations × only finite computations × only deterministic computations × no concurrency Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 7 / 19
  • 10. Why Agency is a Better Choice for Smart Contracts Our Claim Takeaway SC would better match their intended goal if modelled as intelligent agents through computational autonomy, SC would be able to enforce more complex rules rule enforcement steps through perception, deliberation, and action inference capabilities may let SC autonomously figure out how to enforce rules Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 8 / 19
  • 11. Roadmap to Agency for Smart Contracts Next in Line. . . 1 Blockchain and Smart Contracts: Overview 2 Why Agency is a Better Choice for Smart Contracts 3 Roadmap to Agency for Smart Contracts 4 Tenderfone: Our Prototype Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 9 / 19
  • 12. Roadmap to Agency for Smart Contracts Stairway to Agency – How Should SC Achieve Autonomy? State-of-art control flow
 encapsulation asynchronous
 communication reactiveness
 to time Tenderfone reactiveness
 to environment
 and space logic
 inference BDI
 architecture “Strong” agency expressiveness abstraction gap Step 1: Computational and social autonomy how to realise control flow encapsulation? how to realise asynchronous communication among SC? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
  • 13. Roadmap to Agency for Smart Contracts Stairway to Agency – How Should SC Achieve Autonomy? State-of-art control flow
 encapsulation asynchronous
 communication reactiveness
 to time Tenderfone reactiveness
 to environment
 and space logic
 inference BDI
 architecture “Strong” agency expressiveness abstraction gap Step 2: Temporal situatedness how to make SC time aware? how to make SC time reactive? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
  • 14. Roadmap to Agency for Smart Contracts Stairway to Agency – How Should SC Achieve Autonomy? State-of-art control flow
 encapsulation asynchronous
 communication reactiveness
 to time Tenderfone reactiveness
 to environment
 and space logic
 inference BDI
 architecture “Strong” agency expressiveness abstraction gap Step 3: Spatial, environmental situatedness how to model spatial situatedness? how to model the environment? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
  • 15. Roadmap to Agency for Smart Contracts Stairway to Agency – How Should SC Achieve Autonomy? State-of-art control flow
 encapsulation asynchronous
 communication reactiveness
 to time Tenderfone reactiveness
 to environment
 and space logic
 inference BDI
 architecture “Strong” agency expressiveness abstraction gap Step 4: Inference capabilities which sorts of inference may SC exploit? on which knowledge bases? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
  • 16. Roadmap to Agency for Smart Contracts Stairway to Agency – How Should SC Achieve Autonomy? State-of-art control flow
 encapsulation asynchronous
 communication reactiveness
 to time Tenderfone reactiveness
 to environment
 and space logic
 inference BDI
 architecture “Strong” agency expressiveness abstraction gap Step 5: Goal-orientation (e.g. BDI) how to model multiple intentions (i.e. multiple control flows)? how to model perceptions, and actions? Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 10 / 19
  • 17. Tenderfone: Our Prototype Next in Line. . . 1 Blockchain and Smart Contracts: Overview 2 Why Agency is a Better Choice for Smart Contracts 3 Roadmap to Agency for Smart Contracts 4 Tenderfone: Our Prototype Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 11 / 19
  • 18. Tenderfone: Our Prototype Tenderfone Autonomous, logic SC Tenderfone Tendermint + tuProlog Network Our prototype for a SC interpreter realises step 1, 2, 4 of our roadmap provides an interpreter for computationally autonomous, logic-based smart contracts based on the Tendermint [Kwon, 2014] consensus engine and the tuProlog framework [Denti et al., 2001] Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 12 / 19
  • 19. Tenderfone: Our Prototype Tenderfone Smart Contracts API I SC programs are Prolog theories, with facts, rules, and callbacks e.g. init/1 or receive/2 callbacks are executed when particular triggering events occur e.g. SC creation, users messages, SC messages in callbacks, SC can send messages (even to self) through primitives some primitives are for time-related control flow management e.g. send/2, delay/2 or periodically/2 users can manulate / interact with SC through meta-primitives e.g. invoke/2 or deploy/2 both primitives and meta-primitives have an asynchronous semantics full-fledged Prolog standard lib + Dynamic KB as SC storage Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 13 / 19
  • 20. Tenderfone: Our Prototype Tenderfone Smart Contracts API II Callback Executor Triggering (meta-)primitives Initiator init(A) SC with KB = T deploy(T, A) user receive(M, S) SC R invoke(M, R) send(M, R) user S SC S receive(M, R) SC R when(T, M) delay(D, M) periodically(P, M) SC R SC R SC R + contextual predicates e.g. self/1 or now/1 Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 14 / 19
  • 21. Tenderfone: Our Prototype SC Program Example § init([Delay | OtherArgs]) :- now(Time), Next is Time + Delay, when(Next, foo). receive(foo, Me) :- self(Me), periodically(10 min, bar). receive(bar, Me) :- /* does something once every 10 min */. receive(Message, Sender) :- not self(Sender), Answer = /* compute answer */, send(Answer, Sender). ¦ ¥ U A B deploy(Delay) init([Delay]) when(Now + Delay, foo) after Delay seconds receive(foo, A) periodically(10 min, bar) once every 10 minutes receive(bar, A) do something periodic in any moment Message receive(Message, B) compute Answer send(Answer, B) Answer Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 15 / 19
  • 22. Tenderfone: Our Prototype Why is this Challenging? ! more details at [Ciatto et al., 2019] . . . Interpreter Consensus engine . . . Common TX workflow Client → Replicas → Consensus → SC ! each SC is replicated as well Tenderfone strongly rely on spontaneous TX generated by interpreters spontaneous TX are critical w.r.t. current BCT architectures in theory, we re-modeled how the interpreter and consensus engine layers should interact in practice, no edits to the Tendermint internalsCiatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 16 / 19
  • 23. Conclusions and Future Work Conclusion Summarising, we discuss why SC would be better modelled as agents provide a research roadmap driving SC towards agency describe an API for logic-based, autonomous SC prove it possible through a prototype implementation: Tenderfone In the future, we plan to model environment, perception, and actions for SC realise SC as BDI-like agents endow SC with higher-level coordination/synchronisation mechanisms Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 17 / 19
  • 24. Conclusions and Future Work Conclusion Summarising, we discuss why SC would be better modelled as agents provide a research roadmap driving SC towards agency describe an API for logic-based, autonomous SC prove it possible through a prototype implementation: Tenderfone In the future, we plan to model environment, perception, and actions for SC realise SC as BDI-like agents endow SC with higher-level coordination/synchronisation mechanisms Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 17 / 19
  • 25. References References Ciatto, G., Maffi, A., Mariani, S., and Omicini, A. (2019). Smart contracts are more than objects: Pro-activeness on the blockchain. Denti, E., Omicini, A., and Ricci, A. (2001). tuProlog: A light-weight Prolog for Internet applications and infrastructures. In Practical Aspects of Declarative Languages, volume 1990 of LNCS, pages 184–198. Springer. Kwon, J. (2014). Tendermint: Consensus without mining. Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 18 / 19
  • 26. Towards Agent-Oriented Blockchains: Autonomous Smart Contracts Giovanni Ciatto1 Alfredo Maffi1 Stefano Mariani2 Andrea Omicini1 giovanni.ciatto@unibo.it alfredo.maffi@studio.unibo.it stefano.mariani@unimore.it andrea.omicini@unibo.it 1Dipartimento di Informatica – Scienza e Ingegneria—Universit`a di Bologna 2Dipartimento di Scienze e Metodi dell’Ingegneria, Universit`a di Modena e Reggio Emilia 17th International Conference on Practical Applications of Agents and Multi-Agent Systems ´Avila, Spain – June 27, 2019 Ciatto et al. (UniBo, UniMoRe) Autonomous Smart Contracts PAAMS 2019, Jun 27 19 / 19