Protocol

Asset State Management Complexity: Introducing Lock Status Architecture

25 Oct 2025 · 11 min read

Simple 5-tier lock states could not fully resolve priority conflicts between regulatory authorities, time-based state transitions, and cross-chain atomicity issues. This research presents implementation approaches to meet complex real-world financial system requirements through State Transition Automata-based methodologies and Hierarchical Lock Mechanisms.

TL;DR

Following the Enhanced Lock Status design in OIP v0.2, we discovered during actual implementation that asset state transition complexity is far more nuanced and multidimensional than anticipated. Simple 5-tier lock states could not fully resolve priority conflicts between regulatory authorities, time-based state transitions, and cross-chain atomicity issues. This research presents implementation approaches to meet complex real-world financial system requirements through State Transition Automata-based methodologies and Hierarchical Lock Mechanisms.


Introduction: The Gap Between Theory and Reality

When designing the Enhanced Lock Status Architecture during OIP v0.2 development, we believed that 5-tier lock states (UNLOCKED, SOFT_LOCKED, PREEMPTIVE_LOCKED, TEMP_LOCKED, HARD_LOCKED, PERM_LOCKED) would suffice. However, the reality we encountered in actual testnet simulations proved different.

Particularly in complex scenarios, unexpected problems emerged: when SEC’s FREEZE command and FATF’s SEIZE command arrived simultaneously, simple priority systems could not reflect legal nuances. Furthermore, situations where time-based expiry processing and cross-chain atomicity guarantees conflicted with each other occurred continuously.

“Asset state management is not a technical problem but an epistemological challenge of translating the complex legal-economic relationships of the real world into digital form.”

This research proposes a more sophisticated asset state management system based on such actual implementation experience.

Grid notebook with a chain of v0.2 lock states, two crossed out, red notes asking which order wins, and a state tree sketch

Early design notes where simultaneous commands broke the flat v0.2 lock model

Limitations of Existing Lock Status Architecture

1. Problems with Flat State Models

The 5-tier Lock Status in v0.2 was essentially a flat state model. Each state existed independently, and state transition rules were unclear.

// v0.2's simple state model - actually insufficient
enum LockStatus {
  UNLOCKED = 0,
  SOFT_LOCKED = 1,
  PREEMPTIVE_LOCKED = 2, 
  TEMP_LOCKED = 3,
  HARD_LOCKED = 4,
  PERM_LOCKED = 5
}

In actual simulations, the following state transition ambiguities were discovered:

  • Priority rules when transitioning from PREEMPTIVE_LOCKED to HARD_LOCKED state
  • Conflict handling between TEMP_LOCKED expiration timing and REGULATORY_LOCKED
  • Atomicity guarantees for simultaneous state changes across multiple chains

2. Absence of Regulatory Context

The existing architecture lacked information about who, why, and until when the lock was executed. For example, even the same HARD_LOCKED state could represent:

  • US court asset freeze order
  • EU ESMA market manipulation prevention measure
  • Japan FSA compliance review

These three have completely different legal characteristics and release conditions despite being represented by the same state.

3. Inadequate Temporal Complexity Handling

Time-based state transitions are essential in actual financial systems:

  • Automatic settlement of bond maturity dates
  • Legal review periods for regulatory orders
  • Collateral liquidation grace periods

The existing design attempted to handle such temporal complexity with a simple expirationTime field, but in reality, multiple timers and conditional transitions were needed.

State Transition Automata Approach

To overcome these limitations, we developed a new approach based on State Transition Automata.

Hierarchical State Structure

In the new design, Lock Status is redefined as a hierarchical structure:

Lock states drawn as concentric rings from AVAILABLE at the center to TERMINATED outside, beside context and timing boxes

Primary lock states as precedence rings: inner states yield to outer ones

interface HierarchicalLockStatus {
  primaryState: PrimaryLockState;
  secondaryState?: SecondaryLockState;
  regulatoryContext?: RegulatoryContext;
  temporalConstraints?: TemporalConstraint[];
  crossChainCoherence: CoherenceState;
}

