<!DOCTYPE article PUBLIC "-//NLM//DTD JATS (Z39.96) Journal Archiving and Interchange DTD v1.0 20120330//EN" "JATS-archivearticle1.dtd">
<article xmlns:xlink="http://www.w3.org/1999/xlink">
  <front>
    <journal-meta>
      <issn pub-type="ppub">1613-0073</issn>
    </journal-meta>
    <article-meta>
      <title-group>
        <article-title>Towards FATEful Smart Contracts⋆</article-title>
      </title-group>
      <contrib-group>
        <contrib contrib-type="author">
          <string-name>Luigi Bellomarini</string-name>
          <email>luigi.bellomarini@bancaditalia.i</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Marco Favorito</string-name>
          <email>marco.favorito@bancaditalia.i</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Eleonora Laurenza</string-name>
          <email>eleonora.laurenza@bancaditalia</email>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Markus Nissl</string-name>
          <email>nissl@dbai.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Emanuel Sallinger</string-name>
          <email>sallinger@dbai.tuwien.ac.at</email>
          <xref ref-type="aff" rid="aff0">0</xref>
          <xref ref-type="aff" rid="aff1">1</xref>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Bank of Italy</string-name>
        </contrib>
        <contrib contrib-type="author">
          <string-name>Italy</string-name>
        </contrib>
        <aff id="aff0">
          <label>0</label>
          <institution>TU Wien</institution>
          ,
          <country country="AT">Austria</country>
        </aff>
        <aff id="aff1">
          <label>1</label>
          <institution>University of Oxford</institution>
          ,
          <country country="UK">UK</country>
        </aff>
      </contrib-group>
      <pub-date>
        <year>2024</year>
      </pub-date>
      <abstract>
        <p>Achieving fair, accountable, transparent, and ethical decentralized finance requires activating enabling properties at the level of smart contracts, the executable scripts at its basis. In this vision paper, a joint efort of the Central Bank of Italy, TU Wien, and the University of Oxford, we leverage the vast amount of experience in this sense from the database community and propose a logic-based reasoning framework that captures smart contracts as a set of rules in DatalogMTL, a temporal language for querying databases. We present the high-level architecture of our framework and explain how the theoretical underpinnings of the reasoning of DatalogMTL convey important properties to the approach.</p>
      </abstract>
      <kwd-group>
        <kwd>Smart contracts</kwd>
        <kwd>DatalogMTL</kwd>
        <kwd>FATE principles</kwd>
      </kwd-group>
    </article-meta>
  </front>
  <body>
    <sec id="sec-1">
      <title>1. Introduction</title>
      <p>
        The Artificial Intelligence and database communities are experiencing a growing infusion of thFeATE
(Fairness, Accountability, Transparency, Ethics) principles [
        <xref ref-type="bibr" rid="ref2">2</xref>
        ]. These principles are gaining prominence,
drawing attention to the non-functional requirements of everyday AI-assisted and data-driven
decisionmaking and catalyzing the discussion around regulatory bodies. Unfortunately, the same level of
attention to these high-level concerns is not mirrored in developer circles, and recent studies underscore
the scant regard machine learning developers have shown for FATE concerns in machine learning
applications [
        <xref ref-type="bibr" rid="ref3 ref4">3, 4</xref>
        ].
      </p>
      <p>
        FATE and DeFi. We see similar patterns emerging when assessing developers’ awareness of FATE
