Features of blockchain technology (BCT) such as decentralisation, trust, fault tolerance, and accountability, are of paramount importance for multi-agent systems (MAS). In this paper we argue that a principled approach to MAS-BCT integration cannot overlook the foundational character of agency—that is, autonomy. Accordingly, we present a custom BCT implementation where autonomy is placed in smart contracts (SC) interpreted as software agents. We show how agency can enhance SC expressiveness with autonomy, situatedness, sociality, and intelligence, and highlight the limitations of state-of-art BCT in supporting MAS design and implementation.
Blepharitis inflammation of eyelid symptoms cause everything included along w...
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