enum PrimaryLockState {
  AVAILABLE = "AVAILABLE",     // Available
  RESERVED = "RESERVED",       // Reserved 
  RESTRICTED = "RESTRICTED",   // Restricted
  SEIZED = "SEIZED",          // Seized
  TERMINATED = "TERMINATED"    // Terminated
}

enum SecondaryLockState {
  PENDING_VERIFICATION = "PENDING_VERIFICATION",
  UNDER_REVIEW = "UNDER_REVIEW", 
  AWAITING_CLEARANCE = "AWAITING_CLEARANCE",
  PROCESSING_TRANSFER = "PROCESSING_TRANSFER",
  COOLING_DOWN = "COOLING_DOWN"
}

Regulatory Context Integration

Each state change mandatorily includes regulatory context:

interface RegulatoryContext {
  authority: RegulatoryAuthority;
  jurisdiction: Jurisdiction;
  legalBasis: LegalReference;
  priorityLevel: number;
  appealable: boolean;
  automaticExpiry?: TemporalConstraint;
  overrideConditions?: OverrideCondition[];
}

interface LegalReference {
  statute: string;           // Legal basis
  section: string;          // Section
  orderNumber?: string;     // Order number
  issuanceDate: Date;       // Issuance date
  effectiveDate: Date;      // Effective date
}

State Transition Rules Engine

State transitions are managed by a rules-based engine:

class StateTransitionEngine {
  private transitionRules: Map<PrimaryLockState, TransitionRule[]>;
  private conflictResolver: ConflictResolver;
  
  async executeTransition(
    currentState: HierarchicalLockStatus,
    trigger: StateTransitionTrigger,
    context: TransitionContext
  ): Promise<TransitionResult> {
    
    // 1. Validate transition possibility
    const validTransitions = this.findValidTransitions(currentState, trigger);
    
    if (validTransitions.length === 0) {
      return { success: false, reason: "No valid transitions found" };
    }
    
    // 2. Conflict resolution
    if (validTransitions.length > 1) {
      const resolvedTransition = await this.conflictResolver.resolve(
        validTransitions, 
        context
      );
      return this.applyTransition(currentState, resolvedTransition);
    }
    
    // 3. Execute single transition
    return this.applyTransition(currentState, validTransitions[0]);
  }
}
Hierarchical lock status Ordered by precedence, the five primary states move only along valid transitions, and each holds its own secondary states.
Five primary lock states, their valid transitions, secondary states and regulatory actions Five primary lock states in order of precedence: AVAILABLE, RESERVED, RESTRICTED, SEIZED, TERMINATED. Transitions toward higher precedence: AVAILABLE to RESERVED, RESTRICTED or SEIZED; RESERVED to RESTRICTED; RESTRICTED to SEIZED; SEIZED to TERMINATED. Releases: RESERVED to AVAILABLE, RESTRICTED to AVAILABLE, SEIZED to RESTRICTED. TERMINATED is final, with no transition out. Secondary states refine a primary state: COOLING_DOWN in AVAILABLE, PROCESSING_TRANSFER in RESERVED, PENDING_VERIFICATION and UNDER_REVIEW in RESTRICTED, AWAITING_CLEARANCE in SEIZED, none in TERMINATED. Regulatory actions mapped to each state: none for AVAILABLE and RESERVED, FREEZE and RESTRICT for RESTRICTED, SEIZE and CONFISCATE for SEIZED, CONFISCATE and LIQUIDATE for TERMINATED. PRIMARY STATE REGULATORY ACTION AVAILABLE COOLING_DOWN none RESERVED PROCESSING_TRANSFER none RESTRICTED PENDING_VERIFICATION UNDER_REVIEW FREEZE, RESTRICT SEIZED AWAITING_CLEARANCE SEIZE, CONFISCATE TERMINATED no secondary state CONFISCATE, LIQUIDATE final toward higher precedence release secondary state Five primary lock states, their valid transitions, secondary states and regulatory actions Five primary lock states in order of precedence: AVAILABLE, RESERVED, RESTRICTED, SEIZED, TERMINATED. Transitions toward higher precedence: AVAILABLE to RESERVED, RESTRICTED or SEIZED; RESERVED to RESTRICTED; RESTRICTED to SEIZED; SEIZED to TERMINATED. Releases: RESERVED to AVAILABLE, RESTRICTED to AVAILABLE, SEIZED to RESTRICTED. TERMINATED is final, with no transition out. Secondary states refine a primary state: COOLING_DOWN in AVAILABLE, PROCESSING_TRANSFER in RESERVED, PENDING_VERIFICATION and UNDER_REVIEW in RESTRICTED, AWAITING_CLEARANCE in SEIZED, none in TERMINATED. Regulatory actions mapped to each state: none for AVAILABLE and RESERVED, FREEZE and RESTRICT for RESTRICTED, SEIZE and CONFISCATE for SEIZED, CONFISCATE and LIQUIDATE for TERMINATED. AVAILABLE COOLING_DOWN ACTION none RESERVED PROCESSING_TRANSFER ACTION none RESTRICTED PENDING_VERIFICATION UNDER_REVIEW ACTION FREEZE, RESTRICT SEIZED AWAITING_CLEARANCE ACTION SEIZE, CONFISCATE TERMINATED no secondary state ACTION CONFISCATE, LIQUIDATE final toward higher precedence release secondary state
Figure 1Hierarchical Lock Status Architecture: States and Transitions