concerns within the industrial realm oDfecentralized Finance (DeFi). DeFi entails financial transactions
devoid of intermediaries, instead relying on software modules executed on a decentralized public
ledger [
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. At the core of DeFI is the notion ofsmart contracts [
        <xref ref-type="bibr" rid="ref6">6</xref>
        ], which are machine-readable and
executable agreements that establish and enforce the binding terms for the parties involved.
Supporting FATE. In the AI and data world, social forces have been efective in supporting FATE,
for example, by means of third-party audits of the algorithms, either conducted by experts or by
everyday users. As recently highlighted by Hong in CACM2[], prominent examples can be found in
the fights against the racial bias of face-recognition systems7[], and commercial gender disparities in
photo cropping or credit card algorithms8[]. These audits, spurred by social forces and the scientific
community, have provided regulators with positive guidance.
      </p>
      <p>In contrast to AI, DeFi boasts a substantial theoretical transparency advantage, thanks to its
openaccess code and the ability for anyone to inspect smart contract data on a public ledger. However,
enforcing policies in a decentralized context remains an incredibly challenging task. The praiseworthy
goal of establishing standards, taxonomies, compliance measures, quality controls, and upholding</p>
      <p>CEUR</p>
      <p>
        ceur-ws.org
ethical principles 9[] can benefit from robust support from the social forces in the monitoring and
enforcement of such policies. However, this must align with the specific technical attributes of these
smart contracts. Yet, smart contracts have been criticised within the community due to their overly
complex business logic, and limited explainability, resulting in a lack of transparency. Furthermore, they
often prove challenging to describe and communicate, rendering them less user-friendly, particularly
for non-technical users 1[
        <xref ref-type="bibr" rid="ref11 ref12">0, 11, 12</xref>
        ].
      </p>
      <p>
        A Knowledge Representation and Reasoning (KRR) approach to smart contracts. In the area
of deductive AI and ontological reasoning on databases, logic-based approaches built on top of KRR
formalisms are gaining increasing attention in industrial settings, with many successful financial
applications [
        <xref ref-type="bibr" rid="ref13 ref14 ref15">13, 14, 15</xref>
        ]. Modern logical languages manage to strike a good balance between expressive
power and computational complexity, resulting in compact and eficiently executable formalizations of
complex domains, for instance, being able to capture SPARQL under OWL 2 entailment regime1s6[]
and so enabling ontological reasoning. Thedeclarative paradigm sustains simplicity, transparency,
compactness, and understandability of code, which becomes algorithm-independent and closer to
the high-level specifications, policies, and standards. Thewell-defined semantics of KRR languages
fosters non-ambiguity, ease of use for non-technical users, and correctness. The intrinssitcep-by-step
nature of logical reasoning is conceptually close to notions ofexplainability and thus supports decision
transparency.
      </p>
      <p>The thesis of this vision paper is that a KRR framework for smart contracts that addresses FATE by design
is both theoretically and practically viable. For the theory, we show that, by building on the underpinnings
of logic-based reasoning, the features important to achieving FATE desiderata can be obtained and rigorously
justified. In terms of application, we show that our framework is adaptable to serve as both an interpreted
and a compiled execution mode for real-world contracts.</p>
      <p>
        Contributions to industrial advances. In recent industrial EDBT work done by the Central Bank
of Italy [
        <xref ref-type="bibr" rid="ref17">17</xref>
        ], they started to investigate the possibility of encoding complex smart contracts in
DatalogMTL [
        <xref ref-type="bibr" rid="ref18 ref19">18, 19</xref>
        ], a temporal extension of the Datalog language20[] of databases. They obtained
promising results, highlighting the potential of a KRR approach in the specific case of a derivative
contract. In this work, a joint efort of the Central Bank of Italy, TU Wien, and the University of
Oxford, we propose (i) afull-fledged and general framework for smart contracts that sustains
FATE concerns (ii) by leveraging the vast amount oefxperience from the database community to
achieve enabling properties; (iii) using our framework to study and implementproof of concepts
for many smart contracts where FATE is a core desideratum of a central bank. More details can be
found in the full version of the paper 1[].
      </p>
    </sec>
    <sec id="sec-2">
      <title>2. Overview of the Framework and Related Work</title>
      <p>We use a form of declarative logical object-oriented approach and encode the behaviour of aclass
of smart contracts as a set Σ of reasoning rules—or programs—working on a databas e of
temporal facts. A temporal fact of is such that it holds in a given time interval, for example,
price(123, 2)@[2023-09-01,2023-09-02] defines the price 2 for the asset123 in a two-day interval.</p>
      <p>To model the rules ofΣ, we introduceDatalogMTL , a variant of DatalogMTL with features of practical
utility. A smart contract is then aninstance of a smart contract class, whose time-dependent status is
represented as a database of temporal facts. Instances arestateful objects and the contract execution
consists in invocations, akin to method calls, that are carried out by the involved parties. Calls result
in updates to the status through the addition of new facts. The semantics of a call is operationally
described as the application of the rules oΣf (denoted asΣ() ) to the temporal facts of , extended
with call-specific facts.</p>
      <p>DatalogMTL rules are sets ofhead←body logic implications where the body is a conjunction of atoms
and the head is an atom. As a general guideline, whenever the body of a rule is satisfied by a conjunction
of facts in at a point in time , the evaluation of the rule triggers the insertion i n of a new fact for
the head atom, holding at. For example, the rule p‘osition(,  ) ← buy(, , ), price(, ),  =  ∗  ’
states that, for every point in time , the position  of a trader that buys an amount of an asset of
price  is obtained as ∗  . So, if  contains the price factprice(123, 2) and buy(0241 , 123, 12) , both
holding at[2023-09-01,2023-09-02], a new position(0x241F, 24) holding in the same time interval will
be added to  .</p>
      <p>
        In DatalogMTL , temporal operators can be used to either modify the temporal binding of body
atoms to facts of , or to alter the temporal validity of the generated facts. For instance, an expression
of the form ♦−[
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]position(,  ) in the body holds at a point in time , if the trader had at least an open
position  in the interval[ − 1, ] , while an expression of the form⊞[
        <xref ref-type="bibr" rid="ref1">0,1</xref>
        ]position(,  ) in the head,
states that the position will be open in the interva[l,  + 1] for every  . In the following, we show a
smart contract class defining a simple financial market:
2∶ ⊞−position(,  , ) ← accepted(,  ), price(),  =  ∗  .
1∶ accepted($sender,  ) ← # open( ) , ¬marketClosed.
      </p>
      <p>3∶ return(x, g), ⊞−position(,  , 0) ← # close(), price(), position($sender,  , ),  =  ∗  − .
At a specific point in time in which the market is not closed, a trader tries to open a position by investing
an amount (Rule 1 ). The constant$ is a call-level variable that at runtime binds to the invoking
updated by multiplying by the current price . The ⊞− operator stands for a new future temporal validity
trader. When the transaction is accepted (Rul2e ), the position of the trader on the amount  is
of the position fact. Finally, when the position is closed (Rul3e ), the final profit  is computed based
on the current price.</p>
      <p>
        Execution modes. From a practical perspective, our framework implementΣs() by enabling three
execution alternatives, each ofering specific properties, as reported in Figure 1: (i) on-reasoner execution:
the rules are applied natively by a reasoning system supporting DatalogMTL oDratalogMTL such as
Temporal Vadalog [
        <xref ref-type="bibr" rid="ref21">21</xref>
        ] or MeTeoR [
        <xref ref-type="bibr" rid="ref22">22</xref>
        ]; (ii) on-chain execution: the DatalogMTL programs are verifiably
translated into the language of a target system, for instancSeo,lidity [
        <xref ref-type="bibr" rid="ref23">23</xref>
        ] or Bitcoin Script [
        <xref ref-type="bibr" rid="ref24">24</xref>
        ] and
executed within the target systems; (iiio)f-chain execution , the rules are applied with an on-reasoner
execution with persistent efects on a blockchain and cryptographically verifiable computation.
      </p>
      <p>
        The expert intention is substantiated as a natural language (NL) contract or directly encoded in a
DatalogMTL program Σ, and the use of large language models (LLM) can bridge the gap between the
natural language specification of the contract and the encoding of its DatalogM TLversion [
        <xref ref-type="bibr" rid="ref25">25</xref>
        ].
      </p>
      <p>
        In the on-reasoner execution mode, to evaluateΣ, reasoners use variants of thechase procedure [26]
specialized for the temporal extensions2[
        <xref ref-type="bibr" rid="ref7">7</xref>
        ]. They ofer a good degree of explainability of the produced
facts as a side efect of the inference process of the chase. Also, they are suited to be used fsoirmulation
and runtime verification purposes as step-by-step debugging can be emulated by incrementally adding
facts to and monitoring the results entailed by the application oΣf. On the other hand, the execution
relies on a trusted centralized system.
      </p>
      <p>Conversely, on-chain execution ofers a trustless paradigm, only requiring that the user acknowledges
the translation of theDatalogMTL code into the target language, which can be verified through
opensourced translators. This trustlessness is underpinned by the validation properties ensured by the
distributed consensus protocol embraced by the blockchain, guaranteeing the integrity of the mined
blocks. What is more, on-chain execution is characterized by ittismeliness, as results are promptly
included in the first mined block.</p>
      <p>
        However, on-chain execution comes with a high cost and is ill-suited for complex applications. In
contrast, of-chain execution is widely regarded as a practical and eficient alternative, and there is a large
body of related work such as state-channels28[], Plasma [29], and Zero-Knowledge Rollups [30]. In
particular, specific protocols have been proposed, that help attest the integrity of of-chain computation
(i.e., verifiable computation ), such as ZK-SNARK [31] and ZK-STARK [32]. Towards this direction, the
construction of specialized virtual machines compiling succinct ZK proofs foDratalogMTL executions
is envisaged here, but beyond the scope of this vision paper and a matter of future work.
Termination and Complexity. Fact entailment in DatalogMTL is a decidable task, in particular
PSPACE in data complexity [
        <xref ref-type="bibr" rid="ref18">18</xref>
        ]; therefore we haveguaranteed termination andguaranteed computational
complexity. Moreover, the rules modelling real-world smart contracts need to allow for the derivation of
facts into present and future time points, while the propagation towards the past is almost never required.
Under this condition, the setΣ belongs to the forward-propagating fragment, namely, DatalogMTLFP
[
        <xref ref-type="bibr" rid="ref18">18</xref>
        ], for which afinite representation of infinite models is always possible [
        <xref ref-type="bibr" rid="ref19">19</xref>
        ]. It is important to point
out that in DatalogMTL the use of arithmetic and recursion can, in general, lead to undecidabili3t3y][
and a comprehensive study of arithmetic in DatalogMTL has not been provided yet. However, our
framework conditions the activations of the rules on the specific smart contract functions being called,
which reduces the cases of potentially harmful recursion.
      </p>
    </sec>
    <sec id="sec-3">
      <title>3. The Framework in Action</title>
      <p>In this section, we show the usefulness of our framework with a smart contract of industrial relevance.
ERC-20. The ERC-20 [34] is a well-known and widely adopted Token Standard that implements an API
for tokens within smart contracts. The followingDatalogMTL smart contract implements a simple
ERC-20 contract with a fixed supply  .</p>
      <p>1∶ ⊞ totalSupply(), ⊞−balanceOf ($sender, ) ← # init().
2∶ ⊞−balanceOf ($sender, 0) ← ¬balanceOf ($sender,  ), # create().
3∶ ⊞−balanceOf ($sender,   − ) ,
⊞−balanceOf (to,   + ) ←
balanceOf ($sender,   ), balanceOf (to,   ),
  ≥ , # transfer(to, ).</p>
      <p>Atoms with predicates#init, create, and #transfer are calledtrigger atoms and represent contract
functions, while atoms withbalanceOf and totalSupply are status atoms and they persist across state
1 initializes the smart contract state by adding the fac⊞tstotalSupply() and ⊞−balanceOf ($sender, ) .
transitions. Other atoms aretransient and they are discarded at the end of each function evaluation. Rule
Note that using the⊞− operator allows to overwrite the balance in case of a transfer. Ru2le allows the
sender to initialize a balance, if not already done earlier. Ru3le implements the “transfer” function
from the sender address$sender to the recipient addressto of amount  . Atoms of the form balanceOf (
address,  ) in the body are used to query the balance of address (a common pattern in logic
procomplete the transfer, and the head of the rule uses th⊞−e to update the balances accordingly. We
gramming), the condition  ≥  imposes that there is enough balance from the sender account to
omitted allowances and thetransferFrom and approve functions.</p>
      <p>
        Compilation to Solidity. In [
        <xref ref-type="bibr" rid="ref1">1</xref>
        ] we outlined an approach to compileDatalogMTL programs into
Solidity code that implements the same contract. Intuitively, rules with trigger atoms in the body
are translated into functions, and status atoms are translated into contract state variables and data
structures. Figure2 shows an example of how we can translate the ERC-2D0atalogMTL program into
Solidity.
      </p>
      <p>
        Formal Verification. Our framework can enable formal verification of smart contracts written in
DatalogMTL . An example of how formal properties can be verified is by additional program rules
that formalizeinvariants in the DatalogMTL language. These are formalized using rules of the form
⊥ ←  1, … ,   , meaning that, if all expression s 1, … ,   are true (that is, the invariant does not hold),
then the function call that triggered that rule must be reverted. These rules are compiled inatsosert
instructions and can be seen as a runtime verification technique that rejects all transactions that violate
the invariants, as in 3[
        <xref ref-type="bibr" rid="ref5">5</xref>
        ]. For example, in the ERC-20 smart contract, we might add some invariant
conditions that must be true at any time during the lifetime of the smart contract, such as:
• The sum of user balances is equal tototalSupply [36] (the operatormsum is an aggregation operator
that computes the sum, see 3[
        <xref ref-type="bibr" rid="ref7">7, 27</xref>
        ])
      </p>
      <p>actualTotalSupply(msum(⟨()⟩) ← balanceOf (_, ).</p>
      <p>
        ⊥ ← actualTotalSupply( 1), totalSupply( 2),  1! =  2.
• The sums of sender and receiver balances before and after the transfer are equa3l8[]:
⊥ ←♦−[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]#transfer (), address(), ♦−[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]balanceOf ($sender,   ), ♦−[
        <xref ref-type="bibr" rid="ref1 ref1">1,1</xref>
        ]balanceOf (,   ),
      </p>
      <p>balanceOf ($sender,  ′), balanceOf ($sender,  ′),   +   =  ′ +  ′.</p>
    </sec>
    <sec id="sec-4">
      <title>4. Conclusion</title>
      <p>
        This preliminary work proposes a framework for expressing and evaluating smart contracts, focusing on
improving the explainability and transparency of traditional smart contract development. We achieve
this by building on decades of research in KRR, particularly in declarative logic-based programming,
leveraging the expressive power of DatalogMTL. Inspired by a recent application of such formalism
for modelling smart contracts 3[
        <xref ref-type="bibr" rid="ref17 ref9">9, 17</xref>
        ], we generalize those approaches and develop a foundational
framework which supports the formalization and evaluation of arbitrary smart contracts. While in this
paper we focused more on the vision and its industrial applications in the financial sector, we can already
foresee many research avenues as future works. First, we aim to develop novel techniques (e.g.,
zeroknowledge techniques for of-chain execution) and implementations for realizing each execution mode.
Next, it would be interesting to investigate the impact of developing smart contracts iDnatalogMTL ,
in terms of ease of use, explainability, and code quality. Finally, we want to devise and apply formal
verification techniques for DatalogMTL smart contracts.
language models via ontological reasoning, in: International Joint Conference on Rules and
Reasoning, Springer, 2023, pp. 86–94.
[26] D. Maier, A. O. Mendelzon, Y. Sagiv, Testing implications of data dependencies, ACM Transactions
on Database Systems 4 (1979) 455–468.
[27] L. Bellomarini, M. Nissl, E. Sallinger, Monotonic aggregation for temporal datalog, in: RuleML+RR
(Supplement), volume 2956 of CEUR Workshop Proceedings, CEUR-WS.org, 2021.
[28] A. Miller, I. Bentov, S. Bakshi, R. Kumaresan, P. McCorry, Sprites and state channels: Payment
networks that go faster than lightning, in: Financial Cryptography, volume 11598 Lofecture Notes
in Computer Science, Springer, 2019, pp. 508–526.
[29] M. Harishankar, D. Akestoridis, S. V. Iyer, A. Laszka, C. Joe-Wong, P. Tague, Plasma go: A scalable
sidechain protocol for flexible payment mechanisms in blockchain-based marketplaces, CoRR
abs/2003.06197 (2020).
[30] Ethereum.org, Zero-knowledge rollups,https://shorturl.at/wIYZ4, 2023. Last accessed on
2022-1128.
[31] T. Chen, H. Lu, T. Kunpittaya, A. Luo, A review of zk-snarks, CoRR abs/2202.06877 (2022).
[32] E. Ben-Sasson, I. Bentov, Y. Horesh, M. Riabzev, Scalable, transparent, and post-quantum secure
computational integrity, IACR Cryptol. ePrint Arch. (2018) 46.
[33] B. C. Grau, I. Horrocks, M. Kaminski, E. V. Kostylev, B. Motik, Limit datalog: A declarative query
language for data analysis, SIGMOD Rec. 48 (2019) 6–17.
[34] Ethereum Improvement Proposals, ERC-20: Token Standard, 2015. URLh:ttps://eips.ethereum.org/
      </p>
      <p>EIPS/eip-20.
[35] A. Li, J. A. Choi, F. Long, Securing smart contract with runtime validation, in: PLDI, ACM, 2020,
pp. 438–453.
[36] Á. Hajdu, D. Jovanović, solc-verify: A modular verifier for solidity smart contracts, in: Verified
Software. Theories, Tools, and Experiments: 11th International Conference, VSTTE 2019, New
York City, NY, USA, July 13–14, 2019, Revised Selected Papers 11, Springer, 2020, pp. 161–179.
[37] A. Shkapsky, M. Yang, C. Zaniolo, Optimizing recursive queries with monotonic aggregates in
deals, in: ICDE, 2015, pp. 867–878.
[38] L. Alt, C. Reitwießner, Smt-based verification of solidity smart contracts, in: ISoLA (4), volume
11247 of Lecture Notes in Computer Science, Springer, 2018, pp. 376–388.
[39] M. Nissl, E. Sallinger, Modelling smart contracts with datalogmtl, in: EDBT/ICDT Workshops,
volume 3135 of CEUR Workshop Proceedings, CEUR-WS.org, 2022.</p>
    </sec>
  </body>
  <back>
    <ref-list>
      <ref id="ref1">
        <mixed-citation>
          [1]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Favorito</surname>
          </string-name>
          , E. Laurenza,
          <string-name>
            <given-names>M.</given-names>
            <surname>Nissl</surname>
          </string-name>
          , E. Sallinger,
          <article-title>Toward fateful smart contracts</article-title>
          , in: DLT, CEUR Workshop Proceedings, CEUR-WS.org,
          <year>2024</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref2">
        <mixed-citation>
          [2]
          <string-name>
            <surname>J. I. Hong</surname>
          </string-name>
          ,
          <article-title>Teaching the fate community about privacy</article-title>
          ,
          <source>Commun. ACM</source>
          <volume>66</volume>
          (
          <year>2023</year>
          )
          <fpage>10</fpage>
          -
          <lpage>11</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref3">
        <mixed-citation>
          [3]
          <string-name>
            <given-names>Á. A.</given-names>
            <surname>Cabrera</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Fu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Bertucci</surname>
          </string-name>
          ,
          <string-name>
            <given-names>K.</given-names>
            <surname>Holstein</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Talwalkar</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. I.</given-names>
            <surname>Hong</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Perer</surname>
          </string-name>
          ,
          <string-name>
            <surname>Zeno:</surname>
          </string-name>
          <article-title>An interactive framework for behavioral evaluation of machine learning</article-title>
          ,
          <source>in: CHI, ACM</source>
          ,
          <year>2023</year>
          , pp.
          <volume>419</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>419</lpage>
          :
          <fpage>14</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref4">
        <mixed-citation>
          [4]
          <string-name>
            <given-names>T.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Agarwal</surname>
          </string-name>
          ,
          <string-name>
            <surname>J. I. Hong</surname>
          </string-name>
          ,
          <article-title>Coconut: An IDE plugin for developing privacy-friendly apps</article-title>
          ,
          <source>Proc. ACM Interact. Mob. Wearable Ubiquitous Technol</source>
          .
          <volume>2</volume>
          (
          <year>2018</year>
          )
          <volume>178</volume>
          :
          <fpage>1</fpage>
          -
          <lpage>178</lpage>
          :
          <fpage>35</fpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref5">
        <mixed-citation>
          [5]
          <string-name>
            <given-names>E.</given-names>
            <surname>Napoletano</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B.</given-names>
            <surname>Curry</surname>
          </string-name>
          ,
          <article-title>What is defi? understanding decentralized finance</article-title>
          , http://bitly.ws/xd7Y,
          <year>2021</year>
          . Last accessed on 2022-
          <volume>11</volume>
          -28.
        </mixed-citation>
      </ref>
      <ref id="ref6">
        <mixed-citation>
          [6]
          <string-name>
            <given-names>I.</given-names>
            <surname>Swaps</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Association</surname>
          </string-name>
          ,
          <article-title>Legal guidelines for smart derivatives contracts: the isda master agreement</article-title>
          ,
          <year>2019</year>
          .
        </mixed-citation>
      </ref>
      <ref id="ref7">
        <mixed-citation>
          [7]
          <string-name>
            <given-names>P. E.</given-names>
            <surname>Naeini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Dheenadhayalan</surname>
          </string-name>
          ,
          <string-name>
            <given-names>Y.</given-names>
            <surname>Agarwal</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L. F.</given-names>
            <surname>Cranor</surname>
          </string-name>
          ,
          <article-title>An informative security and privacy ”nutrition” label for internet of things devices</article-title>
          ,
          <source>IEEE Secur. Priv</source>
          .
          <volume>20</volume>
          (
          <year>2022</year>
          )
          <fpage>31</fpage>
          -
          <lpage>39</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref8">
        <mixed-citation>
          [8]
          <string-name>
            <given-names>J.</given-names>
            <surname>Buolamwini</surname>
          </string-name>
          , T. Gebru,
          <article-title>Gender shades: Intersectional accuracy disparities in commercial gender classification</article-title>
          ,
          <source>in: FAT</source>
          , volume
          <volume>81</volume>
          <source>of Proceedings of Machine Learning Research, PMLR</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>77</fpage>
          -
          <lpage>91</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref9">
        <mixed-citation>
          <article-title>[9] Bank of Italy, Public consultation on the working document relating to phase one of the research project on smart contracts</article-title>
          ,https://bit.ly/3xQKRL8,
          <year>2023</year>
          . [Online; accessed 3-May-2024].
        </mixed-citation>
      </ref>
      <ref id="ref10">
        <mixed-citation>
          [10]
          <string-name>
            <given-names>G.</given-names>
            <surname>Ciatto</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Calegari</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Mariani</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E.</given-names>
            <surname>Denti</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Omicini</surname>
          </string-name>
          ,
          <article-title>From the blockchain to logic programming and back: Research perspectives</article-title>
          , in: WOA,
          <year>2018</year>
          , pp.
          <fpage>69</fpage>
          -
          <lpage>74</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref11">
        <mixed-citation>
          [11]
          <string-name>
            <given-names>M.</given-names>
            <surname>Li</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Weng</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Yang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J.</given-names>
            <surname>Weng</surname>
          </string-name>
          ,
          <string-name>
            <surname>Y. Zhang,</surname>
          </string-name>
          <article-title>Towards interpreting smart contract against contract fraud: A practical and automatic realization</article-title>
          ,
          <source>Cryptology ePrint Archive</source>
          ,
          <year>Paper 2020</year>
          /574,
          <year>2020</year>
          . URL: https://eprint.iacr.org/
          <year>2020</year>
          /574, https://eprint.iacr.org/
          <year>2020</year>
          /574.
        </mixed-citation>
      </ref>
      <ref id="ref12">
        <mixed-citation>
          [12]
          <string-name>
            <given-names>E.</given-names>
            <surname>Regnath</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Steinhorst</surname>
          </string-name>
          , Smaconat:
          <article-title>Smart contracts in natural language</article-title>
          ,
          <source>in: 2018 Forum on Specification and Design Languages (FDL)</source>
          ,
          <year>2018</year>
          , pp.
          <fpage>5</fpage>
          -
          <lpage>16</lpage>
          . doi:
          <volume>10</volume>
          .1109/FDL.
          <year>2018</year>
          .
          <volume>8524068</volume>
          .
        </mixed-citation>
      </ref>
      <ref id="ref13">
        <mixed-citation>
          [13]
          <string-name>
            <given-names>A.</given-names>
            <surname>Hogan</surname>
          </string-name>
          , E. Blomqvist,
          <string-name>
            <given-names>M.</given-names>
            <surname>Cochez</surname>
          </string-name>
          , C. d'Amato, G. de Melo,
          <string-name>
            <given-names>C.</given-names>
            <surname>Gutierrez</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. E. L.</given-names>
            <surname>Gayo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Kirrane</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Neumaier</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Polleres</surname>
          </string-name>
          ,
          <string-name>
            <given-names>R.</given-names>
            <surname>Navigli</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A. N.</given-names>
            <surname>Ngomo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S. M.</given-names>
            <surname>Rashid</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Rula</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Schmelzeisen</surname>
          </string-name>
          ,
          <string-name>
            <given-names>J. F.</given-names>
            <surname>Sequeda</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Staab</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Zimmermann</surname>
          </string-name>
          ,
          <article-title>Knowledge graphs</article-title>
          , CoRR abs/
          <year>2003</year>
          .02320 (
          <year>2020</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref14">
        <mixed-citation>
          [14]
          <string-name>
            <given-names>T.</given-names>
            <surname>Baldazzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          , E. Sallinger,
          <article-title>Reasoning over financial scenarios with the vadalog system, in: EDBT, OpenProceedings</article-title>
          .org,
          <year>2023</year>
          , pp.
          <fpage>782</fpage>
          -
          <lpage>791</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref15">
        <mixed-citation>
          [15]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>D.</given-names>
            <surname>Fakhoury</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          , E. Sallinger,
          <article-title>Knowledge graphs and enterprise AI: the promise of an enabling technology</article-title>
          , in: ICDE, IEEE,
          <year>2019</year>
          , pp.
          <fpage>26</fpage>
          -
          <lpage>37</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref16">
        <mixed-citation>
          [16]
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Pieris</surname>
          </string-name>
          ,
          <article-title>Beyond SPARQL under OWL 2 QL entailment regime: Rules to the rescue</article-title>
          ,
          <source>in: IJCAI</source>
          ,
          <year>2015</year>
          , pp.
          <fpage>2999</fpage>
          -
          <lpage>3007</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref17">
        <mixed-citation>
          [17]
          <string-name>
            <given-names>A.</given-names>
            <surname>Colombo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ceri</surname>
          </string-name>
          , E. Laurenza,
          <article-title>Smart derivative contracts in datalogmtl</article-title>
          , in: EDBT, OpenProceedings.org,
          <year>2023</year>
          , pp.
          <fpage>773</fpage>
          -
          <lpage>781</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref18">
        <mixed-citation>
          [18]
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Walega</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Grau</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Kaminski</surname>
          </string-name>
          ,
          <string-name>
            <given-names>E. V.</given-names>
            <surname>Kostylev</surname>
          </string-name>
          , Datalogmtl:
          <article-title>Computational complexity and expressive power, in: IJCAI, ijcai</article-title>
          .org,
          <year>2019</year>
          , pp.
          <fpage>1886</fpage>
          -
          <lpage>1892</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref19">
        <mixed-citation>
          [19]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Nissl</surname>
          </string-name>
          , E. Sallinger,
          <article-title>Query evaluation in datalogmtl - taming infinite query results</article-title>
          ,
          <source>CoRR abs/2109</source>
          .10691 (
          <year>2021</year>
          ).
        </mixed-citation>
      </ref>
      <ref id="ref20">
        <mixed-citation>
          [20]
          <string-name>
            <given-names>S.</given-names>
            <surname>Ceri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>G.</given-names>
            <surname>Gottlob</surname>
          </string-name>
          , L. Tanca,
          <article-title>What you always wanted to know about datalog (and never dared to ask)</article-title>
          ,
          <source>TKDE</source>
          <volume>1</volume>
          (
          <year>1989</year>
          )
          <fpage>146</fpage>
          -
          <lpage>166</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref21">
        <mixed-citation>
          [21]
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Blasi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>M.</given-names>
            <surname>Nissl</surname>
          </string-name>
          ,
          <string-name>
            <surname>E. Sallinger,</surname>
          </string-name>
          <article-title>The temporal vadalog system</article-title>
          ,
          <source>in: RuleML+RR</source>
          , volume
          <volume>13752</volume>
          of Lecture Notes in Computer Science, Springer,
          <year>2022</year>
          , pp.
          <fpage>130</fpage>
          -
          <lpage>145</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref22">
        <mixed-citation>
          [22]
          <string-name>
            <given-names>D.</given-names>
            <surname>Wang</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P.</given-names>
            <surname>Hu</surname>
          </string-name>
          ,
          <string-name>
            <given-names>P. A.</given-names>
            <surname>Walega</surname>
          </string-name>
          ,
          <string-name>
            <given-names>B. C.</given-names>
            <surname>Grau</surname>
          </string-name>
          , Meteor:
          <article-title>Practical reasoning in datalog with metric temporal operators</article-title>
          , in: AAAI, AAAI Press,
          <year>2022</year>
          , pp.
          <fpage>5906</fpage>
          -
          <lpage>5913</lpage>
          .
        </mixed-citation>
      </ref>
      <ref id="ref23">
        <mixed-citation>
          [23]
          <string-name>
            <given-names>T. S.</given-names>
            <surname>Authors</surname>
          </string-name>
          , Solidity documentation,https://docs.soliditylang.
          <source>org/en/v0.8</source>
          .21,/
          <year>2023</year>
          . [Online; accessed 12-Oct-2023].
        </mixed-citation>
      </ref>
      <ref id="ref24">
        <mixed-citation>
          [24]
          <string-name>
            <given-names>B.</given-names>
            <surname>Wiki</surname>
          </string-name>
          , Script, https://en.bitcoin.it/wiki/Script,
          <year>2023</year>
          . [Online; accessed 12-Oct-2023].
        </mixed-citation>
      </ref>
      <ref id="ref25">
        <mixed-citation>
          [25]
          <string-name>
            <given-names>T.</given-names>
            <surname>Baldazzi</surname>
          </string-name>
          ,
          <string-name>
            <given-names>L.</given-names>
            <surname>Bellomarini</surname>
          </string-name>
          ,
          <string-name>
            <given-names>S.</given-names>
            <surname>Ceri</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Colombo</surname>
          </string-name>
          ,
          <string-name>
            <given-names>A.</given-names>
            <surname>Gentili</surname>
          </string-name>
          , E. Sallinger,
          <article-title>Fine-tuning large enterprise</article-title>
        </mixed-citation>
      </ref>
    </ref-list>
  </back>
</article>