Research
Uma Prova de Conceito para a Verificação Formal de Contratos Inteligentes
Smart contracts execute automatically and cannot easily be patched after deployment, so any logical flaw in the code is effectively permanent. The authors argue that a verification layer is needed…

- arXiv
- 2601.14427
- Published
- 2026-01-20
- Authors
- Murilo de Souza Neves, Adilson Luiz Bonifacio
AI summary
Overview
Research area: Blockchain security and formal methods — specifically, formal specification and verification of smart contracts using deontic logic.
Technical level: Intermediate. Readers should be comfortable with blockchain/smart contract basics (Ethereum, Solidity, immutability) and with the idea of writing contract clauses in a formal logic; no prior knowledge of RCL or RECALL is assumed, since the paper introduces both.
Scope: A single-case proof of concept in which a four-party purchase-and-sale contract is specified in the Relativized Contract Language (RCL), checked for normative conflicts with the RECALL tool, then hand-translated into Solidity and executed in the Remix IDE environment.
What This Paper Is About
Smart contracts execute automatically and cannot easily be patched after deployment, so any logical flaw in the code is effectively permanent. The authors argue that a verification layer is needed before code is written. They test this idea by describing a multi-party purchase-and-sale agreement in RCL — a logic that assigns each obligation to a specific responsible party and counterparty — running it through the RECALL conflict detector, and then translating the verified specification into Solidity.
Key Contributions
-
A worked RCL specification of a multilateral commercial contract. The paper formalizes a purchase-and-sale scenario with four participants — buyer (
b), seller (s), bank (k) and carrier (c) — covering twelve clauses, including internal rules of the bank and of the carrier. -
Demonstration that RECALL catches a real design flaw at the modeling stage. The original specification is rejected by the tool, which reports a conflict involving the clauses
{c,b}(deliverProduct)and{c,b}O(deliverProduct), arising from the carrier's internal rule requiring shipping costs to be paid before delivery. -
A verified correction. The authors add a clause requiring the bank to notify the carrier of the shipping payment (clause 5) and rewrite the carrier's internal rule (clause 12); the revised RCL contract is re-submitted to RECALL and returns free of conflicts.
-
An ad-hoc RCL-to-Solidity translation and functional test. The paper shows how deontic clauses map to Solidity functions,
addressvariables, state enums, modifiers and boolean flags, and executes the resulting contract in Remix IDE — first showing the conflicting version deadlocking, then the corrected version.
Main Findings
-
The conflict is detected before any code exists. RECALL flagged the incompatibility between the carrier's internal rule (no delivery until the seller has paid shipping) and the rest of the contract (which expects delivery to occur before the bank releases shipping payment). The paper notes the rule was also inconsistent about who pays the carrier — the seller paid the bank, not the carrier.
-
The conflicting Solidity contract locks up, as predicted. In Remix IDE, after deployment with the four participants' addresses plus a product amount and a shipping amount, the sequence
buyProduct→payProduct→notifyProductPayment→sendProduct+payShippingCosts→deliverProductfails at the last step with the error "Frete não foi pago pelo vendedor a transportadora" (shipping was not paid by the seller to the carrier). Execution halts in theProductDelivered-preceding state and cannot proceed. -
Relativization maps cleanly onto Solidity modifiers. The RCL principle that each action has a designated responsible party is implemented through the modifiers
onlyB,onlyS,onlyKandonlyC, which comparemsg.senderagainst the stored participant addresses withrequire. -
The fix in code is structural, not cosmetic. In the corrected Solidity contract the variable
paymentRealeasedCarrierSelleris renamed toshippingPaymentNotified, and a new functionnotifyShippingPaymentToCarrieris added, executed after the seller pays shipping costs to the bank and before the product is sent — mirroring RCL clause{k,c}O(notifyShippingPayment). -
Six control states model the contract's flow. The Solidity contract uses the enum states
Created,ProductBought,ProductPaid,PaymentNotified,ProductDeliveredandFinalized, with concurrent branches (sending the product vs. paying shipping) tracked by boolean flags. -
Not reported: the paper, in the content available, presents no quantitative metrics, no benchmark comparison, no dataset, no gas measurements, and no evaluation across multiple contracts. The evidence base is a single case study, and the translation from RCL to Solidity is described as manual and ad-hoc rather than automated.
Methodology in Plain English
The authors start from an existing textbook-style scenario: a buyer purchases a product, a bank handles the money, a seller ships via a carrier, and the carrier has its own internal policy. They write that scenario down in RCL, a formal language where each clause names both the party responsible for an action and the party it is directed at — something the older Contract Language (CL) cannot do, which is the stated motivation for using RCL.
They then feed the specification to RECALL, a tool that searches for normative conflicts — situations where one clause obliges something another clause forbids or blocks. RECALL reports a conflict; the authors diagnose it in prose, edit the offending clause and the carrier's internal rule, and re-run the tool, which now reports no conflicts.
With a conflict-free specification in hand, they translate it by hand into Solidity: each clause becomes a function, each participant becomes an address variable, obligations become functions gated by sender-checking modifiers and a state machine, and internal rules become require guards. Finally they deploy and drive the contract through Remix IDE, an Ethereum simulator, to check that the behavior matches the logic — first for the flawed version (which halts) and then for the corrected version.
Why This Matters
The paper's core claim is that catching a logical flaw in a formal specification is cheaper and safer than catching it in deployed bytecode, because deployed smart contracts are immutable and corrections require deploying an entirely new contract at additional cost.
Impact on research: It provides a concrete, reproducible bridge between deontic-logic contract languages and an executable smart-contract language, and it makes explicit the gap — and the information loss — between RCL and Solidity, which the authors flag as motivation for a systematic, multi-stage transformation rather than hand translation.
Real-world applications:
- Supply chain and escrow arrangements, where a buyer, seller, financial intermediary and logistics provider each hold distinct obligations — exactly the four-role structure modeled here.
- Marketplace and e-commerce platforms that need to guarantee delivery-before-payment-release ordering without a trusted human arbiter.
- Financial settlement contracts where a bank or payment processor must release funds only after specific notifications are received.
- Audit and compliance workflows, where a pre-deployment proof of conflict-freedom can be attached to a contract as evidence of due diligence.
Industry relevance: Smart contract audits today are largely manual code review. A workflow that starts from a machine-checkable specification and only then produces code offers auditors and development teams an earlier, cheaper checkpoint — particularly valuable for multi-party agreements, where responsibility attribution is the part most likely to be ambiguous in natural-language requirements.
Future Directions
-
Automating the RCL-to-Solidity transformation. The paper explicitly performs the translation manually and ad-hoc, and identifies the expressiveness gap between the two languages as an open problem; a systematic, multi-stage transformation preserving the RCL contract's properties is the natural next step.
-
Quantifying information loss in translation. The authors state that their study enables analysis of the challenges and potential information losses that affect the transformation, but the available content does not report such a measurement — a structured study of what survives translation and what must be re-verified in code would close this loop.
-
Scaling beyond one case study. The evidence rests on a single four-party purchase-and-sale contract; applying the pipeline to a corpus of contracts with varying participant counts and rule types would test whether RECALL-based pre-verification generalizes.
-
Closing the loop from code back to specification. Since the Solidity contract is only checked functionally in Remix IDE by executing a happy path plus one failure, verifying that the deployed bytecode actually refines the RCL specification — rather than merely appearing to behave correctly in a simulation — remains an open question.
Target Audience
Best suited to blockchain security researchers and smart contract auditors interested in formal methods; graduate students in computer science working on deontic logic applied to e-contracts; and development teams building multi-party agreements on Ethereum who want an early, specification-level check before committing to immutable code. Readers seeking quantitative evaluation, tool comparisons or automated pipelines will find this paper is a proof of concept rather than an empirical study.
Authors’ abstract
Smart contracts are tools with self-execution capabilities that provide enhanced security compared to traditional contracts; however, their immutability makes post-deployment fault correction extremely complex, highlighting the need for a verification layer prior to this stage. Although formalisms such as Contract Language (CL) enable logical analyses, they prove limited in attributing responsibilities within complex multilateral scenarios. This work presents a proof of…
The full abstract on arXiv