Real Implementation: Handling Complex Scenarios

Scenario 1: Priority Conflicts Between Regulatory Authorities

The most complex scenario in actual testing was simultaneous intervention by multiple regulatory authorities:

// Actual conflict scenario that occurred
const scenario = {
  asset: "US_TREASURY_10Y_001",
  simultaneousActions: [
    {
      authority: "US_SEC",
      action: "FREEZE",
      reason: "Insider trading investigation",
      timestamp: "2024-03-15T10:30:00Z"
    },
    {
      authority: "FATF", 
      action: "SEIZE",
      reason: "AML compliance review",
      timestamp: "2024-03-15T10:30:02Z" // 2 second difference
    }
  ]
};

In this case, we apply a legal priority matrix:

class RegulatoryPriorityMatrix {
  private priorityRules: PriorityRule[] = [
    {
      condition: (a1, a2) => a1.jurisdiction === a2.jurisdiction,
      resolution: (a1, a2) => a1.authorityType > a2.authorityType ? a1 : a2
    },
    {
      condition: (a1, a2) => a1.isCourtOrder && !a2.isCourtOrder,
      resolution: (a1, a2) => a1
    },
    {
      condition: (a1, a2) => this.isInternationalTreaty(a1, a2),
      resolution: (a1, a2) => this.applyTreatyRules(a1, a2)
    }
  ];
  
  resolveConflict(action1: RegulatoryAction, action2: RegulatoryAction): RegulatoryAction {
    for (const rule of this.priorityRules) {
      if (rule.condition(action1, action2)) {
        return rule.resolution(action1, action2);
      }
    }
    
    // Default: chronological order
    return action1.timestamp < action2.timestamp ? action1 : action2;
  }
}

Scenario 2: Time-Based Automatic State Transitions

Time-based transitions such as bond maturity processing are managed by a separate scheduler:

class TemporalStateManager {
  private scheduledTransitions: Map<string, ScheduledTransition[]>;
  private timerService: TimerService;
  
  scheduleAutomaticTransition(
    assetId: string, 
    transition: ScheduledTransition
  ): void {
    
    const timer = this.timerService.createTimer({
      triggerTime: transition.scheduledTime,
      callback: async () => {
        await this.executeScheduledTransition(assetId, transition);
      },
      persistence: true // Maintain even after node restart
    });
    
    this.registerTimer(assetId, timer);
  }
  
  private async executeScheduledTransition(
    assetId: string, 
    transition: ScheduledTransition
  ): Promise<void> {
    
    // 1. Check current state
    const currentState = await this.getAssetState(assetId);
    
    // 2. Validate preconditions
    if (!this.validatePreconditions(currentState, transition.preconditions)) {
      return this.handlePreconditionFailure(assetId, transition);
    }
    
    // 3. Execute cross-chain atomic transition
    await this.executeCrossChainTransition(assetId, transition);
  }
}

Scenario 3: Cross-Chain Atomicity Guarantee

The most technically challenging aspect is simultaneous state changes across multiple chains:

