Skip links

Asset State Management Complexity: Introducing Lock Status Architecture

A simple residential breaker panel connected to a newly installed hierarchical industrial distribution board with primary, secondary, regulatory, and temporal control sections, visualizing the evolution from OIP v0.2's flat lock states to the structured hierarchical lock status architecture

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.

Early design notes where the v0.2 flat lock model broke under simultaneous regulatory commands, prompting the shift toward hierarchical state architecture.

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:

Primary lock states form concentric precedence rings: inner states yield to outer states, while regulatory context and temporal constraints govern transitions orthogonally.

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;
  private conflictResolver: ConflictResolver;
  
  async executeTransition(
    currentState: HierarchicalLockStatus,
    trigger: StateTransitionTrigger,
    context: TransitionContext
  ): Promise {
    
    // 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 Architecture
Primary States
AVAILABLE
Freely tradable
RESERVED
Temporarily reserved
RESTRICTED
Conditionally limited
SEIZED
Regulatory seizure
TERMINATED
Final state
Secondary States
PENDING_VERIFICATION UNDER_REVIEW AWAITING_CLEARANCE PROCESSING_TRANSFER COOLING_DOWN
Authority Hierarchy
Priority 10 Court Orders
Priority 8 National Regulators (SEC, FCA, MAS)
Priority 6 International Bodies (FATF, IOSCO)
Priority 4 Industry Regulators (FINRA, ESMA)
Temporal Constraints
AUTO_EXPIRY Scheduled release
CONDITIONAL_RELEASE Precondition unlock
PERIODIC_REVIEW Recurring check
Valid State Transitions
FromValid Next StatesReg. Action
AVAILABLERESERVED, RESTRICTED, SEIZED
RESERVEDAVAILABLE, RESTRICTED
RESTRICTEDAVAILABLE, SEIZEDFREEZE, RESTRICT
SEIZEDRESTRICTED, TERMINATEDSEIZE, CONFISCATE
TERMINATED(Final state)CONFISCATE, LIQUIDATE

Figure 1: Hierarchical Lock Status Architecture for Complex Asset State Management

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;
  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 {
    
    // 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 {
    
    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
1
Preparation
PREPARING
Ethereum
Locking asset state
txn: 0x1a2b3c…
Validate
Base
Preparing lock change
gas: 125,000
Reserve
Polygon
Validating reg. context
authority: SEC (P:8)
Prepare
2
Atomic Commit
COMMITTING
Ethereum
Broadcasting transaction
block: 18,742,591
Broadcast
Base
Executing state change
confirmation: pending
Execute
Polygon
Updating reg. status
checkpoint: 47,592
Verify
3
Finalization
FINALIZING
Ethereum
Asset locked successfully
REGULATORY_LOCKED
Confirm
Base
State synchronized
hash: 0xabc123…
Finalize
Polygon
Reg. context updated
authority acknowledged
Complete
Failure Recovery Mechanism
Detect partial failure on any chain
Initiate immediate rollback sequence
Release all prepared locks atomically
Restore original asset states
Log failure reason for analysis
2.3s
Avg Latency
99.7%
Success Rate
3
Max Retries
0.1%
Rollback Rate

Figure 2: Cross-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; // Memory cache
  private l2Cache: RedisCache;               // Distributed cache  
  private l3Storage: PersistentStorage;      // Persistent storage
  
  async getAssetState(assetId: string): Promise {
    // 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 {
    // 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];
}

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 {
  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/fsb-finalises-global-regulatory-framework-for-crypto-asset-activities/

[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

Read Next

Cross-Domain State Preservation Proofs Are Now Public and Verifiable
Oraclizer's cross-domain state preservation proofs are now public: we proved and machine-verified that a regulated asset's state stays consistent across public blockchains, enterprise ledgers, and off-chain systems. The full proof is open source under BSD-3-Clause, so it is not a promise to trust but a result anyone can build and check.
Oraclizer Core ⋅ Jun 24, 2026
Three Category Axioms, One Proved Functor
A research-journal account of mechanizing the functor laws and the degree-hierarchy natural transformation in Isabelle/HOL, where the obstacles were almost never the mathematics. The measure decrease I feared closed at once; a reserved keyword broke seven builds; a finiteness clash forced a redefinition; and the code overturned my belief that glue gives validity.
Oraclizer Core ⋅ Jun 06, 2026
Insurance and Recovery Economics: Preparing for Black Swan Events
Earlier designs cut node risk by 73%, but the unpredictable 27% needs different rules. This study fixes how a staking insurance pool is sized (15% of stake, not protected value), bootstrapped, and banded; why a reserve held in its own token collapses with it; and how session protection follows the sync-degree hierarchy when security breaks mid-session.
Oraclizer Core ⋅ May 29, 2026
Tokenized Securities Under the CLARITY Act: The Weight of Codification
The CLARITY Act tokenized securities clause settles a single proposition in statute: tokenization is a delivery method, not a new asset class. That one sentence codifies the regulatory status of tokenized securities in U.S. law for the first time and derives an entire infrastructure specification for boundaries the token crosses.
Oraclizer Core ⋅ May 23, 2026