Sui Move Patterns
What design patterns emerge when ownership is structural and the compiler prevents the bugs you'd write on EVM?
Move's resource model eliminates re-entrancy, asset duplication, and unchecked access control by construction. The patterns that matter are different — not "how to prevent X" but "how to compose Y."
Patterns by Domain
| Domain | Patterns | Our Packages |
|---|---|---|
| DePIN | Device lifecycle state machine, operator/owner separation, stake-weighted reputation, sensor data attestation | device_registry, depin_core, precision_agriculture, smart_city |
| Agent Commerce | Intent→Cart→Approval flow, agent identity verification, budget constraints, expiration handling | mandate, identity |
| Attribution | Link genealogy (parent/embedded), decay functions (4 types), revenue splits, spam detection | link, collision, loyalty |
| Economic Proofs | Value conservation, attribution sum validation, property-based test generation | tokenomics_validation, test_framework |
| IoT Verticals | Sensor-per-farm binding, AI prediction objects, insurance with risk calculation from telemetry | precision_agriculture |
Core Move Patterns
| Pattern | When to Use | Example |
|---|---|---|
| Capability | Access control | AdminCap object as proof of authorization |
| Shared object | Multi-party access | mandate uses share_object for buyer/seller interaction |
| Owned object | Single-owner fast path | link uses transfer for creator ownership |
| Object composition | Nested ownership | Device owns its Capabilities and Location |
| Event emitters | Indexer integration | All state changes emit events for off-chain tracking |
| Systematic error codes | Debuggability | 100s/200s/300s/400s/500s per module domain |
| test_scenario | Multi-transaction tests | Realistic flows with sender switching between transactions |
What Goes Here
Pages in this directory document Move-specific design patterns — grouped by domain (DePIN, DeFi, attribution, agent commerce) and by pattern type (general, economic, security). Equivalent to EVM Patterns in the EVM section.
Context
- Sui Development — Full package inventory with line counts and status
- EVM Patterns — Solidity patterns for comparison
- A&ID Template — Agents (Move modules) and instruments (objects)
- Smart Contracts as Pipes — Smart contracts carry instructions and energy
Questions
Which Move patterns from our DePIN packages would survive as reusable library modules — and which are too domain-specific to extract?