class AtomicCrossChainLockManager {
  async executeAtomicLockUpdate(
    updates: CrossChainLockUpdate[]
  ): Promise<AtomicLockResult> {
    
    const transactionId = this.generateTransactionId();
    const preparationResults: PreparationResult[] = [];
    
    try {
      // Phase 1: Prepare on all chains
      for (const update of updates) {
        const result = await this.prepareChainUpdate(update, transactionId);
        preparationResults.push(result);
        
        if (!result.success) {
          throw new PreparationError(result.error);
        }
      }
      
      // Phase 2: Simultaneous commit on all chains  
      const commitPromises = updates.map((update, index) => 
        this.commitChainUpdate(update, preparationResults[index].preparationProof)
      );
      
      const commitResults = await Promise.allSettled(commitPromises);
      
      // Phase 3: Result validation and rollback if necessary
      return this.validateAndFinalize(commitResults, transactionId);
      
    } catch (error) {
      // Execute rollback
      await this.rollbackAllChains(preparationResults, transactionId);
      return { success: false, error: error.message };
    }
  }
}
Cross-chain atomic locking Every chain prepares before any commits, and any chain failure rolls back every prepared lock.
Cross-chain atomic locking with a three-phase commit and failure recovery An example lock update on three chains, Ethereum, Base and Polygon, in three phases. Phase 1, Preparation (PREPARING): Ethereum validates, locking the asset state; Base reserves, preparing the lock change; Polygon prepares the transaction, validating the regulatory context (authority: SEC). All chains are prepared before the commit. Phase 2, Atomic Commit (COMMITTING): Ethereum broadcasts the transaction; Base executes the state change (confirmation: pending); Polygon verifies, updating the regulatory status. All commits settle before finalization. Phase 3, Finalization (FINALIZING): Ethereum confirms, asset locked successfully (REGULATORY_LOCKED); Base finalizes, state synchronized; Polygon completes, regulatory context updated (authority acknowledged). If any chain fails to prepare, or a commit failed, failure recovery runs: detect failure, init rollback, release locks (all prepared locks, atomically), restore states, log reason. 1 Preparation PREPARING 2 Atomic Commit COMMITTING 3 Finalization FINALIZING all chains prepared all commits settled Ethereum Validate Locking asset state Broadcast Broadcasting transaction Confirm Asset locked successfully REGULATORY_LOCKED Base Reserve Preparing lock change Execute Executing state change confirmation: pending Finalize State synchronized Polygon Prepare TX Validating reg. context authority: SEC Verify Updating reg. status Complete Reg. context updated authority acknowledged prepare fails commit failed FAILURE RECOVERY Detect failure Init rollback Release locks Restore states Log reason all prepared locks, atomically Cross-chain atomic locking with a three-phase commit and failure recovery An example lock update on three chains, Ethereum, Base and Polygon, in three phases. Phase 1, Preparation (PREPARING): Ethereum validates, locking the asset state; Base reserves, preparing the lock change; Polygon prepares the transaction, validating the regulatory context (authority: SEC). All chains are prepared before the commit. Phase 2, Atomic Commit (COMMITTING): Ethereum broadcasts the transaction; Base executes the state change (confirmation: pending); Polygon verifies, updating the regulatory status. All commits settle before finalization. Phase 3, Finalization (FINALIZING): Ethereum confirms, asset locked successfully (REGULATORY_LOCKED); Base finalizes, state synchronized; Polygon completes, regulatory context updated (authority acknowledged). If any chain fails to prepare, or a commit failed, failure recovery runs: detect failure, init rollback, release locks (all prepared locks, atomically), restore states, log reason. all chains prepared all commits settled 1 Preparation PREPARING ETHEREUM Validate Locking asset state BASE Reserve Preparing lock change POLYGON Prepare TX Validating reg. context authority: SEC 2 Atomic Commit COMMITTING ETHEREUM Broadcast Broadcasting transaction BASE Execute Executing state change confirmation: pending POLYGON Verify Updating reg. status 3 Finalization FINALIZING ETHEREUM Confirm Asset locked successfully REGULATORY_LOCKED BASE Finalize State synchronized POLYGON Complete Reg. context updated authority acknowledged prepare fails commit failed FAILURE RECOVERY Detect failure Init rollback Release locks all prepared locks, atomically Restore states Log reason
Figure 2Cross-Chain Atomic Locking Mechanism with Three-Phase Commit Protocol

