<?xml version="1.0" encoding="UTF-8"?>
<TEI xml:space="preserve" xmlns="http://www.tei-c.org/ns/1.0" 
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" 
xsi:schemaLocation="http://www.tei-c.org/ns/1.0 https://raw.githubusercontent.com/kermitt2/grobid/master/grobid-home/schemas/xsd/Grobid.xsd"
 xmlns:xlink="http://www.w3.org/1999/xlink">
	<teiHeader xml:lang="en">
		<fileDesc>
			<titleStmt>
				<title level="a" type="main">Noninterference Analysis for Smart Contracts: Would you Bet on it?</title>
			</titleStmt>
			<publicationStmt>
				<publisher/>
				<availability status="unknown"><licence/></availability>
			</publicationStmt>
			<sourceDesc>
				<biblStruct>
					<analytic>
						<author role="corresp">
							<persName><forename type="first">Samia</forename><surname>Guesmi</surname></persName>
							<email>semia.guesmi@unicam.it</email>
							<affiliation key="aff0">
								<orgName type="institution">Università degli Studi di Camerino</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Carla</forename><surname>Piazza</surname></persName>
							<affiliation key="aff1">
								<orgName type="institution">Università degli Studi di Udine</orgName>
							</affiliation>
						</author>
						<author>
							<persName><forename type="first">Sabina</forename><surname>Rossi</surname></persName>
							<affiliation key="aff2">
								<orgName type="institution">Università Ca&apos; Foscari di Venezia</orgName>
							</affiliation>
						</author>
						<author>
							<affiliation key="aff3">
								<orgName type="department">Distributed Ledger Technologies Workshop</orgName>
								<address>
									<addrLine>May</addrLine>
									<postCode>14-15 2024</postCode>
									<settlement>Turin</settlement>
									<country key="IT">Italy</country>
								</address>
							</affiliation>
						</author>
						<title level="a" type="main">Noninterference Analysis for Smart Contracts: Would you Bet on it?</title>
					</analytic>
					<monogr>
						<idno type="ISSN">1613-0073</idno>
					</monogr>
					<idno type="MD5">62DB0C823F8B78DE5D19256227726758</idno>
				</biblStruct>
			</sourceDesc>
		</fileDesc>
		<encodingDesc>
			<appInfo>
				<application version="0.7.2" ident="GROBID" when="2025-04-23T19:16+0000">
					<desc>GROBID - A machine learning software for extracting information from scholarly documents</desc>
					<ref target="https://github.com/kermitt2/grobid"/>
				</application>
			</appInfo>
		</encodingDesc>
		<profileDesc>
			<textClass>
				<keywords>
					<term>Smart Contracts</term>
					<term>MEV</term>
					<term>Noninterference</term>
					<term>Unwinding Conditions</term>
				</keywords>
			</textClass>
			<abstract>
