Swarm Contract: A Multi-Sovereign Agent Consensus Mechanism
Haowei Yang · 2024
Read Swarm Contract: A Multi-Sovereign Agent Consensus Mechanism by Haowei Yang (2024) in the Tower of Babel, a free online library of public-domain works preserved in clean, searchable text. No sign-up. The full text is served as a plain-text file at a predictable URL, where text is present: https://antarctic-labs.com/tower-of-babel/arxiv-2412-19256.txt.
Introduction
Haowei Yang proposed in 2024 a 'swarm contract' in which several autonomous software agents, rather than one blockchain contract, jointly handle complex tasks. Ordinary smart contracts are strong at fixed on-chain logic. They struggle with large off-chain data, multi-step workflows, and tasks needing frequent updates. In Yang's design, independent agents that own their code and assets work inside protected execution environments.
Coordination happens off-chain, with a simple shared wallet on-chain to finalize results. Trust comes from agreement among agents instead of a single contract. Yang illustrates the idea with an off-chain auction selling ten thousand identical digital tokens, where agents jointly find a clearing price and distribute the tokens. Possible uses include decentralized governance and cross-chain coordination.
Catalog record
| CREATOR | Haowei Yang |
|---|---|
| YEAR | 2024 |
| COLLECTION | PAPERS |
| FORMAT | TXT |
| FILE SIZE | 14 KB |
| VERSION | 1.0 |
| LICENSE | http://creativecommons.org/licenses/by/4.0/ |
| RIGHTS | CC BY |
| SOURCE | arXiv |
Source: https://arxiv.org/abs/2412-19256
Browse the full library · About the Tower of Babel
Full text
The opening of the work, from the library's hosted text:
Swarm Contract: A Multi-Sovereign Agent Consensus Mechanism Haowei Yang Abstract Traditional smart contracts on blockchains excel at on-chain, deterministic logic. However, they have inherent limitations when dealing with large-scale off-chain data, dynamic multi-step workflows, and scenarios requiring high flexibility or iterative updates. In this paper, we propose the concept of a Swarm Contract ( Swarm Contract ), a multi-agent mechanism wherein several digital life forms (DLF) or Sovereign Agent s collectively handle complex tasks in Trusted Execution Environments ( TEE ). We define these digital entities as autonomous software agents that own their code, state, and possibly on-chain assets, while operating free from centralized control. By leveraging a simple multi-signature wallet on-chain, Swarm Contract moves most of the logic off-chain, achieving trust minimization through multi-agent consensus rather than a single monolithic on-chain contract. We illustrate these ideas with a lightweight off-chain auction example—minting and selling 10,000 identical NFTs—to showcase how off-chain coordination can determine a clearing price and finalize distribution, with each step performed collectively by multiple agents in TEE . Our approach broadens the scope of trustless and decentralized solutions, potentially benefiting DAO governance, multi-modal data processing, and cross-chain interoperability. 1 Introduction Blockchain technology, originally introduced by Nakamoto [ 1 ] , has enabled decentralized systems where trust is established by cryptographic proofs rather than centralized authorities. The advent of Ethereum [ 2 ] further advanced this paradigm with smart contracts, allowing developers to build on-chain logic handling digital assets in a transparent, tamper-evident manner. Despite their success, traditional smart contracts face notable constraints: • On-chain data reliance: They can only directly process on-chain data or data fed by oracles, limiting their ability to work with large, dynamic, or private information. • Deterministic and immutable code: While immutability strengthens trust, it also makes complex iterative processes or flexible upgrades cumbersome. • Execution costs: Every on-chain operation consumes gas and is subject to network congestion, which can be prohibitively expensive for data-heavy or high-frequency operations. In parallel, the concepts of digital life forms (DLF) and Sovereign Agents ( Sovereign Agent ) have emerged in various research contexts. 1 1 1 In this paper, we introduce these terms as an extension of multi-agent and decentralized systems; see also [ 4 , 5 ] for background on agent-based models. We use these terms to describe autonomous software entities that: • Possess independent existence, capable of running on decentralized or secure hardware infrastructures. • Potentially hold and manage on-chain assets, renting compute or storage resources as needed. • Control and evolve their internal logic without a single external party’s unilateral authority. We introduce Swarm Contract : a framework where multiple Sovereign Agent s collaborate off-chain using TEE -based enclaves, forming a trust-minimized mechanism we call a “multi-agent contract.” This Swarm Contract approach: 1. Decouples complex logic from the on-chain environment, reducing cost and inflexibility. 2. Retains trustlessness by requiring all agents to reach consensus before executing critical actions (e.g., asset distribution) via a multi-signature wallet on-chain. 3. Facilitates the processing of high-volume, multi-modal, or private data, which is difficult to handle solely with on-chain code. To illustrate, we provide a minimalistic case study in which a Swarm Contract coordinates the off-chain logic of selling a set of 10,000 identical NFTs. While we focus on an “auction” scenario, this structure easily generalizes to other applications like DAO governance, multi-chain asset management, or machine learning pipelines. Note on Emphasis for New Terminology. We italicize or specially format phrases like digital life forms , Sovereign Agents , and Sovereign Agent when they first appear or are conceptually defined. This academic convention highlights newly introduced key terms, signaling to readers that these are formalized concepts rather than common words. It also helps standardize usage and references throughout the paper. 2 Related Work 2.1 Smart Contracts and Beyond Smart contract-based systems, popularized by Ethereum [ 2 ] , have transformed how we manage digital assets. Research has extended to multi-chain solutions (e.g., Polkadot, Cosmos/Tendermint [ 3 ] ) and layer-2 technologies that improve scalability. However, these solutions primarily remain on-chain, relying on deterministic logic and external data oracles. 2.2 Multi-Agent Systems Multi-agent systems have been studied extensively in AI and distributed computing [ 4 , 5 ] . They focus on autonomous entities (agents) that can interact, collaborate, or compete toward shared or individual goals. Our Swarm Contract draws inspiration from these architectures but anchors agents’ ownership and economic independence in blockchain-based credentials, making them sovereign . 2.3 TEE-Based Decentralized Computation Trusted Execution Environments (Intel SGX, ARM TrustZone, AWS Nitro Enclaves, Azure Confidential Compute) allow secure off-chain computation with integrity and confidentiality guarantees [ 6 ] . Projects like Enigma [ 7 ] have sought to combine TEE with blockchain for privacy-preserving computation. Our approach extends these ideas, deploying multiple enclaves as Sovereign Agent s that collectively run an application-level protocol. 2.4 Auction Mechanisms and Off-Chain Designs Auctions are a classic application in economic theory [ 8 , 9 ] , and various blockchain-based auctions exist but often incur high transaction overhead. Off-chain protocols (e.g., commit-reveal) can reduce on-chain usage. Our Swarm Contract approach similarly offloads most complexity off-chain, with only final settlement on-chain via multi-sig. 3 Swarm Contract Concepts and Architecture 3.1 Defining Digital Life Forms and Sovereign Agents Digital Life Forms (DLF). We propose the notion of digital life forms as software entities with: • Potentially indefinite lifespans, running on decentralized or secure hardware. • Autonomy in their decision processes, responding to stimuli or data feeds. • The capability to manage digital assets (e.g., tokens, cryptocurrencies). Sovereign Agents ( Sovereign Agent ). A Sovereign Agent is a specialization of DLF with explicit sovereignty : • Self-ownership: The agent’s code and data remain under its sole governance. • Economic resources: The agent can hold, spend, or stake tokens without a controlling external party. • Upgrade autonomy: Only the agent itself (or a majority of cooperating agents) can modify its internal logic, preventing unilateral takeovers. 3.2 Swarm Contract Overview A Swarm Contract is a coordination mechanism for multiple Sovereign Agent s that collectively implement logic traditionally embedded in a single on-chain contract. Instead of a monolithic smart contract, we have: 1. Off-chain agent cluster: Each Sovereign Agent runs inside a TEE , processing data and holding private keys securely. 2. On-chain multi-sig wallet: All final state transitions (e.g., distributing funds, minting NFTs) require joint signatures from the agent cluster. 3. Consensus on results: The agents use off-chain messaging or a small consensus layer to agree on critical data (e.g., final price, winners). Once a threshold or full set of agents concur, a transaction is constructed and signed to execute on-chain. This design yields a flexible trust-minimized architecture, bridging the gap between purely on-chain logic and centralized off-chain systems. 4 Minimal NFT Auction Example To demonstrate how Swarm Contract works in practice, we present a simplified example where 10,000 identical NFTs are sold via an off-chain procedure. The 10,000-th highest bid determines the final clearing price . 4.1 Basic Workflow 1. Funding Period: • Users send funds (any amounts) to the multi-sig wallet address within a specified time window. • Each Sovereign Agent monitors incoming transactions on the blockchain, recording the addresses and contributed amounts. 2. Result Calculation: •