Performance Optimization and Scalability

State Caching Strategy

Complex state transition logic can cause performance overhead. Hierarchical caching strategy to address this:

class HierarchicalStateCache {
  private l1Cache: Map<string, CachedState>; // Memory cache
  private l2Cache: RedisCache;               // Distributed cache  
  private l3Storage: PersistentStorage;      // Persistent storage
  
  async getAssetState(assetId: string): Promise<AssetState> {
    // Check L1 cache
    let state = this.l1Cache.get(assetId);
    if (state && !this.isExpired(state)) {
      return state.data;
    }
    
    // Check L2 cache
    state = await this.l2Cache.get(assetId);
    if (state && !this.isExpired(state)) {
      this.l1Cache.set(assetId, state);
      return state.data;
    }
    
    // Reconstruct from L3
    const freshState = await this.reconstructState(assetId);
    await this.setCascadingCache(assetId, freshState);
    return freshState;
  }
}

State Compression and Delta Synchronization

Instead of transmitting entire states each time, synchronize only state changes:

interface StateDelta {
  assetId: string;
  previousStateHash: string;
  newStateHash: string;
  changes: StateChange[];
  proof: DeltaProof;
}

class DeltaSynchronizer {
  async synchronizeStateDelta(delta: StateDelta): Promise<SyncResult> {
    // 1. Validate previous state
    const currentState = await this.getCurrentState(delta.assetId);
    if (currentState.stateHash !== delta.previousStateHash) {
      return this.requestFullResync(delta.assetId);
    }
    
    // 2. Apply delta
    const newState = this.applyDelta(currentState, delta.changes);
    
    // 3. Validate new state hash
    if (this.computeStateHash(newState) !== delta.newStateHash) {
      throw new StateIntegrityError("State hash mismatch");
    }
    
    return { success: true, newState };
  }
}

OIP v0.3 Protocol Specification: Hierarchical Lock Status Structure

Based on our theoretical design, OIP v0.3 extends the Lock Status field as follows.

Extended asset.lockStatus Field Definition

{
  "asset": {
    "assetId": "string",
    "lockStatus": {
      "primary": "AVAILABLE | RESERVED | RESTRICTED | SEIZED | TERMINATED",
      "secondary": "string?",
      "regulatoryContext": {
        "authority": "string",
        "authorityType": "NATIONAL | INTERNATIONAL | INDUSTRY",
        "jurisdiction": "string",
        "legalBasis": {
          "statute": "string",
          "section": "string",
          "orderNumber": "string?",
          "issuanceDate": "ISO8601",
          "effectiveDate": "ISO8601"
        },
        "priorityLevel": "number",
        "appealable": "boolean"
      },
      "temporalConstraints": [{
        "type": "AUTO_EXPIRY | CONDITIONAL_RELEASE | PERIODIC_REVIEW",
        "scheduledTime": "ISO8601",
        "preconditions": ["string"],
        "automaticAction": "UNLOCK | ESCALATE | NOTIFY"
      }],
      "crossChainCoherence": {
        "status": "SYNCED | SYNCING | DIVERGED",
        "lastSyncTime": "ISO8601",
        "participatingChains": ["chainId"]
      }
    }
  }
}

Primary Lock State Definition

StateMeaningValid Next StatesRegulatory Action Mapping
AVAILABLEFreely tradableRESERVED, RESTRICTED, SEIZED–
RESERVEDTemporarily reserved for specific transactionAVAILABLE, RESTRICTED–
RESTRICTEDConditionally limited (only certain trades allowed)AVAILABLE, SEIZEDFREEZE, RESTRICT
SEIZEDCompletely seized by regulatory authorityRESTRICTED, TERMINATEDSEIZE, CONFISCATE
TERMINATEDAsset lifecycle ended(Final state)CONFISCATE, LIQUIDATE

Secondary Lock State Examples

