We present an end-to-end framework for systematic evaluation of LLM-generated smart contracts from natural-language specifications. The system parses contractual text into structured schemas, generates Solidity code, and performs automated quality assessment through compilation and security checks. Using CrewAI-style agent teams with iterative refinement, the pipeline produces structured artifacts with full provenance metadata. Quality is measured across five dimensions, including functional completeness, variable fidelity, state-machine correctness, business-logic fidelity, and code quality aggregated into composite scores. The framework supports paired evaluation against ground-truth implementations, quantifying alignment and identifying systematic error modes such as logic omissions and state transition inconsistencies. This provides a reproducible benchmark for empirical research on smart contract synthesis quality and supports extensions to formal verification and compliance checking.
This thesis explores the doctrinal and practical challenges of applying the principle of party autonomy (lex voluntatis) to smart contracts and transactions governed by Artificial Intelligence (AI). The decentralized and immutable nature of Distributed Ledger Technology (DLT) fundamentally disrupts traditional private international law connecting factors, such as "place of performance" or "habitual residence." The author analyzes how the Rome I Regulation and the Hague Principles on Choice of Law can be adapted to "code-is-law" ecosystems where enforcement is automated and often bypasses state judicial mechanisms. Special attention is paid to the tension between algorithmic execution and "overriding mandatory provisions" (lois de police), questioning whether an AI can recognize and apply mandatory public policy norms that usually override the chosen law. The paper proposes a hybrid regulatory approach "Lex Cryptographia" that embeds choice of law clauses directly into the smart contract's metadata to ensure legal certainty.
Prediction markets aggregate dispersed information into probabilistic forecasts that consistently outperform polls and expert panels, yet their adoption is constrained by a structural liquidity problem: providers of market depth bear adverse selection risk that deters retail participation. We present the Onix Protocol, a hybrid architecture that decouples the pricing function from the settlement function in prediction markets. By pairing automated market maker pricing-a Constant Product Market Maker (CPMM) for binary outcomes and a Logarithmic Market Scoring Rule (LMSR) for multi-outcome markets-with parimutuel (totalizator) settlement, we achieve a structural guarantee that liquidity-provider principal is never at risk from betting outcomes. We formalize the protocol's economic invariants, prove the LP principal guarantee for both market types, describe a "Lazy" liquidity pool enabling passive retail participation, analyze the dispute resolution mechanism under DAO governance, and discuss the experimental hypotheses this system is designed to test. The protocol is implemented as consensus-level operations on the VIZ distributed ledger.
This study quantifies Large Language Models (LLMs) and humanoids as a new labor force and describes the transformation of economic structures brought about by "super-fluid task allocation involving humans," facilitated by tokenized task transactions built on blockchain technology, from the perspective of statistical physics. Furthermore, we devise a constructive approach called "Legal Engineering" and discuss its governance mechanisms. First, we define the price fluctuations of tokenized tasks as "work volatility" and suggest that, within the scope where specific assumptions (existence of information friction, amplification of interactions, and introduction of approximate effective temperature) hold, phase-transition-like behaviors (rapid changes in order similar to bubbles) can occur in the market. Volatility here is interpreted not merely as a statistic but as an operational approximation of "social temperature" that emerges as a result of amplified information friction and interactions. As a governance mechanism to suppress this entropy increase, we propose the "Latent Torus," an information event horizon. The Latent Torus handles internal optimization invisible from the frontend and ensures sustainable social order by recirculating only optimized parameters to smart contracts. Here, by combining quantum optimization with "Semantic Intervention" via "Regulated LLMs," we aim for stabilization based on "semantic depth" rather than apparent liquidity. Furthermore, we propose a "Grand Unified Algorithm" to simultaneously handle economic efficiency (Hamiltonian minimization), humanity (Well-being), and social credit (Proof of Trust) within a single mathematical framework. The scope of this paper is not to advocate for immediate control of society as a whole, but rather to provide a conceptual model for optimizing and auditing trade-offs between indicators in a consistent manner under limited task spaces, participant sets, and operational rules. As a concrete model, we present "Computational Social Contract Theory (CSCT)" and confirm its behavior and limitations under various assumptions through quantitative analysis using multi-agent simulations. Notably, this theory presents a design policy for realizing "verifiable concealment" in governance under certain assumptions (circuitability, computational assumptions, and soundness of key management/operation) using cryptographic techniques such as zero-knowledge proofs (zk-SNARKs). This explores the possibility of hiding the details of internal optimization while maintaining compliance with the Constitutional Core, allowing citizens to verify legitimacy, and examining the operational requirements necessary for such a system. This paper presents a conceptual proposal for institutional design in a post-capitalist society and examines the redesignability of money and law. Note that the quantitative results of this paper are positioned as exploratory simulations and do not directly claim predictive confirmation.
Smart contract vulnerabilities pose risks to decentralized finance (DeFi) ecosystems, with substantial financial losses from exploits. While large language models (LLMs) offer potential for security auditing, evaluation of prompting strategies and different models for vulnerability detection remains limited. We present a prompt engineering framework comparing seven different strategies (P0-P6) from zero-shot baselines to fine-tuned pipelines. Our prompt designs are implementations from high-performing methodologies: SmartGuard, GPTScan, LLM-SmartAudit, and iAudit. The framework supports evaluation across LLMs on the SmartBugs Curated benchmark with precision, recall, and F1 metrics. We provide: (1) a set of seven prompts (P0-P6) ranging from simple single questions to complex multi-agent and fine-tuned approaches, all producing results in the same JSON format for easy comparison; (2) a testing setup that measures how detection accuracy and API costs change as prompts get more complex; (3) open-source code with tools to run and score each prompt type automatically against any labeled smart contract dataset; and (4) a comparative study showing how each strategy performs on the SmartBugs Curated benchmark.
AI agents and institutional automation increasingly require public accountability, while many operational records must remain private due to personal data, trade secrets, contractual terms, security constraints, or audit boundaries. This paper introduces Two-Rail Verification, a public-private evidence-separation kernel for institutional AI and AI-agent governance. The proposed kernel distinguishes between a Public Rail, where public claims, status, version, timestamps, hashes, and verification routes can be placed, and a Private Rail, where raw records, personal data, cost structures, contracts, internal logs, secrets, and unpublished evidence remain protected. The contribution is not a new cryptographic primitive, a certification scheme, or a production assurance claim. Rather, Two-Rail organizes existing concepts such as hashes, signatures, manifests, verification kits, verifiable credentials, selective disclosure, zero-knowledge proofs, transparency logs, audit trails, and assurance reports into an institutional evidence-separation discipline. The kernel is expressed through four minimal requirements: cross-rail write prohibition, verified public claims, a verifiable public surface, and an accountability interface. The paper discusses the public-private evidence problem, adjacent technical and governance concepts, minimal public-surface design, use cases for AI agents and institutional records, and limitations. It does not claim third-party verification, complete signature coverage, legal compliance, safety guarantees, or an effective royalty-free patent pledge. Related patent applications may be pending, but any future patent pledge or license should be published separately with an effective date and stable URL.
Smart contracts are immutable once deployed, making security auditing crucial before deployment. Existing automated tools such as Slither are limited to pattern-matching based detection and cannot reason about the contract’s intended behaviour. Manual expert reviews help address this gap but do not scale to the volume of contracts requiring analysis. Large Language Models (LLMs) offer contextual reasoning capabilities that static analysers lack, but single-pass LLM outputs suffer from high false positive rates and unreliable vulnerability detection. This project proposes and evaluates a multi-agent LLM workflow for automated Solidity smart contract vulnerability detection. The system combines Slither static analysis with a staged reasoning pipeline comprising a context agent, a Retrieval Augmented Generation (RAG)-powered research agent, a two-round specialist debate, a judge synthesis agent, and an automated Foundry test generation and verification loop. Slither is retained to cover syntactically identifiable patterns, while the LLM agents focus on contextual and semantic reasoning that static analysis cannot capture. The workflow was evaluated against a labelled dataset of 360 Solidity contracts across twelve vulnerability categories, using a local model (DeepSeek-Coder-V2:16B) and a frontier model (Claude Sonnet 4.6) as baselines. Results show that the workflow substantially improved the local model's detection capability, nearly quintupling recall and doubling F1 over its one-shot baseline, demonstrating that structured multi-agent reasoning can partially compensate for model scale. However, precision remained low across all configurations and certain vulnerability categories remained difficult to detect. The automated test generation stage gives auditors a working starting point rather than requiring tests to be written from scratch. Overall, the results suggest that LLMs, when structured through a multi-agent workflow, show potential as a triage and scaffolding layer in the auditing process, improving coverage and reducing manual effort. However, they are still insufficient to entirely replace expert review.
This Article proposes a tripartite technical and legal framework designed to restore meaningful copyright enforcement in an era of large-scale generative artificial intelligence. The framework rests on three interlocking pillars. First, it mandates embedding of non-fungible token (NFT) provenance markers in all digitally published creative works, enabling immutable registration of every instance in which data is scraped or ingested by an AI system. Second, it establishes a compulsory labeling regime requiring that all AI-generated outputs carry a blockchain-anchored attestation of their machine origin and the training-data lineage that produced them. Third, it creates a royalty-settlement layer built on a purpose-designed stablecoin that triggers instantaneous, frictionless micropayments to rights holders whenever their content is used in AI training, inference, or downstream reproduction. The Article situates this proposal within the existing doctrinal architecture of U.S. copyright law, international treaty obligations, and emerging AI-governance legislation. It then subjects each pillar to rigorous technical scrutiny—examining blockchain throughput constraints, metadata-embedding standards, privacy-preserving attribution methods, and stablecoin monetary-policy design—before offering a unified statutory and regulatory roadmap for implementation.
Sara Migliorini, Mauro Gambini, Veronica Paternolli, Mila Dalla Preda
In the socio-economic landscape, we can recognize an emerging form of organization: the network coalition. A network coalition is a form of concerted cooperation in which a group of agents decides to collaborate to achieve a common goal. The decentralized and cooperative nature of a network coalition presents new challenges in automating its processes, which cannot be treated as traditional business processes managed by a centralized information system. In the literature, the notion of Exogenous Business Process (XBP) has been introduced to capture such processes. An XBP specification is intended as a potentially incomplete, renegotiable, procedural contract to which different parties adhere in order to achieve a predefined business goal. The concept of Enforceable Business Process (EBP) has been proposed as a possible abstraction for modeling and automating the XBPs of a network coalition. An EBP is essentially an evolution of the original concept of smart contract, which is able to properly manage contractual incompleteness while providing automatic enforceability. The aim of this paper is to formalize the notion of EBP and discuss how contractual incompleteness can be handled by a Decentralized Autonomous Information System (DAIS). The complete formalization of both procedural and incompleteness aspects of EBPs, as provided by this paper, lays the basis for the construction of the next generation of DAIS, as well as the diffusion of network coalition into many application domains, such as supply chains, business alliances, joint ventures, and others.
Abstract As we look to the future, how might decentralized autonomous organizations (DAOs) evolve? And where, beyond corporate law, might we find guidance for the legal questions those evolved DAOs pose? DAOs are, and will increasingly become, instrumentalities of artificial intelligence (AI). DAOs are connected with AI in at least three ways: They are tools for decentralized governance of AI data and models; AI may be used to automate the management and operations of DAOs; and DAOs themselves may function as a form of AI. As such, DAOs inherit the major regulatory and ethical challenges that AI poses, most notably with regard to autonomy. Thus, to consider the future questions DAOs pose and how to address them, we must look to the raging debates over AI regulation, and connect them to the more established themes of corporate law.
The immutable nature of smart contracts necessitates rigorous auditing, especially for ERC compliance, to prevent significant economic losses. While automated tools, particularly those combining Large Language Models (LLMs) with symbolic execution, have improved detection, they often suffer from false positives, false negatives, and insufficient interpretability. This paper introduces SymExplainer, a novel integrated framework designed to overcome these limitations. SymExplainer features an LLM-Enhanced Rule Semantic Extraction Module that deeply understands ERC specifications and misuse patterns using multi-stage prompting and a domain-specific knowledge base. Its Context-Aware Symbolic Execution Engine then efficiently prioritizes exploration paths based on these LLM insights. Crucially, a Violation Verification and Interpretability Generation Module performs secondary LLM-based cross-validation to significantly reduce false positives and produces comprehensive, natural language reports detailing "why," "where," and "how-to-fix" confirmed violations. Evaluated on a ground-truth dataset of 159 expert-annotated ERC violations, SymExplainer achieved perfect recall with zero false negatives and substantially reduced false positives to only 15, outperforming state-of-the-art methods like SymGPT (which reported 29 false positives and 1 false negative). An ablation study confirmed the critical contribution of each module, and qualitative human evaluation validated the high clarity, accuracy, and actionability of its interpretability reports. Despite a modest increase in computational cost, SymExplainer provides a more precise, reliable, and transparent solution for smart contract auditing through unparalleled accuracy, reduced noise, and actionable insights.
Oscar Medina, Brenda Meloni, Ana Strub, Marelo Martín Marciszack
Event patterns are used to model interactions between smart contracts and their environment, improving the efficiency, security, and flexibility of applications based on blockchain technologies. Event pattern-driven smart contract modelling is an emerging trend. Defining a new pattern or selecting a pre-existing one from a limited catalog is a fundamental activity for any analysis model that utilizes event patterns. This study presents a proposal to manage a catalog of event patterns that can be applied to the conceptual modelling of smart contracts and incorporates machine learning techniques to optimize pattern selection. To test this proposal, a prototype application called PatCat (Pattern Catalogue) was developed, using a decentralized electronic voting application as a case study. The incorporation of patterns at the beginning of the modelling process simplifies and clarifies the elicitation of requirements, among other benefits, while the use of machine learning accelerates the description of the problem situation. Consequently, a specialized application for managing a catalog of event patterns, supported by machine learning techniques, proves useful in standardizing and streamlining smart contract modelling tasks.
Abdul Aziz Usman Balarabe, Gilbert I.O. Aimufua, Kene Tochukwu Anyachebelu, Umar Abdullahi
The management of judicial workflow through traditional paper-based and centralized systems presents a wide range of challenges. This is particularly evident in processes such as: case filing, evidence submission, and verdict execution, where inefficiencies, bureaucratic delays, and security vulnerabilities often undermine the credibility of the judiciary. While electronic systems like Case Management Systems (CMS) and Electronic Court Filing (ECF) have been introduced to digitize court operations, they remain largely centralized and therefore susceptible to unauthorized access, data manipulation, and cyberattacks. Numerous scholars have proposed digital and automated solutions for judicial processes; however, existing models often fail to adequately address key challenges of transparency, immutability, and interoperability across jurisdictions. The main objective of this paper is to provide a blockchain-enabled smart contract framework for judicial workflow management that integrates automation, security, and transparency into legal processes. Data flow and use case diagrams were developed to illustrate the core functionalities of the framework, including case registration, evidence management, judicial rulings, and court scheduling. Access to records within the framework is governed by blockchain’s decentralized consensus mechanism, while smart contracts automate routine judicial tasks based on predefined rules. The adoption of this approach is expected to significantly reduce administrative inefficiencies, minimize fraudulent practices, and enhance trust in judicial outcomes.
A revolução tecnológica está transformando profundamente a sociedade, alterando a forma como nos organizamos politicamente e nos inserimos no tempo e no espaço. A introdução de novas tecnologias, no campo das contratações, tem propiciado, no âmbito privado, reflexões importantes sobre a possibilidade de utilizar a inteligência artificial e os smart contracts para resolver problemas como a incompletude contratual e o descumprimento de obrigações. O artigo tem por finalidade descrever como esse processo vem se desenvolvendo e avaliar a possibilidade de incorporar esses novos instrumentos às contratações públicas brasileiras, considerando as regras jurídicas aplicáveis a esse tipo de relação e as particularidades do arranjo institucional nacional.
Thanmai Mandala, Cora Zeger, Tessa E Andersen, Gaby G. Dagher · 5 authors
Blockchain technology is a promising innovation to store information online while being secure and transparent at the same time. Despite the benefits, the immutable nature of blockchain makes it prone to vulnerabilities as any smart contract uploaded onto the blockchain cannot be modified later. Thus, it is imperative to design secure smart contracts during development stages and incorporate effective vulnerability detection mechanisms. Large-Language-Models (LLMs) are a propitious approach to automate vulnerability detection. However, recent attempts at using LLMs to detect vulnerabilities have resulted in high false positive rates and seem prone to obsolescence due to evolving Solidity code. Moreover, existing research often conflate weaknesses with vulnerabilities, despite their apparent differences, and all prior works only focus on vulnerability detection based on broad categories rather than their exact vulnerability identifiers (VIDs). To address these gaps, we propose a novel framework, VulnDetective, of fine-tuned LLM agents and a CWE-VID database to map weaknesses to their corresponding vulnerability, thereby increasing detection accuracy. Our findings show that pre-trained base models struggle significantly with detecting exact vulnerabilities, while VulnDetective shows significant improvement over base models.
The rapid digitization of commercial, governmental, and legal transactions has created an urgent need for efficient, secure, and transparent dispute resolution mechanisms. Traditional arbitration systems often fall short when handling the complexity and volume of digital evidence, smart contracts, and cross-border interactions. This study proposes a novel AI-powered digital arbitration framework that integrates smart contracts, blockchain-based evidence authentication, and explainable artificial intelligence (AI) to automate and modernize the arbitration process. The framework comprises three core layers: (i) a smart contract-based agreement layer that encodes legal terms and self-executing arbitration clauses; (ii) a blockchain-based evidence management layer that ensures the integrity, authenticity, and traceability of submitted evidence; and (iii) an AI-based arbitration engine that classifies, interprets, and evaluates evidence using transformer and LSTM models, supported by SHAP and LIME for interpretability. A controlled experimental setup was implemented using Ethereum and Hyperledger Fabric testnets, with AI models trained on 1,200 annotated arbitration cases. Results demonstrate a 99.5% reduction in arbitration time, a 92.4% agreement rate between AI and expert rulings, and a 99% accuracy in tampering detection. Furthermore, 87.3% of AI-generated decisions were rated as interpretable and acceptable by legal experts. These findings confirm the system's ability to deliver fast, accurate, and explainable arbitration decisions while complying with legal standards. This research contributes a foundational blueprint for deploying autonomous arbitration systems in digital governance, offering scalable solutions for future applications in smart contracts, e-commerce disputes, and algorithmic legal infrastructure.
Eranga Bandara, Sachin Shetty, Ravi Mukkamala, Ross Gore · 12 authors
In recent years, blockchain has experienced widespread adoption across various industries, becoming integral to numerous enterprise applications. Concurrently, the rise of generative AI and LLMs has transformed human-computer interactions, offering advanced capabilities in understanding and generating human-like text. The introduction of the MCP has further enhanced AI integration by standardizing communication between AI systems and external data sources. Despite these advancements, there is still no standardized method for seamlessly integrating LLM applications and blockchain. To address this concern, we propose "MCC: Model Context Contracts" a novel framework that enables LLMs to interact directly with blockchain smart contracts through MCP-like protocol. This integration allows AI agents to invoke blockchain smart contracts, facilitating more dynamic and context-aware interactions between users and blockchain networks. Essentially, it empowers users to interact with blockchain systems and perform transactions using queries in natural language. Within this proposed architecture, blockchain smart contracts can function as intelligent agents capable of recognizing user input in natural language and executing the corresponding transactions. To ensure that the LLM accurately interprets natural language inputs and maps them to the appropriate MCP functions, the LLM was fine-tuned using a custom dataset comprising user inputs paired with their corresponding MCP server functions. This fine-tuning process significantly improved the platform's performance and accuracy. To validate the effectiveness of MCC, we have developed an end-to-end prototype implemented on the Rahasak blockchain with the fine-tuned Llama-4 LLM. To the best of our knowledge, this research represents the first approach to using the concept of Model Context Protocol to integrate LLMs with blockchain.
سازمانهای خودگردان غیرمتمرکز (DAO)، به دلیل ویژگیهایی چون فقدان مدیریت انسانی متمرکز و ساختار فراملی، با مفهوم سنتی شخصیت حقوقی در تضاد ماهوی قرار دارند. پژوهش حاضر از توصیف این بنبست شناختهشده عبور کرده و به یک پرسش راهبردی پاسخ میدهد: نظام حقوقی ایران چگونه میتواند با الهام از مبانی فقهی و تحلیل تطبیقی تجارب نوین جهانی (مانند وایومینگ)، مدلی جدید تحت عنوان «شخصیت حقوقی الگوریتمی» را طراحی و شناسایی کند؟ این تحقیق با روش توصیفی-تحلیلی، پس از اثبات ناکارآمدی چارچوبهای فعلی برای حل بحران مسئولیت و صلاحیت قضایی، به عنوان یافته اصلی، ارکان و الزامات یک مدل مفهومی نوین را ارائه میدهد. این مدل، اهلیت و موجودیت نهاد را نه بر ارکان انسانی، بلکه بر شفافیت کد، قابلیت حسابرسی الگوریتم و معرفی یک عامل ثبتشده استوار میسازد. مقاله همچنین با بررسی تطبیقی رویکردهای جهانی و پاسخگویی به انتقادات کلیدی، اعتبار و کارآمدی مدل پیشنهادی را تقویت مینماید. نتیجهگیری پژوهش آن است که مواجهه کارآمد با DAO مستلزم عبور از راهکارهای اصلاحی و حرکت به سمت قانونگذاری جدید و ویژهای است که این شخصیت حقوقی فناورانه را به رسمیت بشناسد و ضمن فراهم آوردن بستر نوآوری اقتصادی، پاسخگویی حقوقی و قضایی این نهادها را در برابر حاکمیت تضمین نماید.
To address the issues of inefficiency and high debugging costs in smart contract development, this paper proposes a multi-agent collaborative solution based on large language models (LLMs). In this approach, agents collaborate to accomplish tasks such as smart contract generation, auditing, and repair. First, an efficient fine-tuning method is employed to optimize the code generation model. Second, retrieval-augmented generation technology is utilized to provide vulnerability context knowledge for code repair. Finally, a feedback-driven multi-agent collaboration framework is designed to enhance code generation quality through agent-to-agent feedback. During the code repair phase, semantic prompts derived from control flow graphs guide the LLM in contract repair. Experimental results demonstrate that the multi-agent architecture significantly enhances the capabilities of smart contract generation and auditing. By leveraging knowledge of vulnerabilities and external tools, the approach improves the LLM's understanding of smart contract structures. Compared to a single LLM approach, the generated code shows significant improvements in CodeBLEU scores, compilation pass rates, and vulnerability rates.
José Luis Sampietro Saquicela, Leandro Alexander Bermúdez Herrera, Raúl Clemente Ulloa de Souza, Jaime Rafael Bastidas Heredia · 6 authors
Smart contracts are self-executing digital agreements deployed on blockchain platforms, where ensuring security is crucial due to their immutable nature. Understanding token-level semantics plays a key role in identifying potential vulnerabilities in these contracts. However, existing methods often rely on rule-based or syntax-level analysis, which struggle to capture the deeper semantic patterns that lead to complex vulnerabilities. To address these limitations, this study proposes a framework called Fine-Tuning CodeBERT (FTC-BERT), which integrates CodeBERT's pretrained transformer capabilities with task-specific fine-tuning to automatically detect and highlight vulnerabilities in smart contract Integrated Development Environments (IDEs). This method analyzes token-level semantics, enabling precise detection and contextual understanding of vulnerabilities. Developers can use this framework directly within IDEs for real-time vulnerability alerts and suggestions. Experimental results demonstrate that FTC-BERT significantly improves detection accuracy and recall over traditional methods, offering an efficient, automated, and semantic-aware solution for smart contract vulnerability detection.