Skip to main content
QUICK REVIEW

[Paper Review] On the specification and verification of atomic swap smart contracts

Ron van der Meyden|arXiv (Cornell University)|Nov 14, 2018
Logic, Reasoning, and KnowledgeComputer Science3 references11 citations
TL;DR

This paper presents a formal specification and verification framework for atomic swap smart contracts using temporal logic model checking, demonstrating that strategic logic constructs—while conceptually useful—are not strictly necessary for verifying concrete implementations. The key contribution is a practical methodology to ensure correctness of on-chain and cross-chain atomic swaps through automated model checking, with verified properties including atomicity, fairness, and asset integrity.

ABSTRACT

Blockchain systems and smart contracts provide ways to securely implement multi-party transactions without the use of trusted intermediaries, which currently underpin many commercial transactions. However, they do so by transferring trust to computer systems, raising the question of whether code can be trusted. Experience with high value losses resulting from incorrect code has already shown that formal verification of smart contracts is likely to be beneficial. This note investigates the specification and verification of a simple form of multi-party transaction, atomic swaps. It is argued that logics with the ability to express properties of strategies of players in a multi-agent setting are conceptually useful for this purpose, although ultimately, for our specific examples, the less expressive setting of temporal logic suffices for verification of concrete implementations. This is illustrated through a number of examples of the use of a model checker to verify atomic swap smart contracts in on-chain and cross-chain settings.

Motivation & Objective

  • To develop a formal specification for atomic swap smart contracts that ensures correctness without trusted intermediaries.
  • To investigate whether strategic logic is necessary for specifying and verifying smart contract behavior.
  • To demonstrate that temporal logic model checking suffices for verifying concrete implementations of atomic swaps.
  • To extend the verification methodology to cross-chain atomic swaps involving different blockchain platforms.
  • To bridge the gap between abstract formal models and executable smart contract code through abstraction and verification.

Proposed method

  • The paper models atomic swap protocols as state transition systems with explicit agent actions and transaction states.
  • It employs temporal logic (LTL) to formally specify desired properties such as atomicity, fairness, and asset ownership transfer.
  • A model checker is used to automatically verify that the implementation satisfies the specification under various execution scenarios.
  • The approach abstracts from low-level blockchain details (e.g., transaction fees, miner behavior) to focus on logical correctness.
  • For cross-chain swaps, the model incorporates inter-chain communication and hash-lock mechanisms using temporal logic assertions.
  • The framework supports verification of both on-chain and cross-chain atomic swaps, with a focus on correctness and absence of race conditions.

Experimental results

Research questions

  • RQ1Can temporal logic model checking verify the correctness of atomic swap smart contracts without relying on strategic logic?
  • RQ2What formal specifications are necessary and sufficient to ensure atomicity and fairness in multi-party digital asset exchanges?
  • RQ3How can cross-chain atomic swaps be formally modeled and verified using temporal logic?
  • RQ4To what extent can strategic logic be replaced by simpler temporal logic in smart contract verification?
  • RQ5How can formal verification be applied to real-world smart contract implementations while preserving security guarantees?

Key findings

  • Temporal logic model checking successfully verifies the correctness of on-chain atomic swap implementations, confirming atomicity and fairness without requiring strategic logic.
  • The use of strategic logic is conceptually helpful for high-level specification but is not essential for verifying concrete implementations.
  • The framework can be extended to cross-chain atomic swaps by modeling inter-chain communication and hash-lock mechanisms using temporal logic.
  • Verification results confirm that assets are transferred atomically and that no party can lose assets without receiving compensation.
  • Frame conditions—specifying which variables may vary—can be implicitly satisfied in the model, though explicit support in temporal logic remains limited.
  • The approach supports abstraction from blockchain-specific details, enabling verification across different smart contract languages and platforms.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.