Secondary state provides detailed context for the primary state:

  • PENDING_VERIFICATION: Awaiting KYC re-verification in RESTRICTED state
  • UNDER_REVIEW: Regulatory authority review in progress in RESTRICTED state
  • AWAITING_CLEARANCE: Awaiting court decision in SEIZED state
  • PROCESSING_TRANSFER: Executing cross-chain transfer in RESERVED state
  • COOLING_DOWN: Additional constraints for a period after transitioning to AVAILABLE

Regulatory Priority Resolution Rules

Resolution order when multiple regulatory actions conflict:

// OIP v0.3 Priority Resolution Algorithm (Pseudocode)
function resolveLockConflict(actions: RegulatoryAction[]): RegulatoryAction {
  // Priority 1: Court Order status
  const courtOrders = actions.filter(a => a.isCourtOrder);
  if (courtOrders.length > 0) {
    return courtOrders.sort((a, b) => b.priorityLevel - a.priorityLevel)[0];
  }
  
  // Priority 2: International Treaty basis
  const treatyBased = actions.filter(a => a.authorityType === "INTERNATIONAL");
  if (treatyBased.length > 0) {
    return treatyBased[0];
  }
  
  // Priority 3: priorityLevel numerical comparison
  return actions.sort((a, b) => b.priorityLevel - a.priorityLevel)[0];
}
Regulatory context layer Conflicting actions resolve by authority tier and temporal constraints act on their own; both end in a valid transition.
Authority hierarchy and temporal constraints, the regulatory context of a lock transition Authority hierarchy, checked top down; the first tier present wins. Tier 1, court orders (isCourtOrder): the one with the highest priorityLevel. Tier 2, international bodies such as FATF, IOSCO and FSB (authorityType INTERNATIONAL): the first treaty-based action. Tier 3, national regulators such as SEC, FCA, MAS and FINMA, and industry regulators such as FINRA and ESMA: the highest priorityLevel. The winner is one action for the lock status transition. Temporal constraints act without a new command: AUTO_EXPIRY, release at a scheduled time; CONDITIONAL_RELEASE, precondition-based unlock; PERIODIC_REVIEW, recurring compliance check. Each sets an automaticAction, UNLOCK, ESCALATE or NOTIFY, which reaches the lock status transition once its preconditions are checked. Either way the transition follows the valid transitions only. AUTHORITY HIERARCHY first present tier wins, top down TEMPORAL CONSTRAINTS Court orders isCourtOrder highest priorityLevel International bodies FATF · IOSCO · FSB authorityType INTERNATIONAL first treaty-based action National regulators SEC · FCA · MAS · FINMA Industry regulators FINRA · ESMA highest priorityLevel AUTO_EXPIRY automatic release at scheduled time CONDITIONAL_RELEASE precondition-based unlock PERIODIC_REVIEW recurring compliance check automaticAction UNLOCK · ESCALATE · NOTIFY 1 2 3 one action preconditions checked Lock status transition valid transitions only Authority hierarchy and temporal constraints, the regulatory context of a lock transition Authority hierarchy, checked top down; the first tier present wins. Tier 1, court orders (isCourtOrder): the one with the highest priorityLevel. Tier 2, international bodies such as FATF, IOSCO and FSB (authorityType INTERNATIONAL): the first treaty-based action. Tier 3, national regulators such as SEC, FCA, MAS and FINMA, and industry regulators such as FINRA and ESMA: the highest priorityLevel. The winner is one action for the lock status transition. Temporal constraints act without a new command: AUTO_EXPIRY, release at a scheduled time; CONDITIONAL_RELEASE, precondition-based unlock; PERIODIC_REVIEW, recurring compliance check. Each sets an automaticAction, UNLOCK, ESCALATE or NOTIFY, which reaches the lock status transition once its preconditions are checked. Either way the transition follows the valid transitions only. AUTHORITY HIERARCHY first present tier wins, top down Court orders isCourtOrder highest priorityLevel International bodies FATF · IOSCO · FSB authorityType INTERNATIONAL first treaty-based action National regulators SEC · FCA · MAS · FINMA Industry regulators FINRA · ESMA highest priorityLevel 1 2 3 one action Lock status transition valid transitions only automaticAction UNLOCK · ESCALATE · NOTIFY TEMPORAL CONSTRAINTS AUTO_EXPIRY automatic release at scheduled time CONDITIONAL_RELEASE precondition-based unlock PERIODIC_REVIEW recurring compliance check preconditions checked
Figure 3Hierarchical Lock Status Architecture: Regulatory Context Layer

