SlideShare ist ein Scribd-Unternehmen logo
1 von 30
Downloaden Sie, um offline zu lesen
From the Blockchain to Logic Programming and back
Research perspectives
Giovanni Ciatto1 Roberta Calegari1 Stefano Mariani2
Enrico Denti1 Andrea Omicini1
1
{roberta.calegari, giovanni.ciatto, enrico.denti,
andrea.omicini}@unibo.it
2
stefano.mariani@unimore.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
Talk @ 19th Workshop From Objects to Agents
Palermo, June 29, 2018
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 1 / 30
Outline
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 2 / 30
Motivations & Context
Next in Line. . .
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 3 / 30
Motivations & Context
Context
Blockchain Technology (BCT)
Novel way to achieve replication of business-logic & data on the net
consistency, untamperability, fault-tolerance, trust over decentralisation
eg cryptocurrencies (e.g. Bitcoin) or identity/access/asset management
Smart-contracts-enabled BCT (ScBCT)
An interpreter as the replicated application, executing smart contracts
ie trusted computational entities automatically handling our assets
Ethereum as the most prominent example
Logic programming (LP)
Programming as goal-oriented reasoning, on top of declarative language
supports meta-programming and provides understandable outputs (proofs)
employed in cognitive agents, e.g. AgentSpeak [Rao96]
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 4 / 30
Motivations & Context
Motivations
Can LP be useful within the scope of ScBCTs?
LP may positively affect smart contracts’
declarativeness, observability and mutability . . .
interaction semantics, through message-passing . . .
. . . paving the way towards agent-oriented smart contracts
Can BCTs be useful within the scope of LP?
BCTs as a shared blackboard for distributed cooperative reasoning
Smart contracts as logic services, `a la LPaaS [CDMO18]
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 5 / 30
Blockchain and smart contracts
Next in Line. . .
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 6 / 30
Blockchain and smart contracts Overview
Blockchain & Smart contracts Overview
ScBCT consist of a P2P network jointly pursuing State Machine
Replication (SMR) [CBPS10, Sch90]
maintaining a consistent view/update over/of a shared state . . .
. . . among mutually-untrusted nodes, a.k.a. miners
replicating an interpreter, i.e. a virtual machine, for smart contracts
by means of the
PoW
Proof-of-Work [Bac02, Nak08] consensus mechanism
providing eventual consistency of the whole system state
endowing cryptocurrencies with their economic value
logging all transactions affecting the shared state on the block-chain
issued by end users
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 7 / 30
Blockchain and smart contracts State, transactions & blocks
Blockchain main concepts I
TXs
hash( )
Index i-1
Timestamp
TXs
hash( )
Index i
Timestamp
TXs
hash( )
Index i+1
Timestamp
Statei-1 Statei Statei+1
States, transactions and blocks: the global p.o.v.
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 8 / 30
Blockchain and smart contracts State, transactions & blocks
Blockchain main concepts II
Transactions
Blocks
Blockchain
Miners
Clients
Miners, clients and replication: the network p.o.v.
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 9 / 30
Blockchain and smart contracts Smart contracts
Smart contracts [Sza96]
Definition
Stateful, reactive, user-defined, immutable, and deterministic processes
executing some arbitrary computation on the blockchain, i.e., while being
consistently replicated over the blockchain network
Stateful — they encapsulate their own state, like OOP’s objects
Reactive — they can only be triggered by issuing some invocation TX
User-defined — users can deploy their smart contracts implementing an
arbitrary logic by issuing a deployment TX
Immutable — their source/byte-code cannot be altered after deployment
Arbitrary — they are expressed with a Turing-complete language
Replicated — the blockchain is essentially a replicated interpreter, employing
a consensus protocol to keep the many replicas consistent
! Disclaimer: focus on the Ethereum platform
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 10 / 30
Blockchain and smart contracts Smart contracts
Smart contracts – Features and problems
State encapsulation + sync. interaction + transactional semantics
Object-oriented & imperative metaphor, e.g. Solidity
Side effects are reverted on exceptions
× problems arising from re-entrancy [LCO+16, LL17]
× imperative syntax is understandable to experts only
Immutability + observability of code =⇒ Trust in financial TXs
× may require disassembler or source code
Economic dimension of computations: miners need compensation
quasi-Turing completeness [Woo14]
× per-instruction economic-cost may hinder SW engineering
× Immutability =⇒ No bug fixes
× Pure reactiveness =⇒ No scheduled/periodic computations
× poor practical expressiveness
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 11 / 30
Blockchain and smart contracts Smart contracts
Smart contracts on the blockchain I
TXs
hash( )
Index i-1
Timestamp
TXs
hash( )
Index i
Timestamp
TXs
hash( )
Index i+1
Timestamp
Statei-1 Statei Statei+1
Smart contracts being deployed and evolving among states
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 12 / 30
Blockchain and smart contracts Smart contracts
Smart contracts on the blockchain II
Transactions
Blocks
Blockchain
Miners
Clients
Smart contracts
Smart contracts being replicated among peers
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 13 / 30
Logic-based smart contracts
Next in Line. . .
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 14 / 30
Logic-based smart contracts
Logic-based smart contracts
Smart contracts are re-interpreted as logic processes characterised by:
Logic theories as specification scripts
=⇒ Declarativeness & understandability
Strong division between static & dynamic KBs
Static KB defined upon deploy and immutable
Dynamic KB keeping track of the mutable state
=⇒ Controlled mutability by adding/removing rules
Special functors define smart contracts interaction semantics API
eg receive(Message) :- WhatToDo.
eg send(Message, Receiver).
send(M, R) triggers goal receive(Message) on R
TX is aborted if the goal cannot be proven
! Miners role, consensus mechanism, and transactional semantics remain unchanged
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 15 / 30
Logic-based smart contracts
Features and open questions
Interpreted Language & mutability =⇒ observability
State and behaviour inspectable without disassembler
Controlled mutability: a smart contract modifying it-self
(Inspectable) behaviour may be added/fixed after deploy
? Which semantics for inter-smart-contracts communication?
! Sync VS async semantics of the send/2 primitive
Async semantics =⇒ encapsulation of control flow
? Delayed messages for post-poned computations
Self-sent messages for periodic computations
Only makes sense for the async semantics
? Economic-related aspects of (logic-based) computation
Who’s paying for message-triggered computations?
Which value for unification? back-tracking? asserts? retracts? . . .
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 16 / 30
Logic-based smart contracts
Sync VS Async I
Invocation TX
Method Call
Return from Call
End of TX
hash( )
Index i
Timestamp
TX
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 17 / 30
Logic-based smart contracts
Sync VS Async II
Invocation TX
Message TX
Message TX
Message TX
hash( )
Index i
Timestamp
hash( )
Index i+2
Timestamp
hash( )
Index i+3
Timestamp
hash( )
Index i+1
Timestamp
TX TX TX TX
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 18 / 30
The blockchain for distributed Logic Programming
Next in Line. . .
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 19 / 30
The blockchain for distributed Logic Programming The blockchain as a Logic Theory
The blockchain as a Logic Theory
BCTs essentially provide consistent read/write access to distributed data
What if data were logic terms?
The whole blockchain represents (the evolution of) a logic theory
Clients may issue goals to the blockchain network
or asserting/retracting shared knowledge
Miners may cooperatively participate to the SLD resolution process
Navigating the proof-three in parallel
ie publishing partial results on the blockchain
? Economical incentives for a fair balancing of computational efforts
Preventing already proven goals to be proven again
? How to freeze the knowledge while reasoning?
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 20 / 30
The blockchain for distributed Logic Programming Smart contacts enabled BCTs as multiple theories
Smart contacts enabled BCTs as multiple theories
Smart contracts essentially control consistent read/write access their
internal state
What if each smart contract was responsible for a monotonic theory?
Non-monotone edits spawns a new smart contract
in charge of handling the new theory version
the old smart contract and its theory continue to exist
Multiple, possibly para-consistent logic theories
all originating from a common ancestor
each theory expresses what is true in a particular space-time point
each one is handled by a particular smart contract
Clients may query each smart contract’s theory
about a particular view of the world
smart contracts employ SLD resolution
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 21 / 30
Conclusions and future works
Next in Line. . .
1 Motivations & Context
2 Blockchain and smart contracts
3 Logic-based smart contracts
4 The blockchain for distributed Logic Programming
5 Conclusions and future works
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 22 / 30
Conclusions and future works
Conclusions
The blockchain as a means for replicating programs over the network
ie Smart contracts
Mixing LP and the blockchain is possible in two ways
1 Logic programming and its semantics adopted by smart contracts
Logic-based smart contracts
Also focusing on their interaction semantics
2 The blockchain as a fault-tolerant middleware for logic programs
The blockchain as a blackboard for distributed cooperative reasoning
Smart contracts as multiple para-consistent logic theories
Several questions, mostly arising from the economic dimension of
computation
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 23 / 30
Conclusions and future works
Future Works
Developing our own logic-friendly blockchain implementation
? maybe based on Tendermint1
Refining our logic smart contract abstraction towards MAS
Re-designing the Ethereum operational semantics [Woo14] in terms of
asynchronous interactions
Injecting tuProlog2 into some Java-friendly BCT
eg Hyperledger Fabric [ABB+18] or Corda3
1
https://tendermint.com
2
http://apice.unibo.it/xwiki/bin/view/Tuprolog/WebHome
3
https://www.corda.net/
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 24 / 30
From the Blockchain to Logic Programming and back
Research perspectives
Giovanni Ciatto1 Roberta Calegari1 Stefano Mariani2
Enrico Denti1 Andrea Omicini1
1
{roberta.calegari, giovanni.ciatto, enrico.denti,
andrea.omicini}@unibo.it
2
stefano.mariani@unimore.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
Talk @ 19th Workshop From Objects to Agents
Palermo, June 29, 2018
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 25 / 30
Appendix
Appendix – The problem with re-entrancy I
contract MyWallet {
function protectSavings ( MoneyHandler handler , uint money) public {
handler.deposit.value(money)(1 /* year */);
}
}
contract MoneyHandler {
struct ClientInfo { uint duration; uint since; uint amount }
mapping(address => ClientInfo) clients;
function deposit(uint duration) public {
ClientInfo storage c = clients[msg.sender ];
c.duration = duration;
c.since = now;
c.amount = msg.value;
}
function withdraw () public {
ClientInfo storage c = clients[msg.sender ];
uint amount = c.amount;
amount += (now - c.since) % (c.duration * 1 years) * c.amount /100;
msg.sender.send(amount);
}
}
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 26 / 30
Appendix
Appendix – The problem with re-entrancy II
contract MyWallet {
function protectSavings ( MoneyHandler handler , uint money) public {
handler.deposit.value(money)(1 /* year */);
}
}
contract Mallory {
uint nOfTheft = 3;
/* No deposit function */
function () { // <-- fallback function
if (nOfTheft > 0) {
MyWallet fool = (MyWallet) msg.sender;
fool. protectSavings (this , 1); // <-- re -entrancy!
}
}
}
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 27 / 30
References
References I
[ABB+18] Elli Androulaki, Artem Barger, Vita Bortnikov, Christian Cachin, Konstantinos
Christidis, Angelo De Caro, David Enyeart, Christopher Ferris, Gennady Laventman,
Yacov Manevich, Srinivasan Muralidharan, Chet Murthy, Binh Nguyen, Manish
Sethi, Gari Singh, Keith Smith, Alessandro Sorniotti, Chrysoula Stathakopoulou,
Marko Vukoli´c, Sharon Weed Cocco, and Jason Yellick.
Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains.
Proceedings of the Thirteenth EuroSys Conference on - EuroSys ’18, pages 1–15,
jan 2018.
[Bac02] Adam Back.
Hashcash - A Denial of Service Counter-Measure.
Http://Www.Hashcash.Org/Papers/Hashcash.Pdf, (August):1–10, 2002.
[CBPS10] Bernadette Charron-Bost, Fernando Pedone, and Andr´e Schiper, editors.
Replication: Theory and Practice.
Springer-Verlag, Berlin, Heidelberg, 2010.
[CDMO18] Roberta Calegari, Enrico Denti, Stefano Mariani, and Andrea Omicini.
Logic programming as a service.
arXiv preprint arXiv:1806.02577, 2018.
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 28 / 30
References
References II
[LCO+16] Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor.
Making Smart Contracts Smarter.
In Proceedings of the 2016 ACM SIGSAC Conference on Computer and
Communications Security - CCS’16, pages 254–269, New York, New York, USA,
2016. ACM Press.
[LL17] Iuon-chang Lin and Tzu-chun Liao.
A Survey of Blockchain Security Issues and Challenges.
International Journal of Network Security, 1919(55):653–659, 2017.
[Nak08] Satoshi Nakamoto.
Bitcoin: A Peer-to-Peer Electronic Cash System.
Www.Bitcoin.Org, page 9, 2008.
[Rao96] Anand S. Rao.
Agentspeak(l): Bdi agents speak out in a logical computable language.
In Walter Van de Velde and John W. Perram, editors, Agents Breaking Away, pages
42–55, Berlin, Heidelberg, 1996. Springer Berlin Heidelberg.
[Sch90] Fred B. Schneider.
Implementing Fault-tolerant Services Using the State Machine Approach: A
Tutorial.
ACM Comput. Surv., 22(4):299–319, 1990.
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 29 / 30
References
References III
[Sza96] Nick Szabo.
Smart Contracts: Building Blocks for Digital Markets.
Alamut.Com, (c):16, 1996.
[Woo14] Gavin Wood.
Ethereum: a secure decentralised generalised transaction ledger.
Ethereum Project Yellow Paper, pages 1–32, 2014.
Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 30 / 30

Weitere ähnliche Inhalte

Ähnlich wie From the Blockchain to Logic Programming and back: Research perspectives

Blockchain for Intelligent Systems: Research Perspectives
Blockchain for Intelligent Systems: Research PerspectivesBlockchain for Intelligent Systems: Research Perspectives
Blockchain for Intelligent Systems: Research PerspectivesAndrea Omicini
 
blockchain and insurance.pdf
blockchain and insurance.pdfblockchain and insurance.pdf
blockchain and insurance.pdfakshay pateriya
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveTommaso Pellizzari
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveVittorio Zinetti
 
IRJET- Consensus Mechanism on Secure Challenges in Blockchain Networks
IRJET-  	  Consensus Mechanism on Secure Challenges in Blockchain NetworksIRJET-  	  Consensus Mechanism on Secure Challenges in Blockchain Networks
IRJET- Consensus Mechanism on Secure Challenges in Blockchain NetworksIRJET Journal
 
Comparative Analysis of Blockchain Technologies under a Coordination Perspective
Comparative Analysis of Blockchain Technologies under a Coordination PerspectiveComparative Analysis of Blockchain Technologies under a Coordination Perspective
Comparative Analysis of Blockchain Technologies under a Coordination PerspectiveGiovanni Ciatto
 
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGYOVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGYIRJET Journal
 
Blockchain and Tokenomics_Crimson Publishers
Blockchain and Tokenomics_Crimson PublishersBlockchain and Tokenomics_Crimson Publishers
Blockchain and Tokenomics_Crimson Publisherscrimsonpublisherscojrr
 
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY csandit
 
IRJET- Smart Contracts using Blockchain
IRJET- Smart Contracts using BlockchainIRJET- Smart Contracts using Blockchain
IRJET- Smart Contracts using BlockchainIRJET Journal
 
Rui zhang and rui xue, georgia tech
Rui zhang and rui xue, georgia techRui zhang and rui xue, georgia tech
Rui zhang and rui xue, georgia techIT Strategy Group
 
Blockchain beyond fintech by ridgelift.io
Blockchain beyond fintech by ridgelift.ioBlockchain beyond fintech by ridgelift.io
Blockchain beyond fintech by ridgelift.ioUdayan Modhe
 
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docx
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docxInternet of Things 10 (2020) 10 0 081 Contents lists avail.docx
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docxLaticiaGrissomzz
 
Blockchain and Smart Contracts
Blockchain and Smart ContractsBlockchain and Smart Contracts
Blockchain and Smart ContractsGiovanni Ciatto
 
A gentle introduction to the Blockchain and Smart Contracts
A gentle introduction to the Blockchain and Smart ContractsA gentle introduction to the Blockchain and Smart Contracts
A gentle introduction to the Blockchain and Smart ContractsGiovanni Ciatto
 
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSA SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSAIRCC Publishing Corporation
 
A Systematic Mapping Study on Current Research Topics in Smart Contracts
A Systematic Mapping Study on Current Research Topics in Smart ContractsA Systematic Mapping Study on Current Research Topics in Smart Contracts
A Systematic Mapping Study on Current Research Topics in Smart ContractsAIRCC Publishing Corporation
 
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSA SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSijcsit
 

Ähnlich wie From the Blockchain to Logic Programming and back: Research perspectives (20)

Blockchain for Intelligent Systems: Research Perspectives
Blockchain for Intelligent Systems: Research PerspectivesBlockchain for Intelligent Systems: Research Perspectives
Blockchain for Intelligent Systems: Research Perspectives
 
blockchain and insurance.pdf
blockchain and insurance.pdfblockchain and insurance.pdf
blockchain and insurance.pdf
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspective
 
Blockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspectiveBlockchain technology and applications from a financial perspective
Blockchain technology and applications from a financial perspective
 
IRJET- Consensus Mechanism on Secure Challenges in Blockchain Networks
IRJET-  	  Consensus Mechanism on Secure Challenges in Blockchain NetworksIRJET-  	  Consensus Mechanism on Secure Challenges in Blockchain Networks
IRJET- Consensus Mechanism on Secure Challenges in Blockchain Networks
 
Comparative Analysis of Blockchain Technologies under a Coordination Perspective
Comparative Analysis of Blockchain Technologies under a Coordination PerspectiveComparative Analysis of Blockchain Technologies under a Coordination Perspective
Comparative Analysis of Blockchain Technologies under a Coordination Perspective
 
Blockchain
BlockchainBlockchain
Blockchain
 
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGYOVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
OVERVIEW OF SMART CONTRACT IN BLOCKCHAIN TECHNOLOGY
 
Blockchain and Tokenomics_Crimson Publishers
Blockchain and Tokenomics_Crimson PublishersBlockchain and Tokenomics_Crimson Publishers
Blockchain and Tokenomics_Crimson Publishers
 
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY
BLOCKCHAIN-BASED SMART CONTRACTS : A SYSTEMATIC MAPPING STUDY
 
IRJET- Smart Contracts using Blockchain
IRJET- Smart Contracts using BlockchainIRJET- Smart Contracts using Blockchain
IRJET- Smart Contracts using Blockchain
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
Rui zhang and rui xue, georgia tech
Rui zhang and rui xue, georgia techRui zhang and rui xue, georgia tech
Rui zhang and rui xue, georgia tech
 
Blockchain beyond fintech by ridgelift.io
Blockchain beyond fintech by ridgelift.ioBlockchain beyond fintech by ridgelift.io
Blockchain beyond fintech by ridgelift.io
 
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docx
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docxInternet of Things 10 (2020) 10 0 081 Contents lists avail.docx
Internet of Things 10 (2020) 10 0 081 Contents lists avail.docx
 
Blockchain and Smart Contracts
Blockchain and Smart ContractsBlockchain and Smart Contracts
Blockchain and Smart Contracts
 
A gentle introduction to the Blockchain and Smart Contracts
A gentle introduction to the Blockchain and Smart ContractsA gentle introduction to the Blockchain and Smart Contracts
A gentle introduction to the Blockchain and Smart Contracts
 
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSA SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
 
A Systematic Mapping Study on Current Research Topics in Smart Contracts
A Systematic Mapping Study on Current Research Topics in Smart ContractsA Systematic Mapping Study on Current Research Topics in Smart Contracts
A Systematic Mapping Study on Current Research Topics in Smart Contracts
 
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTSA SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
A SYSTEMATIC MAPPING STUDY ON CURRENT RESEARCH TOPICS IN SMART CONTRACTS
 

Mehr von Giovanni Ciatto

An Abstract Framework for Agent-Based Explanations in AI
An Abstract Framework for Agent-Based Explanations in AIAn Abstract Framework for Agent-Based Explanations in AI
An Abstract Framework for Agent-Based Explanations in AIGiovanni Ciatto
 
2P-Kt: logic programming with objects & functions in Kotlin
2P-Kt: logic programming with objects & functions in Kotlin2P-Kt: logic programming with objects & functions in Kotlin
2P-Kt: logic programming with objects & functions in KotlinGiovanni Ciatto
 
Towards XMAS: eXplainability through Multi-Agent Systems
Towards XMAS: eXplainability through Multi-Agent SystemsTowards XMAS: eXplainability through Multi-Agent Systems
Towards XMAS: eXplainability through Multi-Agent SystemsGiovanni Ciatto
 
TuSoW: Tuple Spaces for Edge Computing
TuSoW: Tuple Spaces for Edge ComputingTuSoW: Tuple Spaces for Edge Computing
TuSoW: Tuple Spaces for Edge ComputingGiovanni Ciatto
 
Logic Programming in Space-Time: The Case of Situatedness in LPaaS
Logic Programming in Space-Time: The Case of Situatedness in LPaaSLogic Programming in Space-Time: The Case of Situatedness in LPaaS
Logic Programming in Space-Time: The Case of Situatedness in LPaaSGiovanni Ciatto
 
Introduzione alla Blockchain
Introduzione alla BlockchainIntroduzione alla Blockchain
Introduzione alla BlockchainGiovanni Ciatto
 

Mehr von Giovanni Ciatto (6)

An Abstract Framework for Agent-Based Explanations in AI
An Abstract Framework for Agent-Based Explanations in AIAn Abstract Framework for Agent-Based Explanations in AI
An Abstract Framework for Agent-Based Explanations in AI
 
2P-Kt: logic programming with objects & functions in Kotlin
2P-Kt: logic programming with objects & functions in Kotlin2P-Kt: logic programming with objects & functions in Kotlin
2P-Kt: logic programming with objects & functions in Kotlin
 
Towards XMAS: eXplainability through Multi-Agent Systems
Towards XMAS: eXplainability through Multi-Agent SystemsTowards XMAS: eXplainability through Multi-Agent Systems
Towards XMAS: eXplainability through Multi-Agent Systems
 
TuSoW: Tuple Spaces for Edge Computing
TuSoW: Tuple Spaces for Edge ComputingTuSoW: Tuple Spaces for Edge Computing
TuSoW: Tuple Spaces for Edge Computing
 
Logic Programming in Space-Time: The Case of Situatedness in LPaaS
Logic Programming in Space-Time: The Case of Situatedness in LPaaSLogic Programming in Space-Time: The Case of Situatedness in LPaaS
Logic Programming in Space-Time: The Case of Situatedness in LPaaS
 
Introduzione alla Blockchain
Introduzione alla BlockchainIntroduzione alla Blockchain
Introduzione alla Blockchain
 

Kürzlich hochgeladen

Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spaintimesproduction05
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...Call Girls in Nagpur High Profile
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingrknatarajan
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performancesivaprakash250
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Call Girls in Nagpur High Profile
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college projectTonystark477637
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSrknatarajan
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduitsrknatarajan
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Christo Ananth
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfKamal Acharya
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...ranjana rawat
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VDineshKumar4165
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Dr.Costas Sachpazis
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756dollysharma2066
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...SUHANI PANDEY
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLManishPatel169454
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdfKamal Acharya
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTbhaskargani46
 

Kürzlich hochgeladen (20)

Roadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and RoutesRoadmap to Membership of RICS - Pathways and Routes
Roadmap to Membership of RICS - Pathways and Routes
 
Vivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design SpainVivazz, Mieres Social Housing Design Spain
Vivazz, Mieres Social Housing Design Spain
 
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...Booking open Available Pune Call Girls Pargaon  6297143586 Call Hot Indian Gi...
Booking open Available Pune Call Girls Pargaon 6297143586 Call Hot Indian Gi...
 
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and workingUNIT-V FMM.HYDRAULIC TURBINE - Construction and working
UNIT-V FMM.HYDRAULIC TURBINE - Construction and working
 
UNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its PerformanceUNIT - IV - Air Compressors and its Performance
UNIT - IV - Air Compressors and its Performance
 
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...Top Rated  Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
Top Rated Pune Call Girls Budhwar Peth ⟟ 6297143586 ⟟ Call Me For Genuine Se...
 
result management system report for college project
result management system report for college projectresult management system report for college project
result management system report for college project
 
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICSUNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
UNIT-IFLUID PROPERTIES & FLOW CHARACTERISTICS
 
UNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular ConduitsUNIT-II FMM-Flow Through Circular Conduits
UNIT-II FMM-Flow Through Circular Conduits
 
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
Call for Papers - African Journal of Biological Sciences, E-ISSN: 2663-2187, ...
 
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdfONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
ONLINE FOOD ORDER SYSTEM PROJECT REPORT.pdf
 
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
The Most Attractive Pune Call Girls Manchar 8250192130 Will You Miss This Cha...
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
Structural Analysis and Design of Foundations: A Comprehensive Handbook for S...
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELLPVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
PVC VS. FIBERGLASS (FRP) GRAVITY SEWER - UNI BELL
 
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
(INDIRA) Call Girl Aurangabad Call Now 8617697112 Aurangabad Escorts 24x7
 
University management System project report..pdf
University management System project report..pdfUniversity management System project report..pdf
University management System project report..pdf
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 

From the Blockchain to Logic Programming and back: Research perspectives

  • 1. From the Blockchain to Logic Programming and back Research perspectives Giovanni Ciatto1 Roberta Calegari1 Stefano Mariani2 Enrico Denti1 Andrea Omicini1 1 {roberta.calegari, giovanni.ciatto, enrico.denti, andrea.omicini}@unibo.it 2 stefano.mariani@unimore.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 Talk @ 19th Workshop From Objects to Agents Palermo, June 29, 2018 Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 1 / 30
  • 2. Outline 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 2 / 30
  • 3. Motivations & Context Next in Line. . . 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 3 / 30
  • 4. Motivations & Context Context Blockchain Technology (BCT) Novel way to achieve replication of business-logic & data on the net consistency, untamperability, fault-tolerance, trust over decentralisation eg cryptocurrencies (e.g. Bitcoin) or identity/access/asset management Smart-contracts-enabled BCT (ScBCT) An interpreter as the replicated application, executing smart contracts ie trusted computational entities automatically handling our assets Ethereum as the most prominent example Logic programming (LP) Programming as goal-oriented reasoning, on top of declarative language supports meta-programming and provides understandable outputs (proofs) employed in cognitive agents, e.g. AgentSpeak [Rao96] Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 4 / 30
  • 5. Motivations & Context Motivations Can LP be useful within the scope of ScBCTs? LP may positively affect smart contracts’ declarativeness, observability and mutability . . . interaction semantics, through message-passing . . . . . . paving the way towards agent-oriented smart contracts Can BCTs be useful within the scope of LP? BCTs as a shared blackboard for distributed cooperative reasoning Smart contracts as logic services, `a la LPaaS [CDMO18] Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 5 / 30
  • 6. Blockchain and smart contracts Next in Line. . . 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 6 / 30
  • 7. Blockchain and smart contracts Overview Blockchain & Smart contracts Overview ScBCT consist of a P2P network jointly pursuing State Machine Replication (SMR) [CBPS10, Sch90] maintaining a consistent view/update over/of a shared state . . . . . . among mutually-untrusted nodes, a.k.a. miners replicating an interpreter, i.e. a virtual machine, for smart contracts by means of the PoW Proof-of-Work [Bac02, Nak08] consensus mechanism providing eventual consistency of the whole system state endowing cryptocurrencies with their economic value logging all transactions affecting the shared state on the block-chain issued by end users Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 7 / 30
  • 8. Blockchain and smart contracts State, transactions & blocks Blockchain main concepts I TXs hash( ) Index i-1 Timestamp TXs hash( ) Index i Timestamp TXs hash( ) Index i+1 Timestamp Statei-1 Statei Statei+1 States, transactions and blocks: the global p.o.v. Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 8 / 30
  • 9. Blockchain and smart contracts State, transactions & blocks Blockchain main concepts II Transactions Blocks Blockchain Miners Clients Miners, clients and replication: the network p.o.v. Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 9 / 30
  • 10. Blockchain and smart contracts Smart contracts Smart contracts [Sza96] Definition Stateful, reactive, user-defined, immutable, and deterministic processes executing some arbitrary computation on the blockchain, i.e., while being consistently replicated over the blockchain network Stateful — they encapsulate their own state, like OOP’s objects Reactive — they can only be triggered by issuing some invocation TX User-defined — users can deploy their smart contracts implementing an arbitrary logic by issuing a deployment TX Immutable — their source/byte-code cannot be altered after deployment Arbitrary — they are expressed with a Turing-complete language Replicated — the blockchain is essentially a replicated interpreter, employing a consensus protocol to keep the many replicas consistent ! Disclaimer: focus on the Ethereum platform Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 10 / 30
  • 11. Blockchain and smart contracts Smart contracts Smart contracts – Features and problems State encapsulation + sync. interaction + transactional semantics Object-oriented & imperative metaphor, e.g. Solidity Side effects are reverted on exceptions × problems arising from re-entrancy [LCO+16, LL17] × imperative syntax is understandable to experts only Immutability + observability of code =⇒ Trust in financial TXs × may require disassembler or source code Economic dimension of computations: miners need compensation quasi-Turing completeness [Woo14] × per-instruction economic-cost may hinder SW engineering × Immutability =⇒ No bug fixes × Pure reactiveness =⇒ No scheduled/periodic computations × poor practical expressiveness Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 11 / 30
  • 12. Blockchain and smart contracts Smart contracts Smart contracts on the blockchain I TXs hash( ) Index i-1 Timestamp TXs hash( ) Index i Timestamp TXs hash( ) Index i+1 Timestamp Statei-1 Statei Statei+1 Smart contracts being deployed and evolving among states Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 12 / 30
  • 13. Blockchain and smart contracts Smart contracts Smart contracts on the blockchain II Transactions Blocks Blockchain Miners Clients Smart contracts Smart contracts being replicated among peers Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 13 / 30
  • 14. Logic-based smart contracts Next in Line. . . 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 14 / 30
  • 15. Logic-based smart contracts Logic-based smart contracts Smart contracts are re-interpreted as logic processes characterised by: Logic theories as specification scripts =⇒ Declarativeness & understandability Strong division between static & dynamic KBs Static KB defined upon deploy and immutable Dynamic KB keeping track of the mutable state =⇒ Controlled mutability by adding/removing rules Special functors define smart contracts interaction semantics API eg receive(Message) :- WhatToDo. eg send(Message, Receiver). send(M, R) triggers goal receive(Message) on R TX is aborted if the goal cannot be proven ! Miners role, consensus mechanism, and transactional semantics remain unchanged Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 15 / 30
  • 16. Logic-based smart contracts Features and open questions Interpreted Language & mutability =⇒ observability State and behaviour inspectable without disassembler Controlled mutability: a smart contract modifying it-self (Inspectable) behaviour may be added/fixed after deploy ? Which semantics for inter-smart-contracts communication? ! Sync VS async semantics of the send/2 primitive Async semantics =⇒ encapsulation of control flow ? Delayed messages for post-poned computations Self-sent messages for periodic computations Only makes sense for the async semantics ? Economic-related aspects of (logic-based) computation Who’s paying for message-triggered computations? Which value for unification? back-tracking? asserts? retracts? . . . Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 16 / 30
  • 17. Logic-based smart contracts Sync VS Async I Invocation TX Method Call Return from Call End of TX hash( ) Index i Timestamp TX Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 17 / 30
  • 18. Logic-based smart contracts Sync VS Async II Invocation TX Message TX Message TX Message TX hash( ) Index i Timestamp hash( ) Index i+2 Timestamp hash( ) Index i+3 Timestamp hash( ) Index i+1 Timestamp TX TX TX TX Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 18 / 30
  • 19. The blockchain for distributed Logic Programming Next in Line. . . 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 19 / 30
  • 20. The blockchain for distributed Logic Programming The blockchain as a Logic Theory The blockchain as a Logic Theory BCTs essentially provide consistent read/write access to distributed data What if data were logic terms? The whole blockchain represents (the evolution of) a logic theory Clients may issue goals to the blockchain network or asserting/retracting shared knowledge Miners may cooperatively participate to the SLD resolution process Navigating the proof-three in parallel ie publishing partial results on the blockchain ? Economical incentives for a fair balancing of computational efforts Preventing already proven goals to be proven again ? How to freeze the knowledge while reasoning? Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 20 / 30
  • 21. The blockchain for distributed Logic Programming Smart contacts enabled BCTs as multiple theories Smart contacts enabled BCTs as multiple theories Smart contracts essentially control consistent read/write access their internal state What if each smart contract was responsible for a monotonic theory? Non-monotone edits spawns a new smart contract in charge of handling the new theory version the old smart contract and its theory continue to exist Multiple, possibly para-consistent logic theories all originating from a common ancestor each theory expresses what is true in a particular space-time point each one is handled by a particular smart contract Clients may query each smart contract’s theory about a particular view of the world smart contracts employ SLD resolution Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 21 / 30
  • 22. Conclusions and future works Next in Line. . . 1 Motivations & Context 2 Blockchain and smart contracts 3 Logic-based smart contracts 4 The blockchain for distributed Logic Programming 5 Conclusions and future works Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 22 / 30
  • 23. Conclusions and future works Conclusions The blockchain as a means for replicating programs over the network ie Smart contracts Mixing LP and the blockchain is possible in two ways 1 Logic programming and its semantics adopted by smart contracts Logic-based smart contracts Also focusing on their interaction semantics 2 The blockchain as a fault-tolerant middleware for logic programs The blockchain as a blackboard for distributed cooperative reasoning Smart contracts as multiple para-consistent logic theories Several questions, mostly arising from the economic dimension of computation Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 23 / 30
  • 24. Conclusions and future works Future Works Developing our own logic-friendly blockchain implementation ? maybe based on Tendermint1 Refining our logic smart contract abstraction towards MAS Re-designing the Ethereum operational semantics [Woo14] in terms of asynchronous interactions Injecting tuProlog2 into some Java-friendly BCT eg Hyperledger Fabric [ABB+18] or Corda3 1 https://tendermint.com 2 http://apice.unibo.it/xwiki/bin/view/Tuprolog/WebHome 3 https://www.corda.net/ Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 24 / 30
  • 25. From the Blockchain to Logic Programming and back Research perspectives Giovanni Ciatto1 Roberta Calegari1 Stefano Mariani2 Enrico Denti1 Andrea Omicini1 1 {roberta.calegari, giovanni.ciatto, enrico.denti, andrea.omicini}@unibo.it 2 stefano.mariani@unimore.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 Talk @ 19th Workshop From Objects to Agents Palermo, June 29, 2018 Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 25 / 30
  • 26. Appendix Appendix – The problem with re-entrancy I contract MyWallet { function protectSavings ( MoneyHandler handler , uint money) public { handler.deposit.value(money)(1 /* year */); } } contract MoneyHandler { struct ClientInfo { uint duration; uint since; uint amount } mapping(address => ClientInfo) clients; function deposit(uint duration) public { ClientInfo storage c = clients[msg.sender ]; c.duration = duration; c.since = now; c.amount = msg.value; } function withdraw () public { ClientInfo storage c = clients[msg.sender ]; uint amount = c.amount; amount += (now - c.since) % (c.duration * 1 years) * c.amount /100; msg.sender.send(amount); } } Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 26 / 30
  • 27. Appendix Appendix – The problem with re-entrancy II contract MyWallet { function protectSavings ( MoneyHandler handler , uint money) public { handler.deposit.value(money)(1 /* year */); } } contract Mallory { uint nOfTheft = 3; /* No deposit function */ function () { // <-- fallback function if (nOfTheft > 0) { MyWallet fool = (MyWallet) msg.sender; fool. protectSavings (this , 1); // <-- re -entrancy! } } } Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 27 / 30
  • 28. References References I [ABB+18] Elli Androulaki, Artem Barger, Vita Bortnikov, Christian Cachin, Konstantinos Christidis, Angelo De Caro, David Enyeart, Christopher Ferris, Gennady Laventman, Yacov Manevich, Srinivasan Muralidharan, Chet Murthy, Binh Nguyen, Manish Sethi, Gari Singh, Keith Smith, Alessandro Sorniotti, Chrysoula Stathakopoulou, Marko Vukoli´c, Sharon Weed Cocco, and Jason Yellick. Hyperledger Fabric: A Distributed Operating System for Permissioned Blockchains. Proceedings of the Thirteenth EuroSys Conference on - EuroSys ’18, pages 1–15, jan 2018. [Bac02] Adam Back. Hashcash - A Denial of Service Counter-Measure. Http://Www.Hashcash.Org/Papers/Hashcash.Pdf, (August):1–10, 2002. [CBPS10] Bernadette Charron-Bost, Fernando Pedone, and Andr´e Schiper, editors. Replication: Theory and Practice. Springer-Verlag, Berlin, Heidelberg, 2010. [CDMO18] Roberta Calegari, Enrico Denti, Stefano Mariani, and Andrea Omicini. Logic programming as a service. arXiv preprint arXiv:1806.02577, 2018. Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 28 / 30
  • 29. References References II [LCO+16] Loi Luu, Duc-Hiep Chu, Hrishi Olickel, Prateek Saxena, and Aquinas Hobor. Making Smart Contracts Smarter. In Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security - CCS’16, pages 254–269, New York, New York, USA, 2016. ACM Press. [LL17] Iuon-chang Lin and Tzu-chun Liao. A Survey of Blockchain Security Issues and Challenges. International Journal of Network Security, 1919(55):653–659, 2017. [Nak08] Satoshi Nakamoto. Bitcoin: A Peer-to-Peer Electronic Cash System. Www.Bitcoin.Org, page 9, 2008. [Rao96] Anand S. Rao. Agentspeak(l): Bdi agents speak out in a logical computable language. In Walter Van de Velde and John W. Perram, editors, Agents Breaking Away, pages 42–55, Berlin, Heidelberg, 1996. Springer Berlin Heidelberg. [Sch90] Fred B. Schneider. Implementing Fault-tolerant Services Using the State Machine Approach: A Tutorial. ACM Comput. Surv., 22(4):299–319, 1990. Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 29 / 30
  • 30. References References III [Sza96] Nick Szabo. Smart Contracts: Building Blocks for Digital Markets. Alamut.Com, (c):16, 1996. [Woo14] Gavin Wood. Ethereum: a secure decentralised generalised transaction ledger. Ethereum Project Yellow Paper, pages 1–32, 2014. Ciatto (Univ. of Bologna) BC & LP: Research Perspectives WOA 2018, June 29 30 / 30