SlideShare una empresa de Scribd logo
1 de 30
Descargar para leer sin conexión
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

Más contenido relacionado

Similar a 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
 

Similar a 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
 

Más de 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
 

Más de 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
 

Último

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxk795866
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleAlluxio, Inc.
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)Dr SOUNDIRARAJ N
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...Chandu841456
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...VICTOR MAESTRE RAMIREZ
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile servicerehmti665
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniquesugginaramesh
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfAsst.prof M.Gokilavani
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptSAURABHKUMAR892774
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 

Último (20)

Introduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptxIntroduction-To-Agricultural-Surveillance-Rover.pptx
Introduction-To-Agricultural-Surveillance-Rover.pptx
 
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
9953056974 Call Girls In South Ex, Escorts (Delhi) NCR.pdf
 
Correctly Loading Incremental Data at Scale
Correctly Loading Incremental Data at ScaleCorrectly Loading Incremental Data at Scale
Correctly Loading Incremental Data at Scale
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
UNIT III ANALOG ELECTRONICS (BASIC ELECTRONICS)
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...An experimental study in using natural admixture as an alternative for chemic...
An experimental study in using natural admixture as an alternative for chemic...
 
Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...Software and Systems Engineering Standards: Verification and Validation of Sy...
Software and Systems Engineering Standards: Verification and Validation of Sy...
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
Call Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile serviceCall Girls Delhi {Jodhpur} 9711199012 high profile service
Call Girls Delhi {Jodhpur} 9711199012 high profile service
 
Comparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization TechniquesComparative Analysis of Text Summarization Techniques
Comparative Analysis of Text Summarization Techniques
 
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdfCCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
CCS355 Neural Networks & Deep Learning Unit 1 PDF notes with Question bank .pdf
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 
Arduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.pptArduino_CSE ece ppt for working and principal of arduino.ppt
Arduino_CSE ece ppt for working and principal of arduino.ppt
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 

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