Cross-Chain State Synchronization Message

Synchronization message sent to all participating chains when Lock Status changes:

{
  "messageType": "LOCK_STATUS_UPDATE",
  "assetId": "0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb",
  "transactionId": "txn_cross_chain_atomic_001",
  "sourceChainId": "base-mainnet",
  "targetChains": ["arbitrum-one", "optimism-mainnet"],
  "previousState": {
    "primary": "AVAILABLE",
    "stateHash": "0xabc123..."
  },
  "newState": {
    "primary": "RESTRICTED",
    "secondary": "UNDER_REVIEW",
    "regulatoryContext": { /* ... */ },
    "stateHash": "0xdef456..."
  },
  "proof": {
    "type": "ZK_STATE_TRANSITION_PROOF",
    "data": "0x..."
  },
  "timestamp": "2024-03-15T10:30:00Z"
}

DeFi Protocol Integration Guide

How DeFi developers should interpret OIP v0.3 Lock Status:

// Example Lock Status verification in DeFi protocol
async function canExecuteTrade(assetId: string): Promise<boolean> {
  const assetState = await oraclizerAPI.getAssetState(assetId);
  
  // Check primary state
  if (assetState.lockStatus.primary === "TERMINATED") {
    return false;
  }
  
  if (assetState.lockStatus.primary === "SEIZED") {
    return false;
  }
  
  // RESTRICTED may be conditionally allowed
  if (assetState.lockStatus.primary === "RESTRICTED") {
    return await checkRegulatoryConditions(assetState);
  }
  
  // RESERVED allows only the reserver to trade
  if (assetState.lockStatus.primary === "RESERVED") {
    return await verifyReservation(assetId, currentUser);
  }
  
  return true; // AVAILABLE
}

Migration from v0.2 to v0.3

Converting simple Lock Status to hierarchical structure:

v0.2 Statusv0.3 Primaryv0.3 Secondary
UNLOCKEDAVAILABLE–
SOFT_LOCKEDRESERVED–
PREEMPTIVE_LOCKEDRESERVEDPROCESSING_TRANSFER
TEMP_LOCKEDRESTRICTEDPENDING_VERIFICATION
HARD_LOCKEDRESTRICTEDUNDER_REVIEW
PERM_LOCKEDSEIZEDAWAITING_CLEARANCE

Conclusion: Design Philosophy That Embraces Complexity

We realized that the complexity of asset state management is an intrinsic characteristic that cannot be resolved through simplification. To fully reproduce the legal-economic complexity of real-world financial systems on-chain, we need tools that can structure and manage that complexity.

The Hierarchical Lock Status architecture and State Transition Automata we developed are the first attempts to handle such complexity. While not perfect, they provide an extensible and adaptable foundation.

“Do not fear complexity, but structure complexity beautifully. That is true engineering.”

In our next research, we plan to explore real-time regulatory compliance verification mechanisms based on this state management architecture. The journey of state synchronization continues.


References

[1]. Lamport, L. (1978). Time, Clocks, and the Ordering of Events in a Distributed System. Communications of the ACM, 21(7), 558-565.

[2]. Gray, J., & Reuter, A. (1992). Transaction Processing: Concepts and Techniques. Morgan Kaufmann Publishers.

[3]. Financial Stability Board. (2023). Regulation, Supervision and Oversight of Crypto-Asset Activities and Markets. https://www.fsb.org/2023/07/high-level-recommendations-for-the-regulation-supervision-and-oversight-of-crypto-asset-activities-and-markets-final-report/

[4]. Bernstein, P. A., & Newcomer, E. (2009). Principles of Transaction Processing. Academic Press.

[5]. FATF. (2023). Updated Guidance for a Risk-Based Approach to Virtual Assets and Virtual Asset Service Providers. https://www.fatf-gafi.org/publications/fatfrecommendations/documents/guidance-rba-virtual-assets-2021.html

Subscribe

New research, by email.

  • One email when a new article is published
  • Confirm once, leave with one click
  • Privacy