跳到主要內容

Why Our Smart Contracts Are Intentionally Non-Turing-Complete, and Why Every Contract Is an On-Chain NFT

Robert Mao
ArcBlock ChainBlockchainSmart ContractNFTDIDSecurityArchitectureVerifiable Credential

Over the past decade, the blockchain industry developed an almost unquestioned reflex: mention "smart contracts," and people immediately picture Solidity, bytecode virtual machines, and a marketing phrase that sounds impressive on paper: "Turing-complete." In designing ArcBlock Chain as a next-generation Agentic Layer 1, we made the exact opposite call.

Our smart contracts intentionally give up Turing completeness in favor of a declarative Domain-Specific Language (DSL) structured like a real-world commercial contract, and every smart contract deployed on-chain is minted as a standard NFT with its own DID, cryptographic signature, and version governance rules.

Does that sound contrarian? Put three realities side by side: billions of dollars lost to smart contract exploits over the last ten years, everyday users terrified of "blind signing" hex strings in their wallets, and AI coding agents that can hallucinate subtle bugs when writing imperative code. Once you look at all three together, the conclusion is hard to miss: chasing unrestricted Turing completeness on a state machine that moves real money was an engineering anti-pattern from day one.

Why Synchronous Nested Call Stacks Are an Anti-Pattern on a Financial Ledger

Let's start from first principles with a simple question. When you sign a commercial lease, a royalty split agreement, or a bank supplementary card policy with a daily spending limit in the real world, does that contract contain a while loop? Does it pause halfway through settlement to jump into an arbitrary callback function written by a stranger?

Of course not 🤣. Real-world business contracts are fundamentally declarative: they spell out the parties, trigger conditions, revenue split ratios, permission boundaries, and fallback rules, and they never let one party hijack the control flow in the middle of clearing a balance.

By contrast, traditional smart contract virtual machines like the EVM cram general-purpose computation and financial settlement into a single synchronous nested call stack (Contract A -> Contract B -> Contract C). From a distributed systems and security engineering perspective, that design creates three chronic problems:

  1. Over 80% of critical exploits grow out of unrestricted Turing-complete control flow: From the early DAO hack to modern DeFi flash-loan and reentrancy exploits, the root cause is almost always handing execution control to an external untrusted contract while internal state and balances are still in an inconsistent intermediate state. Add unbounded loops that trigger out-of-gas denial-of-service (DoS), integer precision traps, and storage-slot collisions in upgradeable proxy contracts, and builders still lose sleep even after paying for three security audits.
  2. Humans cannot practice Clear Signing ("What You See Is What You Sign"): Compiled Turing-complete bytecode is a black box. When you tap "Confirm" in a wallet, the wallet cannot statically invert arbitrary bytecode to prove how much money will leave your account, forcing users to blind-sign opaque hashes.
  3. AI agents hallucinate when writing imperative custody code: In the Agentic era, more applications are assembled on the fly by AI coding agents. Asking an LLM to write hundreds of lines of imperative Solidity where a single misplaced state update can drain a vault is a recipe for disaster. Asking an AI agent to generate a declarative contract governed by a strict schema and mathematical invariants, however, allows zero-hallucination generation verified in microseconds.

In our own early experiments years ago, we even explored letting developers write lightweight script expressions inside asset factories. Practice quickly taught us that opening the door even slightly to arbitrary expressions makes it impossible for a wallet to reliably invert the code into a human-readable signing card. So we made a clean break: drop imperative code altogether and rebuild on-chain programmability around a three-layer deterministic architecture.

Layer 1 Subtraction: Replacing Glue Contracts with Built-In Primitives and SQL-Style Transaction Blocks

Before a developer even needs to write a custom rule, we eliminate 95% of the reasons people had to write smart contracts in the first place.

On legacy blockchains, launching a token, opening an AMM liquidity pool, running an English or Dutch auction, or issuing a prepaid voucher card requires deploying custom smart contracts from scratch. On ArcBlock Chain, all of these high-frequency commercial and financial actions are battle-tested protocol primitives.

What if a workflow needs to compose several primitives together (for example, "claim staking rewards, swap part of the tokens into app credits, mint a game item NFT, and split referral commission automatically") without deploying a custom bytecode contract?

Warm-toned tabletop editorial illustration of a horologist's sunlit stone workbench: on the left, a transparent crystal dome projects a glowing teal rehearsal of three interlocking brass modules; on the right, it connects to a solid stone-and-brass atomic lock gate topped by a perfectly level balance scale

Our answer borrows one of the most proven ideas in relational databases: an SQL-style atomic TransactionBlock.

Instead of deploying a "glue contract" just to bundle actions, a developer or AI agent declares a multi-step transaction block (up to 16 cohesive protocol operations) inside a single transaction. The state engine executes the block inside a Copy-on-Write sandbox just like a database running BEGIN ... SAVEPOINT ... COMMIT / ROLLBACK:

  • Zero-Side-Effect Sandbox Dry-Run and Static Footprint Extraction: Before a transaction ever touches the live ledger, any wallet or agent can run a deterministic sandbox dry-run and extract the exact read/write state footprint. That lets wallets render an exact balance-change preview and lets node schedulers execute non-overlapping transactions in parallel without lock contention.
  • Client-Side Post-Conditions and the Zero-Sum Conservation Gate: When signing, a user attaches explicit post-conditions right in the payload, such as "after this entire block finishes, I may spend at most 100 tokens and must receive at least 1 target NFT." If any intermediate step exceeds slippage or fails the protocol's post-execution Zero-Sum Conservation Gate, the entire block rolls back atomically with zero asset loss.

Intentionally Non-Turing-Complete: Reading On-Chain Rules Like a Commercial Contract