<div xmlns="http://www.tei-c.org/ns/1.0"><p>In the context of Blockchains and Decentralized Finance the notion of Maximal Extractable Value (MEV) is attracting more and more attention. MEV is the maximum gain that users-including miners and validators-can obtain by interacting with a smart contract and with its dependencies. Such profits witness attacks that also exploit strategic transaction manipulations (e.g., reordering transactions in blocks) and distort the meaning of smart contracts. The use of the notion of noninterference for modeling and analysing MEV attacks has recently been proposed in the literature. Noninterference aims to capture unwanted information flows in multi-level systems. Various definitions of noninterference have been presented, and among these those based on unwinding conditions allow the possible flows to be specifically located in a system. In this paper we investigate the use of such unwinding conditions to analyze MEV. We exploit a simple case study-the Bet contract-to highlight the advantages and disadvantages of our proposal.</p></div>
			</abstract>
		</profileDesc>
	</teiHeader>
	<text xml:lang="en">
		<body>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Introduction</head><p>Decentralized Finance (DeFi) is revolutionizing the landscape of the global digital economy by amalgamating decentralization and distribution principles with traditional financial services. This integration operates within a decentralized framework, leveraging digital assets primarily through blockchain technology <ref type="bibr" target="#b0">[1,</ref><ref type="bibr" target="#b1">2,</ref><ref type="bibr" target="#b2">3]</ref>. Such pioneering methods engender an alternative financial system distinguished by its emphasis on decentralization, fostering innovation, promoting interoperability, and ensuring transparency <ref type="bibr" target="#b3">[4]</ref>. Ethereum, renowned for its sophisticated smart contract functionality, stands as the cornerstone technology supporting various DeFi services. Smart contracts serve as automated enforcers of contractual terms, allowing for intricate interactions between parties without the need for intermediaries <ref type="bibr" target="#b4">[5]</ref>.</p><p>Despite the security assurances provided by blockchain technology, DeFi smart contracts possess inherent vulnerabilities as highlighted in recent studies <ref type="bibr" target="#b5">[6]</ref>. Within the DeFi ecosystem, decentralized exchanges (DEXs) play a central role by facilitating trustless transactions through smart contracts, eliminating the need for centralized intermediaries. Automated Market Maker (AMM) protocols, a prominent feature of DEXs, have garnered significant attention in the wake of increased interest in blockchain technology. These protocols operate on a peer-to-pool basis, wherein liquidity providers contribute assets to liquidity pools, enabling users to exchange assets at algorithmically determined prices <ref type="bibr" target="#b3">[4]</ref>.</p><p>In the realm of Blockchains and Decentralized Finance (DeFi), the concept of Maximal Extractable Value (MEV) is gaining increasing attention. MEV represents the maximum potential gain that users, including miners and validators, can achieve through interactions with a smart contract and its associated dependencies <ref type="bibr" target="#b6">[7]</ref>. This potential for profit attracts not only legitimate users but also malicious actors who exploit strategic transaction manipulations, such as reordering transactions within blocks, to manipulate the outcomes of smart contracts. These actors often employ automated bots to engage in frontrunning, exploiting transactional intricacies for potential gains <ref type="bibr" target="#b7">[8]</ref>. Notable examples of MEV exploitation include instances of decentralized exchange (DEX) arbitrage, where participants exploit price differences across decentralized exchange protocols <ref type="bibr" target="#b8">[9]</ref>. Such attacks not only compromise the integrity of smart contracts but also distort their intended functionality.</p><p>Recent literature has proposed utilizing the concept of noninterference for modeling and analyzing MEV attacks. Noninterference aims to identify and mitigate undesired information flows within multilevel systems. Various definitions of noninterference have been introduced <ref type="bibr" target="#b9">[10,</ref><ref type="bibr" target="#b10">11,</ref><ref type="bibr" target="#b11">12,</ref><ref type="bibr" target="#b12">13]</ref>, with those based on unwinding conditions particularly useful for pinpointing potential information flows within a system <ref type="bibr" target="#b13">[14,</ref><ref type="bibr" target="#b14">15,</ref><ref type="bibr" target="#b15">16]</ref>. Our study builds upon prior research, particularly drawing from the contributions by Babel et al. in <ref type="bibr" target="#b16">[17]</ref> and by <ref type="bibr">Bartoletti et al. in</ref>  <ref type="bibr" target="#b17">[18]</ref>. Specifically, Bartoletti et al. 's work introduces a novel concept of secure composability for smart contracts, aiming to safeguard compound contracts from economic harm caused by adversaries interfering with their dependencies.</p><p>In this paper, our investigation centers on the application of unwinding conditions to analyze the Maximal Extractable Value (MEV). Our approach involves a meticulous examination of a straightforward case study-the Bet contract-with the aim of elucidating both the strengths and limitations of our methodology. Specifically, we utilize a simple imperative concurrent language, as introduced in a previous study <ref type="bibr" target="#b13">[14,</ref><ref type="bibr" target="#b15">16]</ref> for security verification, to identify vulnerabilities within DeFi smart contracts that are susceptible to MEV interferences. Through the presentation of the Bet contract case study, we spotlight scenarios where particular conditions affect MEV noninterference, thereby emphasizing potential sources of vulnerability within DeFi services. Differently from the proposal of <ref type="bibr" target="#b17">[18]</ref>, we exploit the formalization of noninterference in terms of unwinding conditions. This allows us to abstract from the environment, namely the specific implementations of smart contracts that interact with the one under examination. This abstraction enables a more comprehensive evaluation of MEV vulnerabilities within DeFi systems.</p><p>Structure of the paper. The structure of the paper is as follows: In Section 1, we present the case study of the Bet contract. Section 2 introduces the concept of noninterference for an imperative concurrent language and outlines the use of downgrading to capture the release of sensitive information. Section 3 details the modeling of the Bet contract within our imperative language, including the capture of the noninterference property and the application of downgrading functionality to differentiate secure scenarios from potentially risky ones. Finally, Section 4 discusses related work and concludes the paper.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="1.">The Bet Contract Case Study</head><p>In this section we briefly introduce the main functionalities of a betting service, as also detailed in <ref type="bibr" target="#b17">[18]</ref>, which serves as a straightforward case study in this paper to demonstrate how to instantiate noninterference expressed through unwinding conditions for detecting MEV attacks. Specifically, the Bet contract we consider enables individuals to place bets on the exchange rate between a given token and Ether. This contract is parameterized based on an oracle contract responsible for providing token price information. Upon deployment, the owner initiates the bet contract with an initial pot of Ether; for joining, a player is required to contribute an amount of Ether equal to the pot. Prior to the deadline, the player can withdraw the pot if the oracle exchange rate is greater than the bet rate defined by the Bet contract owner. Subsequently, after the deadline elapses, the pot is transferred to the owner's wallet.</p><p>We explore two instances of the oracle contract, with the first being an Automated Market Maker (AMM) inspired by the Uniswap protocol (see, https://uniswap.org/). This AMM allows users to both add liquidity for two tokens and execute swaps between the held tokens. Additionally, the contract enables the querying of token pairs and exchange rates. In contrast, the second oracle contract, referred to as the Exchange contract, differs from the AMM contract in terms of rate setting. In the AMM, the rate is affected by the fluctuations in the total amount of tokens staked in the AMM wallet, equating to the division of the total amount of one token by the total amount of the paired token. Conversely, in the Exchange contract, the rate is solely determined by the owner and remains unaffected by variations in wallet values resulting from user interactions. Figure <ref type="figure" target="#fig_0">1</ref> illustrates the primary functionalities of the Bet contract and its potential interactions with either AMM or Exchange.</p><p>As detailed in <ref type="bibr" target="#b17">[18]</ref>, MEV attacks become feasible when the Bet contract employs AMM as its oracle. In this scenario, an attacker can place a bet and subsequently interact with the AMM contract before executing the function to claim the win. By doing so, the attacker alters the exchange rate, thereby influencing the outcome of the bet. This vulnerability is not limited to regular users; its success rate significantly increases when the attacker is a miner with the ability to dictate transaction order within blocks. Conversely, if the Bet contract relies on the Exchange contract as its oracle, the attacker cannot modify the rate, even if interaction with the Exchange contract occurs.</p><p>In the forthcoming sections, we will show that when we use noninterference for modeling this attack the wallet of the bet contract is going to play the role of the low level variable over which we observe a flow of information (denoted by a green 𝐿 in Figure <ref type="figure" target="#fig_0">1</ref>). Such flow of information comes from the high level variable representing the exchange rate (denoted by a red 𝐻 in Figure <ref type="figure" target="#fig_0">1</ref>), i.e., from a variable whose value can be altered by other contracts. Our approach offers the advantage of focusing solely on the bet contract and identifying potentially dangerous instructions within it. Then, a thorough analysis of the oracles becomes imperative to distinguish between the two scenarios.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.">Noninterference and Downgrading over a Concurrent Imperative Language</head><p>In <ref type="bibr" target="#b15">[16]</ref> we considered an imperative concurrent language, inspired by the one introduced in <ref type="bibr" target="#b18">[19]</ref> and proposed different notions of noninterference with the aim of ensuring that in multi-level systems, where users are categorized as high (e.g., system administrators) and low (e.g., standard users) no information flow occurs from the high level to the low one. A flow of information from high to low could in fact represent the public disclosure of private data.</p><p>Recognizing that completely preventing any potential flow might be overly restrictive in many scenarios, we also proposed a downgrading mechanism in <ref type="bibr" target="#b15">[16]</ref>. This mechanism enables explicit allowance of delimited flows, providing a nuanced approach to managing information flow within the system.</p><p>In this section, we provide a brief overview of those papers. However, to maintain simplicity in our presentation, we refrain from utilizing specific observational equivalences, like, e.g., bisimulation. Instead, we solely focus on observing the values of low-level variables at the end of the execution.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.1.">The Language</head><p>Let ℤ be the set of integer numbers, 𝕋 = {true, false} be the set of boolean values, 𝕃 be a set of low level locations and ℍ be a set of high level locations, with 𝕃 ∩ ℍ = ∅. The set Aexp of arithmetic expressions is defined by the grammar:</p><formula xml:id="formula_0">𝑎 ∶∶= 𝑛 | 𝑋 | 𝑎 0 + 𝑎 1 | 𝑎 0 − 𝑎 1 | 𝑎 0 * 𝑎 1</formula><p>where 𝑛 ∈ ℤ and 𝑋 ∈ 𝕃 ∪ ℍ. We assume that arithmetic expressions are total. The set Bexp of boolean expressions is defined by:</p><formula xml:id="formula_1">𝑏 ∶∶= true | false | (𝑎 0 = 𝑎 1 ) | (𝑎 0 ≤ 𝑎 1 ) | ¬𝑏 | 𝑏 0 ∧ 𝑏 1 | 𝑏 0 ∨ 𝑏 1</formula><p>where 𝑎 0 , 𝑎 1 ∈ Aexp.</p><p>We say that an arithmetic expression 𝑎 is confidential, denoted by 𝑎 ∈ high, if there is a high level location which occurs in it. Otherwise we say that 𝑎 is public, denoted by 𝑎 ∈ low. Similarly, we say that a boolean expression 𝑏 is confidential, denoted by 𝑏 ∈ high, if there is a confidential arithmetic expression which occurs in it. Otherwise we say that 𝑏 is public, denoted by 𝑏 ∈ low. This notion of confidentiality, both for arithmetic and boolean expressions, is purely syntactic. Notice that a high level expression can contain low level locations, i.e., its value can depend on the values of low level locations. This reflects the idea that a high level user can read both high and low level data.</p><p>The set Prog of programs of our language is defined as:</p><formula xml:id="formula_2">𝑆 ∶∶= skip | 𝑋 ∶= 𝑎 | 𝑆 0 ; 𝑆 1 𝑃 ∶∶= 𝑆 | 𝑃 0 ; 𝑃 1 | if(𝑏) {𝑃 0 } else {𝑃 1 } | while(𝑏) {𝑃} | await(𝑏) {𝑆} | co 𝑃 1 | | … | |𝑃 𝑛 oc</formula><p>where 𝑎 ∈ Aexp, 𝑋 ∈ 𝕃 ∪ ℍ, and 𝑏 ∈ Bexp. Notice that, as in <ref type="bibr" target="#b18">[19]</ref>, in the body of the await operator only sequences of assignments are allowed. The operational semantics of our language is based on the notion of state. A state 𝜎 is a function which assigns to each location an integer, i.e., 𝜎 ∶ 𝕃 ∪ ℍ ⟶ ℤ. Given a state 𝜎 , we denote by 𝜎[𝑋 /𝑛] the state 𝜎 ′ such that 𝜎 ′ (𝑋 ) = 𝑛 and 𝜎 ′ (𝑌 ) = 𝜎(𝑌 ) for all 𝑌 ≠ 𝑋 . Moreover, we denote by 𝜎 𝐿 the restriction of 𝜎 to the low level locations and we write 𝜎 = 𝑙 𝜃 for 𝜎 𝐿 = 𝜃 𝐿 .</p><p>Given an arithmetic expression 𝑎 ∈ Aexp and a state 𝜎, the evaluation of 𝑎 in 𝜎 , denoted by ⟨𝑎, 𝜎 ⟩ → 𝑛 with 𝑛 ∈ ℤ, is defined in the standard way. Similarly, ⟨𝑏, 𝜎 ⟩ → 𝑣 with 𝑏 ∈ Bexp and 𝑣 ∈ {true, false}, denotes the evaluation of a boolean expression 𝑏 in a state 𝜎 . In both cases atomicity of the evaluation operation is assumed.</p><p>Our operational semantics is expressed in terms of state transitions. A transition from a program 𝑃 and a state 𝜎 has the form ⟨𝑃, 𝜎 ⟩ 𝜖 → ⟨𝑃 ′ , 𝜎 ′ ⟩ where 𝑃 ′ is either a program or the special symbol end (denoting termination) and 𝜖 ∈ {high, low} stating that the transition is either confidential or public. The operation 𝜖 1 ∪𝜖 2 returns low if both 𝜖 1 and 𝜖 2 are low otherwise it returns high. Let ℙ = Prog∪{end} and Σ be the set of all the possible states. The operational semantics of ⟨𝑃, 𝜎 ⟩ ∈ ℙ × Σ is the labelled transition system (LTS) defined by structural induction on 𝑃 according to the rules depicted in Table <ref type="table">1</ref> in the Appendix. Intuitively, the semantics of the sequential composition imposes that a program of the form 𝑃 0 ; 𝑃 1 behaves like 𝑃 0 until 𝑃 0 terminates and then it behaves like 𝑃 1 . To describe the semantics of a program of the form while(𝑏) {𝑃} we have to distinguish two cases: if 𝑏 is true, then the program is unravelled to 𝑃; while(𝑏) {𝑃}; otherwise it terminates. As far as the await operator is concerned, if 𝑏 is true then await(𝑏) {𝑃} terminates executing 𝑃 in one indivisible action, i.e., it is not possible to observe the state changes internal to the execution of 𝑃, while if 𝑏 is false then await(𝑏) {𝑃} loops waiting for 𝑏 to become true. Finally, in a parallel composition of the form co 𝑃 0 | | … | |𝑃 𝑛 oc any of the 𝑃 𝑖 can move, and the termination is reached only when all the 𝑃 𝑖 's have terminated.</p><p>We use the following notations. We write ⟨𝑃, 𝜎⟩ → ⟨𝑃 ′ , 𝜎 ′ ⟩ to denote ⟨𝑃, 𝜎 ⟩ 𝜖 → ⟨𝑃 ′ , 𝜎 ′ ⟩ with 𝜖 ∈ {low, high} and ⟨𝑃 0 , 𝜎 0 ⟩ → 𝑛 ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩ with 𝑛 ≥ 0 for ⟨𝑃 0 , 𝜎 0 ⟩ → ⟨𝑃 1 , 𝜎 1 ⟩ → ⋯ → ⟨𝑃 𝑛−1 , 𝜎 𝑛−1 ⟩ → ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩.</p><p>The notation ⟨𝑃 0 , 𝜎 0 ⟩ low ⇝ ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩ stands for ⟨𝑃 0 , 𝜎 0 ⟩ → 𝑛 ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩ for some 𝑛 ≥ 0 with all the 𝑛 transitions labelled with low; similarly ⟨𝑃 0 , 𝜎 0 ⟩ high ⇝ ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩ stands for ⟨𝑃 0 , 𝜎 0 ⟩ → 𝑛 ⟨𝑃 𝑛 , 𝜎 𝑛 ⟩ for some 𝑛 ≥ 0 with at least one of the 𝑛 transitions labelled with high. Finally, we write ⟨𝑃, 𝜎 ⟩ ⇝ ⟨𝑃 ′ , 𝜎 ′ ⟩ to denote</p><formula xml:id="formula_3">⟨𝑃, 𝜎⟩ 𝜖 ⇝ ⟨𝑃 ′ , 𝜎 ′ ⟩ with 𝜖 ∈ {low, high}.</formula><p>Notice that the operational semantics defined in Table <ref type="table">1</ref> is non-deterministic, since in the case of parallel composition there are many possible evolutions.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.2.">Noninterference</head><p>Intuitively, when we analyze a program 𝑃 that involves both low and high-level variables, our objective is to ensure that regardless of how the high-level variables are modified during execution by other high-level components, which represent interactions with high-level users, the values of the low-level variables remain unaffected. Put simply, if actions performed by other components on the high-level variables lead to changes in the low-level ones, it signifies an unwanted information flow, or interference. In essence, we focus solely on the program 𝑃 and aim to demonstrate its security in any possible context or environment -meaning, irrespective of the actions taken by high-level users. This concept is formalized in <ref type="bibr" target="#b15">[16]</ref>, where a generalized unwinding condition defines classes of programs that are parametric with respect to:</p><p>• a binary relation ≐ which equates two states if they are indistinguishable for a low level observer; • a binary reachability relation ℛ on ℙ × Σ which associates to each pair ⟨𝑃, 𝜎 ⟩ all the pairs ⟨𝐹 , 𝜓 ⟩ which, in some sense, are reachable from ⟨𝑃, 𝜎⟩. • a binary relation ≑ which equates two pairs ⟨𝑃, 𝜎⟩ and ⟨𝑄, 𝜃⟩ if they are indistinguishable for a low level observer;</p><p>A pair ⟨𝑃, 𝜎 ⟩ satisfies (an instance of) our unwinding framework (i.e., there are no flows of information from high to low) if any high level step ⟨𝐹 , 𝜓 ⟩ high → ⟨𝐺, 𝜑⟩ performed by a pair ⟨𝐹 , 𝜓 ⟩ reachable from ⟨𝑃, 𝜎 ⟩ has no effect on the observation of a low level user. This is achieved by requiring that all the elements in the set {⟨𝐹 , 𝜋⟩ | 𝜋 ≐ 𝜓 } (whose states are low level equivalent) may perform a transition reaching an element of the set {⟨𝑅, 𝜌⟩ | ⟨𝑅, 𝜌⟩ ≑ ⟨𝐺, 𝜑⟩} (whose elements are all indistinguishable for a low level observer). We use the notation ℛ(⟨𝑃, 𝜎⟩) to denote the set of pairs reachable from ⟨𝑃, 𝜎 ⟩, i.e., ℛ(⟨𝑃, 𝜎⟩) = {⟨𝐹 , 𝜓 ⟩ | ⟨𝑃, 𝜎⟩ℛ⟨𝐹 , 𝜓 ⟩}.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Definition 1. (Generalized Unwinding)</head><p>Let ≐ be a binary relation over Σ, ℛ and ≑ be two binary relations over ℙ × Σ. We define the unwinding class 𝒲 (≐, ℛ, ≑) by:</p><formula xml:id="formula_4">𝒲 (≐, ℛ, ≑) def = {⟨𝑃, 𝜎⟩ ∈ Prog × Σ | ∀ ⟨𝐹 , 𝜓 ⟩ ∈ ℛ(⟨𝑃, 𝜎 ⟩) if ⟨𝐹 , 𝜓 ⟩ high → ⟨𝐺, 𝜑⟩ then ∀ 𝜋 ∈ Σ such that 𝜋 ≐ 𝜓 , ∃ ⟨𝑅, 𝜌⟩ ∶ ⟨𝐹 , 𝜋⟩ → ⟨𝑅, 𝜌⟩ and ⟨𝐺, 𝜑⟩ ≑ ⟨𝑅, 𝜌⟩}</formula><p>We will now apply the concept of generalized unwinding in one of its simplest forms, which will serve as a sufficient foundation for our analysis in the subsequent section focusing on our case study. As far as the relation ≐ is concerned, it is quite natural to consider two states to be equivalent when they assign the same values to the low level variables, i.e., we consider ≐ to be the relation = 𝑙 . The relation ℛ is the notion of reachability we rely on, i.e., ⇝ is defined by the operational semantics. In <ref type="bibr" target="#b15">[16]</ref>, we introduced the concept of low-level bisimulation to define what the low-level user can observe. Specifically, we utilized low-level bisimulation to instantiate the equivalence relation denoted by ≑. Bisimulation is the appropriate notion to employ when it is assumed that the low-level user can observe the values of low-level variables at any point during the execution. Also other more involved forms of approximating equivalences such as the one presented in <ref type="bibr" target="#b19">[20]</ref> could be used for our aims. However, for the sake of simplicity in our current presentation, we make the assumption that the lowlevel user can only observe the values of variables at the end of the execution. We are aware of the fact that this is not a good choice when non-terminating programs are considered. Formally this means that we instantiate ≑ as ≈ 𝑙 defined as follows.</p><formula xml:id="formula_5">⟨𝐹 , 𝜓 ⟩ high ⟶ ⟨𝐺, 𝜑⟩ ⇝ ⟨end, 𝜑 ′ ⟩ ↑ ↑ ↑ ↓ ↓ ↓ 𝜋 = 𝑙 𝜓 ≈ 𝑙 𝜑 ′ = 𝑙 𝜌 ′ ↑ ↑ ↑ ↓ ↓ ↓ ⟨𝐹 , 𝜋⟩ ⟶ ⟨𝑅, 𝜌⟩ ⇝ ⟨end, 𝜌 ′ ⟩</formula><p>Definition 2 (≈ 𝑙 ). Let ⟨𝐺, 𝜑⟩ and ⟨𝑅, 𝜌⟩ be two pairs. It holds that ⟨𝐺, 𝜑⟩ ≈ 𝑙 ⟨𝑅, 𝜌⟩ if and only if whenever ⟨𝐺, 𝜑⟩ ⇝ ⟨end, 𝜑 ′ ⟩, there exists a pair ⟨end, 𝜌 ′ ⟩ such that ⟨𝑅, 𝜌⟩ ⇝ ⟨end, 𝜌 ′ ⟩ with 𝜑 ′ = 𝑙 𝜌 ′ , and viceversa (i.e., ≈ 𝑙 is symmetric). Now that we have gathered all the necessary components, our objective is to demonstrate that a program 𝑃 does not exhibit interference. In other words, for all possible states 𝜎 , the pair ⟨𝑃, 𝜎 ⟩ belongs to 𝒲 (= 𝑙 , ⇝, ≈ 𝑙 ). Through our case study, we will illustrate that when this condition is not met, it may lead to MEV interferences.</p><p>As demonstrated in our previous work <ref type="bibr" target="#b15">[16]</ref>, when a program does not belong to an unwinding class, it is possible to define a malicious environment wherein information flows from high to low. This means that by analyzing the program in isolation, we can pinpoint potential hazardous scenarios. In other words, when a program belongs to an unwinding class, no adverse consequences can arise, regardless of the actions taken by the environment. One of the main advantages of the unwinding approach is its ability to identify the specific points within the program that could potentially lead to information flows. As illustrated in Figure <ref type="figure" target="#fig_1">2</ref>, such flows occur when high-level transitions are executed.</p><p>In the context of MEV interference, this approach aids in identifying the specific dependencies of the contract that require deeper analysis. When scrutinizing these dependencies reveals that no adverse outcomes can occur, it is possible to leverage the concept of downgrading, thereby permitting controlled information flows.</p><p>Example 1. In order to provide some more intuition on the meaning of the unwinding condition, let us consider the followning toy example.</p><formula xml:id="formula_6">𝑃 ≡ 𝐻 ∶= 0; if(𝐻 &gt; 0){𝐿 ∶= 𝐻 } else {skip}</formula><p>Let 𝐻 be high level and 𝐿 be low level. Apparently, when we reach the if test the value of the high level variable is 0, so the else branch is always taken and the value of the high level variable is not revealed. However, this program does not satisfy our unwinding condition as one can observe taking for instance 𝜓 which assigns value 0 to 𝐻 and 𝜋 that is 𝜓 [𝐻 /1]. As a matter of fact, when the if test is reached we have to consider the possibility that another program running in parallel with 𝑃 has modified the value of 𝐻 , thus allowing to take the if branch and reveal the value of the variable 𝐻 to the low level user.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="2.3.">Downgrading</head><p>As noted by numerous researchers, the concept of noninterference can be overly limiting in numerous practical scenarios. Noninterference models the complete absence of information flow from high to low levels. However, in reality, many programs do require some form of release or downgrading of sensitive information (e.g., password checking, information purchase, and spreadsheet computation) <ref type="bibr" target="#b11">[12,</ref><ref type="bibr" target="#b20">21]</ref>.</p><p>The intuitive concept of downgrading masks certain intricate issues at the implementation level. For example, it raises questions like "who can perform downgrading, " "what elements can be downgraded, " "where downgrading can occur, " and so forth. In our previous work <ref type="bibr" target="#b15">[16]</ref>, we introduced a collection of high-level expressions and proposed a delimited notion of noninterference that permits the downgrading of such expressions at any stage during the execution.</p><p>In this paper, we opt to focus on a notion of downgrading that pertains to the precise point within the execution where the downgrading occurs. This aligns with our approach of using unwinding conditions to pinpoint specific points in the execution of a smart contract where potential MEV interferences may arise. To achieve this, we introduce a function called downgrade that maps any arithmetic or boolean expression to itself, while altering its confidentiality level to low. Consequently, the operational semantics of program instructions involving downgrade are declassified to the low level, and they are not considered as dangerous in the unwinding test.</p><p>Example 2. We consider again the program 𝑃 of Example 1. If we know that revealing to the low level user the value of 𝐻 is not dangerous, and it is necessary (e.g., the system administrator needs to send to the user a message), then we can modify the program 𝑃 as follows:</p><formula xml:id="formula_7">𝑃 ≡ 𝐻 ∶= 0; 𝐷 ∶= downgrade(𝐻 ); if(𝐷 &gt; 0){𝐿 ∶= 𝐷} else {skip}</formula><p>If 𝐷 is low level, the only point where we should check the unwinding condition, is the second assignment instruction. However, since the downgrade operator is used, when the assignment is executed a low level transition is performed and the unwinding condition is satisfied.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="3.">Back to the Bet Contract</head><p>We are now ready to model the Bet contract case study within our imperative language. In our model, the Bet contract is defined as the parallel composition of its functionalities, namely:</p><formula xml:id="formula_8">Bet_Contract ≡ co Constructor | | Bet | | Win | | Close oc .</formula><p>Since our language provides only basic instructions and lacks object-oriented features, we exploit the await operator to enforce the desired order of execution. For instance, the Constructor should execute first. Additionally, in our code, we denote variables using strings that begin with capital letters, while constants are enclosed in quotation marks.</p><p>The Constructor program is responsible for deploying the Bet_Contract. Let us assume a program named Owner initializes the variables InitialPot, Rate, Token, Oracle, and Deadline. Additionally, the variable OracleGetToken contains the returned value of the GetToken program, which is a part of the oracle contract, and it is used to check that the oracle contract allows the exchange between Ether and Token. Another program, Zero, assigns zero values to the variables InitialPot, Rate, Token, Oracle, and Deadline. The Constructor program awaits the initialization of the variables InitialPot, Rate, Token, Oracle, and Deadline. Subsequently, it verifies that the oracle program can exchange Ether and Token. If this is the case, it updates the variables BetOwner, BetOwnerWalletEther, BetWallet. We highlight the variable BetWallet in green as it is the variable we aim to safeguard from MEV attacks, meaning it will be designated as low-level.  SenderBet ∶= 0 Similar to the Bet program, the Win program runs continuously until the deadline expires. It awaits the current player, whose name is stored in the variable Player, to claim victory. This indicates that when the player wishes to claim, they will use another program to modify the value of the variable SenderWin. Upon this action, the Win program compares the variables BetRate and AmmRateEther. If the latter is greater than the former, the player receives the entire value of the BetWallet. The variable AmmRateEther is highlighted in red because its value is determined and modified within the oracle program (AMM or Exchange in our example). We lack control over its value, making it a potential source of MEV attacks.  SenderWin ∶= 'NULL' It's worth noting that we explicitly designate the variable BetWallet as low-level and AmmRateEther as high-level, while no specific designation is made for the other variables. In this scenario, we can consider them as low-level by default, which is equivalent to solely focusing on potential MEV attacks stemming from the variable AmmRateEther.</p><p>At this point, we have all the necessary ingredients to assess whether the program Bet_Contract meets our unwinding condition. Assuming that the only high-level variable is AmmRateEther, we observe that the sole high-level transition is triggered by line 5 of the Win program. When this transition occurs we reach a state which leads to the end of the program with the low level variable BetWallet equal to 0. However, if we modify only the high level variable AmmRateEther prior to the execution of line 5, the program ends with BetWallet being non-zero. This discrepancy is sufficient to infer that Bet_Contract fails to satisfy the unwinding condition, indicating interference from high to low and highlighting a potential source of MEV attacks.</p><p>This small example provides insight into the functionality of unwinding conditions, demonstrating their ability to analyze the program of interest independently of the blockchain environment in which it will ultimately operate. Additionally, unwinding conditions offer the benefit of identifying the precise instructions and variables within the code that could potentially be exploited as attack vectors.</p><p>However, we cannot draw a conclusion on the reliability of the Bet_Contract solely based on this analysis. It is imperative to delve deeper into the oracle programs to assess whether the potential attacks are indeed feasible. If these attacks are not deemed "realistic", we can then utilize the downgrading mechanism and consider the Bet_Contract as "secure".</p><p>Let us now examine the scenario where the oracle program is the AMM contract. Specifically, we will analyze its core functionalities, particularly operations that significantly impact the token's rate. An Automated Market Maker (AMM) is a decentralized finance (DeFi) algorithmic trading protocol that enables the automatic exchange of cryptographic tokens through the use of liquidity pools. Unlike traditional order book-based exchanges, AMMs provide liquidity through these pools, with prices determined algorithmically based on the token ratios within the pool. Automated Market Makers (AMMs) employ mathematical formulas to determine token prices within liquidity pools. The two predominant AMM formulas are the Constant Product Market Maker (CPMM) and the Constant Sum Market Maker (CSMM). In our case study, we use an AMM instance based on CPMM, which is expressed by the formula 𝐾 = 𝑋 * 𝑌 , where 𝑋 represents the amount of token T1 in the AMM, and 𝑌 represents the amount of token T2 in the AMM. This implies that the ratio of token quantities directly influences the price of one token relative to another. Furthermore, the formula ensures that, while the values for tokens 𝑋 and 𝑌 may fluctuate, the value for 𝐾 remains constant during trades or liquidity deposits.</p><p>The program GetRate returns the exchange rate between the two tokens T1 and T2, ensuring the constant product of their quantities as defined earlier. This program computes and provides the value of the variable AmmRateEther, which is used in the Win program within the Bet_Contract. Similarly, in the code, variables designated in red are considered high-level. Specifically, AmmRateT1 and AmmRateT2 must be high-level because they correspond to the variable AmmRateEther used in the Win program. Furthermore, the variables AmmWalletT1 and AmmWalletT2 also need to be high-level, their significance will become clear upon examining the Swap program.  AmmRateT1 ∶= AmmWalletT1 AmmWalletT2 ;</p><p>T ∶= 'NULL' 8:</p><p>else if (T = 'T2') then 9:</p><p>AmmRateT2 ∶= AmmWalletT2 AmmWalletT1 ; T ∶= 'NULL' The Swap program enables token exchange based on the constant product K. The swapping operation is governed by the values of AmountToSwap and TokenToSwap specified by the sender. If the sender chooses to exchange AmountToSwap of token T1 for token T2, the program initially computes the corresponding amount required for AmountToSwap in T2. Subsequently, it verifies whether AmmWalletT2 holds adequate tokens to satisfy this amount. If it does, the program increases AmmWalletT1 by the specified AmountToSwap and decreases AmmWalletT2 accordingly to maintain the constant stored in the variable K. The same process occurs vice-versa if the sender chooses to swap T2 for T1. We posit the existence of a program, ZeroAMM, which is presumed to initialize the AmountToSwap and TokenToSwap variables to zero. AmmWalletT2 ∶= AmmWalletT2 + AmountToSwap; </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>ZeroAMM</head><p>As far as the levels of the variables are concerned, since AmmRateT1 and AmmRateT2 have to be high level, in order to ensure that the program Swap satisfies the unwinding condition, the variable Y has to be high too (see line 7). This in turn implies that AmmWalletT1 and AmmWalletT2 have to be high (see lines <ref type="bibr" target="#b7">8,</ref><ref type="bibr" target="#b8">9,</ref><ref type="bibr" target="#b15">16,</ref><ref type="bibr" target="#b16">17)</ref>. Finally, this requires to the variable K to be high (see line 5).</p><p>We already observed that line 5 of the Win program causes a flow of information witnessing a possible MEV attack. Now that we possess a deeper understanding of the AMM contract, we can demonstrate the interference resulting from the interaction with the AMM contract, utilizing the LTS notation outlined in Section 2.1. Specifically, we will show how two executions of the same program starting with the same low level variable values can end with different values for the low level variable BetWallet. Let us consider the program:</p><formula xml:id="formula_10">Bet+Amm ≡ co Bet_Contract | | Amm_Contract oc</formula><p>In particular, let us assume that we have reached the execution of:</p><formula xml:id="formula_11">co (co Bet | | Win | | Close oc) | | Amm_Contract oc</formula><p>Moreover, the Player has been set to 'BOB'and he has already added his PotBet to the BetWallet. In this context, we designate the T1 token held within the AMM contract to represent Ethereum's native cryptocurrency, Ether. Thus, we denote AmmWalletT1 as AmmWalletEther and AmmRateT1 as AmmRateEther. We focus on a state 𝜎 in which the variables have the following values: AmmWalletEther = 600; AmmWalletT2 = 600; AmmRateEther = 1 AmountToSwap = 300; TokenToSwap=T2 BetWallet = 10; BetRate = 2; SenderWin = 'BOB' If the execution sequence begins with the code of the Swap program, followed by GetRate, which are part of the Amm_Contract, and concludes with the selection of Win, the resulting outcome is as These two executions result in a distinct value for the low level variable BetWallet, indicating a potential MEV attack. In fact, in the second execution the variable BetWallet has not been modified and reaches the end with value 10. Notice that we are not delving into the specific identities of the player and the user initiating the Swap. Nor we are assuming their ability to influence the scheduling order. We are simply observing two different low-level behaviors. Further analysis is required to ascertain the potential transformation of the first execution into a MEV attack. Naturally, if the player of the Bet contract also interacts with the AMM and possesses the authority to dictate transaction order as a miner, they can ensure a favorable outcome, thereby enabling the occurrence of a MEV attack, as highlighted in <ref type="bibr" target="#b17">[18]</ref>.</p><p>Let us now examine the scenario where we leverage the Exchange contract instead of relying on the AMM contract. In this case only the owner has the authority to modify the rate. Below, we model the pivotal functionality of the Exchange contract, wherein the rate is altered. SenderSetRate ∶= 'NULL' Let us modify the Win program at line 5 by replacing the variable AmmRateEther with the variable ExchangeRate. Our analysis on the Bet contract is not affected. We still observe that the unwinding condition is not satisfied witnessing a possible MEV attack. However, in this very simple example one can assume that when the player in the Bet contract is different from the owner of the Exchange contract, the player cannot be sure to win the bet. So, we can exploit the downgrading mechanism and modify the Win program as follows. Player ∶= 'NULL' In this specific scenario, the noninterference property remains unscathed when utilizing the Exchange contract as a price oracle, given that the adversary lacks the ability to manipulate the exchange rate. With the Exchange contract, only the owner holds the authority to adjust the exchange rate, rendering any attempts by adversaries to influence the exchange contract ineffective in altering the rate. However, it is essential to recognize that within this framework, there exists a potential information flow through interactions with the Exchange contract, particularly when the owner of the Exchange contract coincides with the owner or player of the Bet contract. This introduces the possibility of interference. However, interference does not arise when the player in the Bet contract differs from the owner of the Exchange contract. To differentiate this secure scenario from the potentially risky one described earlier, we rely on the Downgrading functionality embedded in our language.</p><p>The code implementation for this example encompasses smart contracts for Bet, AMM, and Eexchange functionalities. Furthermore, we've developed a USDC ERC20 token to enable a hands-on exchange experience with our custom token. The complete implementation in solidity can be found on GitHub via the following link: code repository.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head n="4.">Conclusion</head><p>In this paper, we explore the application of unwinding conditions to analyze Maximal Extractable Value (MEV) within the context of the Bet contract. Our investigation utilizes a simple imperative concurrent language to model the Bet contract, shedding light on scenarios where specific conditions impact MEV noninterference. This underscores potential vulnerabilities within decentralized finance (DeFi) services. This is a first step, while an in depth analysis of the relationships between unwinding conditions and MEV is left as future work.</p><p>Comparing our approach with the contribution of Bartoletti et al. in <ref type="bibr" target="#b17">[18]</ref> (see also Appendix B), our focus lies in formalizing noninterference through unwinding conditions. By employing unwinding conditions, we abstract from the environment, enabling us to disregard the specific implementations of possible smart contracts interacting with the one under examination, unlike in <ref type="bibr" target="#b17">[18]</ref>. Clearly this is an advantage from the computational point of view, since it allows us to analyse smaller system. Moreover, this approach facilitates the identification of critical points within the program that may lead to information flows, thereby enhancing the security analysis of smart contracts. On the other side, a second stage analysis of the dependencies is necessary in order to discard unrealistic sources of attacks.</p><p>Furthermore, the Bet contract case study presented in this paper illustrates the practical application of our methodology in identifying and mitigating MEV attacks. Overall, our work contributes to the comprehension and mitigation of MEV vulnerabilities in smart contracts within the realm of decentralized finance. As future work we also plan to apply our framework.</p><p>As future work we also plan to define our framework on fragments of languages for smart contracts, such as solidity, in order to avoid possible discrepancies introduced relying on an intermediate language. This is a difficult task due to the richness of languages for smart contracts. However, object oriented features would avoid us the use of programming tricks, such as the use of the away operator, for avoiding unwanted interleaving behaviors. </p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>A. Operational Semantics</head></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Table 1</head><p>The operational semantics.</p></div>
<div xmlns="http://www.tei-c.org/ns/1.0"><head>B. MEV and Local MEV in [18]</head><p>In <ref type="bibr" target="#b17">[18]</ref>, the author delineates two notions of MEV. The first, termed global MEV, relies on the entire blockchain state 𝑆 to determine the value of MEV extracted from a contract Δ. This criterion introduced by Babel et al. in <ref type="bibr" target="#b16">[17]</ref>, referred to as 𝜀-composability, asserts that contracts Δ are composable in a blockchain state 𝑆 if adding Δ to 𝑆 does not afford the adversary a "significantly higher" Maximal Extractable Value (MEV). Formally, denoting by MEV(𝑆) the maximal value adversaries can extract from 𝑆, and with 𝑆|Δ representing the blockchain state 𝑆 extended with contracts Δ, the composability criterion of Babel et al. is expressed as:</p><formula xml:id="formula_12">Δ is 𝜀-composable in 𝑆 if MEV (𝑆|Δ) ≤ (1 + 𝜀) MEV (𝑆)<label>(1)</label></formula><p>where 𝜀 parameterizes the "not significantly higher" condition above. However, this approach has limitations as elucidated in <ref type="bibr" target="#b17">[18]</ref>. For instance, utilizing the MEV of the entire state S as a baseline for comparison complicates the interpretation of the concrete security guarantee of ε-composability.</p><p>The second notion of MEV, introduced by Bartoletti et al., is Local MEV, termed MEV non-interference. This concept measures the maximal economic loss that adversaries can induce on a given set of contracts, unlike global MEV, which applies solely to the entire blockchain state. By adapting the definition of non-interference property to the DeFi setting, they stipulate that the MEV extractable from Δ (the public output) should remain unaffected by the dependencies of Δ (the private inputs). Formally, MEV non-interference holds when the MEV extractable from the contract accounts in Δ(i.e., †∆) using any contract in S | ∆ is exactly the same MEV that can be extracted using only the contracts in ∆. They introduce the following definition: </p></div><figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_0"><head>Figure 1 :</head><label>1</label><figDesc>Figure 1: MEV Insight: Navigating Bet Connections</figDesc><graphic coords="3,119.39,65.61,356.51,292.44" type="bitmap" /></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_1"><head>Figure 2 :</head><label>2</label><figDesc>Figure 2: A pictorial representation of the unwinding condition 𝒲 (= 𝑙 , ⇝, ≈ 𝑙 ).</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_2"><head>1: Program Constructor 2 : 1 :</head><label>21</label><figDesc>await ( InitialPot ≠0 ∧ BetRate ≠0 ∧ Deadline ≠0 ∧ Oracle ≠0 ∧ Token ≠0) do ≠ 'Ether' ∧ OracleGetToken = ('Ether' , Token) ) then continuously runs until the deadline set by the Bet_Contract owner in the variable Deadline is expired. It waits for the Player to be 'NULL' and for PotBet to be non zero. The condition for Player to be 'NULL' ensures that another user is not already placing a bet. Additionally, PotBet must be non-zero, indicating that the Player program has initialized the variables PotBet and SenderBet. If the PotBet is valid, the program updates the variables Player, PlayerWalletEther, and BetWallet. Program Bet 2: while (Deadline &gt; BlockNum) do 3: await (Player = 'NULL' ∧ PotBet ≠0 ) do 4:</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_9"><head></head><label></label><figDesc>else if (TokenToSwap = 'T2' ) then 15:Y ∶= AmountToSwap * AmmRateT1;16:    if (Y &lt; AmmWalletT1) then 17:</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_12"><head>2 ⇝</head><label>2</label><figDesc>⟩→ true ⟨if(𝑏) {𝑃 0 } else {𝑃 1 }, 𝜎 ⟩ 𝜖 → ⟨𝑃 0 , 𝜎 ⟩ 𝑏 ∈ 𝜖 ⟨𝑏, 𝜎 ⟩→ false ⟨if(𝑏) {𝑃 0 } else {𝑃 1 }, 𝜎 ⟩ 𝜖 → ⟨𝑃 1 , 𝜎 ⟩ 𝑏 ∈ 𝜖 ⟨𝑏, 𝜎 ⟩→ true ⟨while(𝑏) {𝑃}, 𝜎 ⟩ 𝜖 → ⟨𝑃; while(𝑏) {𝑃}, 𝜎 ⟩ 𝑏 ∈ 𝜖 ⟨𝑏, 𝜎 ⟩→ false ⟨while(𝑏) {𝑃}, 𝜎 ⟩ 𝜖 → ⟨end, 𝜎 ⟩ 𝑏 ∈ 𝜖 ⟨𝑏, 𝜎 ⟩→ true ⟨𝑆, 𝜎 ⟩ 𝜖 ′ ⟩ ⟨co 𝑃 1 | | … | |𝑃 𝑖 | | … | |𝑃 𝑛 oc, 𝜎 ⟩ 𝜖 → ⟨co 𝑃 1 | | … | |𝑃 ′ 𝑖 | | … | |𝑃 𝑛 oc, 𝜎 ′ ⟩ ⟨co end| | … | |end| | … | |end oc, 𝜎 ⟩ low → ⟨end, 𝜎 ⟩</figDesc></figure>
<figure xmlns="http://www.tei-c.org/ns/1.0" xml:id="fig_13"><head>Definition 3 .</head><label>3</label><figDesc>(MEV non-interference). A state 𝑆 is MEV non-interfering with Δ, when MEV(𝑆|Δ, †Δ) = MEV † Δ (𝑆|Δ, †Δ).</figDesc></figure>
		</body>
		<back>

			<div type="acknowledgement">
<div xmlns="http://www.tei-c.org/ns/1.0"><head>Acknowledgments</head><p>This work has been partially supported by the Project PRIN 2020 "Nirvana -Noninterference and Reversibility Analysis in Private Blockchains", and by the project SERICS (PE00000014) under the MUR National Recovery and Resilience Plan funded by the European Union -NextGenerationEU.</p></div>
			</div>

			<div type="references">

				<listBibl>

<biblStruct xml:id="b0">
	<monogr>
		<ptr target="https://ethereum.org/en/defi/#what-is-defi" />
		<title level="m">-is-defi?</title>
				<imprint>
			<date type="published" when="2024-01-13">2024. jan 13, 2024</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b1">
	<analytic>
		<title level="a" type="main">Defi protocols for loanable funds: Interest rates, liquidity and market efficiency</title>
		<author>
			<persName><forename type="first">L</forename><surname>Gudgeon</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Werner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Perez</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><forename type="middle">J</forename><surname>Knottenbelt</surname></persName>
		</author>
		<idno type="DOI">10.1145/3419614.3423254</idno>
	</analytic>
	<monogr>
		<title level="m">AFT &apos;20: 2nd ACM Conference on Advances in Financial Technologies</title>
				<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2020">2020</date>
			<biblScope unit="page" from="92" to="112" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b2">
	<analytic>
		<title level="a" type="main">Sok: Decentralized finance (defi)</title>
		<author>
			<persName><forename type="first">S</forename><surname>Werner</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Perez</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Gudgeon</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Klages-Mundt</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Harz</surname></persName>
		</author>
		<author>
			<persName><forename type="first">W</forename><forename type="middle">J</forename><surname>Knottenbelt</surname></persName>
		</author>
		<idno type="DOI">10.1145/3558535.3559780</idno>
	</analytic>
	<monogr>
		<title level="m">Proceedings of the 4th ACM Conference on Advances in Financial Technologies</title>
				<meeting>the 4th ACM Conference on Advances in Financial Technologies<address><addrLine>AFT</addrLine></address></meeting>
		<imprint>
			<publisher>ACM</publisher>
			<date type="published" when="2022">2022. 2022</date>
			<biblScope unit="page" from="30" to="46" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b3">
	<analytic>
		<title level="a" type="main">Decentralized exchanges (DEX) with automated market maker (AMM) protocols</title>
		<author>
			<persName><forename type="first">J</forename><surname>Xu</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Paruch</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Cousaert</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Feng</surname></persName>
		</author>
		<author>
			<persName><surname>Sok</surname></persName>
		</author>
		<idno type="DOI">10.1145/3570639</idno>
	</analytic>
	<monogr>
		<title level="j">ACM Comput. Surv</title>
		<imprint>
			<biblScope unit="volume">55</biblScope>
			<biblScope unit="page">50</biblScope>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b4">
	<analytic>
		<title level="a" type="main">A systematic investigation of defi compositions in ethereum</title>
		<author>
			<persName><forename type="first">S</forename><surname>Kitzler</surname></persName>
		</author>
		<author>
			<persName><forename type="first">F</forename><surname>Victor</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Saggese</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Haslhofer</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-031-32415-4_18</idno>
	</analytic>
	<monogr>
		<title level="m">Financial Cryptography and Data Security. FC 2022 International Workshops -CoDecFin, DeFi, Voting, WTSC</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2022">2022</date>
			<biblScope unit="volume">13412</biblScope>
			<biblScope unit="page" from="272" to="279" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b5">
	<analytic>
		<title level="a" type="main">Sok: Decentralized finance (defi) attacks</title>
		<author>
			<persName><forename type="first">L</forename><surname>Zhou</surname></persName>
		</author>
		<author>
			<persName><forename type="first">X</forename><surname>Xiong</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Ernstberger</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Chaliasos</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Z</forename><surname>Wang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Wang</surname></persName>
		</author>
		<author>
			<persName><forename type="first">K</forename><surname>Qin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Wattenhofer</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Song</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Gervais</surname></persName>
		</author>
		<idno type="DOI">10.1109/SP46215.2023.10179435</idno>
	</analytic>
	<monogr>
		<title level="m">44th IEEE Symposium on Security and Privacy, SP 2023</title>
				<imprint>
			<publisher>IEEE</publisher>
			<date type="published" when="2023">2023</date>
			<biblScope unit="page" from="2444" to="2461" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b6">
	<analytic>
		<title level="a" type="main">Flash boys 2.0: Frontrunning in decentralized exchanges, miner extractable value, and consensus instability</title>
		<author>
			<persName><forename type="first">P</forename><surname>Daian</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Goldfeder</surname></persName>
		</author>
		<author>
			<persName><forename type="first">T</forename><surname>Kell</surname></persName>
		</author>
		<author>
			<persName><forename type="first">Y</forename><surname>Li</surname></persName>
		</author>
		<author>
			<persName><forename type="first">X</forename><surname>Zhao</surname></persName>
		</author>
		<author>
			<persName><forename type="first">I</forename><surname>Bentov</surname></persName>
		</author>
		<author>
			<persName><forename type="first">L</forename><surname>Breidenbach</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Juels</surname></persName>
		</author>
		<idno type="DOI">10.1109/SP40000.2020.00040</idno>
	</analytic>
	<monogr>
		<title level="m">2020 IEEE Symposium on Security and Privacy, SP 2020</title>
				<imprint>
			<publisher>IEEE</publisher>
			<date type="published" when="2020">2020</date>
			<biblScope unit="page" from="910" to="927" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b7">
	<analytic>
		<title level="a" type="main">Front-running dynamics</title>
		<author>
			<persName><forename type="first">D</forename><surname>Bernhardt</surname></persName>
		</author>
		<author>
			<persName><forename type="first">B</forename><surname>Taub</surname></persName>
		</author>
		<idno type="DOI">10.1016/J.JET.2007.05.005</idno>
	</analytic>
	<monogr>
		<title level="j">J. Econ. Theory</title>
		<imprint>
			<biblScope unit="volume">138</biblScope>
			<biblScope unit="page" from="288" to="296" />
			<date type="published" when="2008">2008</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b8">
	<analytic>
		<title level="a" type="main">Towards understanding and characterizing the arbitrage bot scam in the wild</title>
		<author>
			<persName><forename type="first">K</forename><surname>Li</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Guan</surname></persName>
		</author>
		<author>
			<persName><forename type="first">D</forename><surname>Lee</surname></persName>
		</author>
		<idno type="DOI">10.1145/3626783</idno>
	</analytic>
	<monogr>
		<title level="j">Proc. ACM Meas. Anal. Comput. Syst</title>
		<imprint>
			<biblScope unit="volume">7</biblScope>
			<biblScope unit="page">29</biblScope>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b9">
	<analytic>
		<title level="a" type="main">Security policies and security models</title>
		<author>
			<persName><forename type="first">J</forename><forename type="middle">A</forename><surname>Goguen</surname></persName>
		</author>
		<author>
			<persName><forename type="first">J</forename><surname>Meseguer</surname></persName>
		</author>
		<idno type="DOI">10.1109/SP.1982.10014</idno>
	</analytic>
	<monogr>
		<title level="m">1982 IEEE Symposium on Security and Privacy</title>
				<imprint>
			<publisher>IEEE Computer Society</publisher>
			<date type="published" when="1982">1982. 1982</date>
			<biblScope unit="page" from="11" to="20" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b10">
	<analytic>
		<title level="a" type="main">Information flow security in dynamic contexts</title>
		<author>
			<persName><forename type="first">R</forename><surname>Focardi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.3233/JCS-2006-14103</idno>
	</analytic>
	<monogr>
		<title level="j">J. Comput. Secur</title>
		<imprint>
			<biblScope unit="volume">14</biblScope>
			<biblScope unit="page" from="65" to="110" />
			<date type="published" when="2006">2006</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b11">
	<analytic>
		<title level="a" type="main">Controlling information release in the pi-calculus</title>
		<author>
			<persName><forename type="first">S</forename><surname>Crafa</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.1016/J.IC.2007.01.001</idno>
	</analytic>
	<monogr>
		<title level="j">Inf. Comput</title>
		<imprint>
			<biblScope unit="volume">205</biblScope>
			<biblScope unit="page" from="1235" to="1273" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b12">
	<analytic>
		<title level="a" type="main">Persistent stochastic non-interference</title>
		<author>
			<persName><forename type="first">J</forename><surname>Hillston</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Marin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.3233/FI-2021-2049</idno>
	</analytic>
	<monogr>
		<title level="j">Fundam. Informaticae</title>
		<imprint>
			<biblScope unit="volume">181</biblScope>
			<biblScope unit="page" from="1" to="35" />
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b13">
	<analytic>
		<title level="a" type="main">Unwinding conditions for security in imperative languages</title>
		<author>
			<persName><forename type="first">A</forename><surname>Bossi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.1007/11506676_6</idno>
	</analytic>
	<monogr>
		<title level="m">Logic Based Program Synthesis and Transformation, 14th International Symposium, LOPSTR 2004</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2004">2004</date>
			<biblScope unit="volume">3573</biblScope>
			<biblScope unit="page" from="85" to="100" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b14">
	<analytic>
		<title level="a" type="main">Verifying persistent security properties</title>
		<author>
			<persName><forename type="first">A</forename><surname>Bossi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Focardi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.1016/J.CL.2004.02.005</idno>
	</analytic>
	<monogr>
		<title level="j">Comput. Lang. Syst. Struct</title>
		<imprint>
			<biblScope unit="volume">30</biblScope>
			<biblScope unit="page" from="231" to="258" />
			<date type="published" when="2004">2004</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b15">
	<analytic>
		<title level="a" type="main">Compositional information flow security for concurrent programs</title>
		<author>
			<persName><forename type="first">A</forename><surname>Bossi</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.3233/JCS-2007-15303</idno>
	</analytic>
	<monogr>
		<title level="j">J. Comput. Secur</title>
		<imprint>
			<biblScope unit="volume">15</biblScope>
			<biblScope unit="page" from="373" to="416" />
			<date type="published" when="2007">2007</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b16">
	<analytic>
		<title level="a" type="main">Clockwork finance: Automated analysis of economic security in smart contracts</title>
		<author>
			<persName><forename type="first">K</forename><surname>Babel</surname></persName>
		</author>
		<author>
			<persName><forename type="first">P</forename><surname>Daian</surname></persName>
		</author>
		<author>
			<persName><forename type="first">M</forename><surname>Kelkar</surname></persName>
		</author>
		<author>
			<persName><forename type="first">A</forename><surname>Juels</surname></persName>
		</author>
		<idno type="DOI">10.1109/SP46215.2023.10179346</idno>
	</analytic>
	<monogr>
		<title level="m">44th IEEE Symposium on Security and Privacy, SP 2023</title>
				<imprint>
			<publisher>IEEE</publisher>
			<date type="published" when="2023">2023</date>
			<biblScope unit="page" from="2499" to="2516" />
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b17">
	<monogr>
		<title level="m" type="main">Defi composability as MEV non-interference</title>
		<author>
			<persName><forename type="first">M</forename><surname>Bartoletti</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Marchesin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">R</forename><surname>Zunino</surname></persName>
		</author>
		<idno type="DOI">10.48550/ARXIV.2309.10781</idno>
		<imprint>
			<date type="published" when="2023">2023</date>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b18">
	<monogr>
		<title level="m" type="main">Foundations of Multithreaded, Parallel, and Distributed Programming</title>
		<author>
			<persName><forename type="first">G</forename><forename type="middle">R</forename><surname>Andrews</surname></persName>
		</author>
		<imprint>
			<date type="published" when="2000">2000</date>
			<publisher>Addison-Wesley</publisher>
		</imprint>
	</monogr>
</biblStruct>

<biblStruct xml:id="b19">
	<analytic>
		<title level="a" type="main">Proportional lumpability</title>
		<author>
			<persName><forename type="first">A</forename><surname>Marin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.1007/978-3-030-29662-9_16</idno>
	</analytic>
	<monogr>
		<title level="m">Formal Modeling and Analysis of Timed Systems -17th International Conference, FORMATS 2019</title>
		<title level="s">Lecture Notes in Computer Science</title>
		<editor>
			<persName><forename type="first">É</forename><surname>André</surname></persName>
		</editor>
		<editor>
			<persName><forename type="first">M</forename><surname>Stoelinga</surname></persName>
		</editor>
		<meeting><address><addrLine>Amsterdam, The Netherlands</addrLine></address></meeting>
		<imprint>
			<publisher>Springer</publisher>
			<date type="published" when="2019">August 27-29, 2019. 2019</date>
			<biblScope unit="volume">11750</biblScope>
			<biblScope unit="page" from="265" to="281" />
		</imprint>
	</monogr>
	<note>Proceedings</note>
</biblStruct>

<biblStruct xml:id="b20">
	<analytic>
		<title level="a" type="main">D_PSNI : Delimited persistent stochastic non-interference</title>
		<author>
			<persName><forename type="first">A</forename><surname>Marin</surname></persName>
		</author>
		<author>
			<persName><forename type="first">C</forename><surname>Piazza</surname></persName>
		</author>
		<author>
			<persName><forename type="first">S</forename><surname>Rossi</surname></persName>
		</author>
		<idno type="DOI">10.1016/J.TCS.2021.08.007</idno>
	</analytic>
	<monogr>
		<title level="j">Theor. Comput. Sci</title>
		<imprint>
			<biblScope unit="volume">884</biblScope>
			<biblScope unit="page" from="116" to="135" />
			<date type="published" when="2021">2021</date>
		</imprint>
	</monogr>
</biblStruct>

				</listBibl>
			</div>
		</back>
	</text>
</TEI>