Once built-in primitives and atomic transaction blocks handle 95% of composite workflows, the remaining 5% of persistent business rules that need to live on-chain across transactions (such as account firewalls, multi-tier commercial revenue splits, and regulated asset compliance) are expressed in our intentionally non-Turing-complete declarative Smart Contract DSL.

This DSL is built on a strict Closed-World Assumption. There are no loops, no recursion (execution is capped at single-depth invocation and a 3-layer directed acyclic graph for upstream splits), and no arbitrary external callbacks. Every contract is assembled from structured clauses covering three core domains:

  1. Account Guard Clauses: With a few declarative lines, you can turn your personal account or an independent NFT account into a guarded vault. A favorite feature among users is the four-state inbound inbox (accept | reject | timeout | burn): unsolicited transfers from strangers never pollute your wallet directly. You can auto-accept whitelisted senders, reject or time out unknown transfers, or route malicious spam airdrops straight to burn, forcing spammers to lose both their transaction fee and their spam tokens! Account Guard also enforces outbound spending caps, scoped AI agent session budgets, 24-hour timelocks on large transfers, and an intuitive Meta-Guard safety ratchet: tightening security rules takes effect immediately, while loosening them requires the owner's hardware Passkey signature plus a mandatory cooldown period.
  2. Revenue Split Clauses: Built for co-creation, modular software reuse, and affiliate commerce, these clauses define a 10,000-basis-point waterfall that automatically deducts frontend referral commissions, distributes royalties across up to 3 layers of upstream component dependencies, and streams remainder revenue into O(1) community contributor dividend pools.
  3. Issuer Compliance Clauses: Designed for regulated stablecoins, enterprise notes, and real-world assets (RWAs), enabling declarative freeze lists, per-transaction limits, and burn-on-redemption rules compatible with institutional cross-chain standards.

Warm-toned isometric editorial illustration of a sunlit stone, brass, and translucent teal glass sorting and settlement apparatus: on the left, a four-way mechanical gate routes verified crystal parcels into a vault while dropping jagged dark spam tokens into a glowing forge brazier; on the right, a stepped crystal aqueduct splits a golden stream into four proportional channels

Because the DSL is intentionally non-Turing-complete, the protocol runs 8 static mathematical invariant validators before any contract can be minted. In under 0.05 milliseconds, the verifier proves basis-point bounds, DAG acyclicity, remainder conservation, timelock minimums, and immutable clause locks.

Just as importantly, it achieves bidirectional readability for both humans and AI: coding agents generate valid JSON/YAML contracts without hallucinating control-flow bugs, while DID Wallet renders the exact same declarative clauses into a plain-language legal summary card (humanLegalSummary) showing "You Pay / Rules Executed / You Receive."

Every Smart Contract Is an On-Chain NFT: Verifiable, Composable, and Governable

Once a smart contract is no longer an opaque blob of virtual machine bytecode, how should it live on the ledger?

On ArcBlock Chain, every smart contract published on-chain is minted as a standard NFT (and a W3C-compliant Verifiable Credential).

Warm-toned editorial illustration of three upright crystal-and-brass charter tablets linked chronologically by glowing teal light threads on a sunlit stone pedestal: each tablet is encased like a collectible artifact with a permanently locked glowing teal core crystal at its base and a multi-key brass governance dial at its crown

Representing a smart contract as an NFT solves two of the hardest problems in traditional contract engineering, provenance verification and upgrade governance:

  • Built-In Cryptographic Lineage: Every Contract NFT has its own did:abt: address, canonical contractHash, issuer signature (proof), and version lineage pointer (prevVersionHash). Anyone interacting with the contract can verify who issued it and inspect its full version history.
  • Immutable Clauses That Protect Upstream Creators from Rug Upgrades: In traditional proxy contracts, an admin with upgrade keys can silently swap out the implementation and zero out the revenue share promised to early contributors or upstream component authors. In our Contract NFTs, specific clauses can be locked inside immutableClauses, alongside explicit governance modes (immutable, passkey_root, multisig_quorum, or contributor_token_quorum) and mandatory upgrade timelocks (upgradeTimelockSec). Once an upstream Blocklet author locks a 10% royalty clause into immutableClauses, the protocol's static verifier will reject any future upgrade proposal that attempts to remove or dilute that commitment.
  • Contracts as Composable Assets: Because a contract is an NFT, it can be held inside an NFT container account, co-owned by a DAO or creator collective, and referenced as a modular building block across applications running on ARC (Agentic Realm Computer).

Keep Complexity in the Substrate, Return Determinism to Humans and Agents

Every major leap in software accessibility has been driven by a bold act of subtraction. Relational databases replaced manual pointer traversal with declarative SQL; the Web replaced low-level desktop drawing routines with declarative HTML and CSS.

It is time for blockchain smart contracts to make the same leap.

By stepping away from the vanity of Turing-complete bytecode and rebuilding programmable ledgers around built-in primitives, SQL-style atomic transaction blocks, an intentionally non-Turing-complete declarative DSL, and Smart Contracts as on-chain NFTs, we eliminate reentrancy bugs, blind-signing traps, and proxy rug-upgrades at the root. Humans can finally read every on-chain agreement like a clear commercial contract, and AI coding agents gain a deterministic, statically verifiable foundation to build real businesses at scale.

References and Further Reading

本頁涉及

產品

  • ARC active

    Blocklet 的執行時。它給開發者一個地方來執行以 Blocklet 描述的應用,連同那個 Blocklet 宣告自己需要的資源。

  • ArcBlock Chain active

    為應用的身分、資產與約定而設計的 Layer 1。ArcBlock Chain 將這些常用操作納入協議,ABT 是公共網路的原生代幣。

  • DID Wallet renamed

    在一個應用程式裡建立和管理數位身分(DID),並管理相關憑證。