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_LOCKEDtoHARD_LOCKEDstate - Conflict handling between
TEMP_LOCKEDexpiration timing andREGULATORY_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]);
}
}
| From | Valid Next States | Reg. Action |
|---|---|---|
| AVAILABLE | RESERVED, RESTRICTED, SEIZED | — |
| RESERVED | AVAILABLE, RESTRICTED | — |
| RESTRICTED | AVAILABLE, SEIZED | FREEZE, RESTRICT |
| SEIZED | RESTRICTED, TERMINATED | SEIZE, 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 };
}
}
}
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
| State | Meaning | Valid Next States | Regulatory Action Mapping |
|---|---|---|---|
| AVAILABLE | Freely tradable | RESERVED, RESTRICTED, SEIZED | – |
| RESERVED | Temporarily reserved for specific transaction | AVAILABLE, RESTRICTED | – |
| RESTRICTED | Conditionally limited (only certain trades allowed) | AVAILABLE, SEIZED | FREEZE, RESTRICT |
| SEIZED | Completely seized by regulatory authority | RESTRICTED, TERMINATED | SEIZE, CONFISCATE |
| TERMINATED | Asset 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 stateUNDER_REVIEW: Regulatory authority review in progress in RESTRICTED stateAWAITING_CLEARANCE: Awaiting court decision in SEIZED statePROCESSING_TRANSFER: Executing cross-chain transfer in RESERVED stateCOOLING_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 Status | v0.3 Primary | v0.3 Secondary |
|---|---|---|
| UNLOCKED | AVAILABLE | – |
| SOFT_LOCKED | RESERVED | – |
| PREEMPTIVE_LOCKED | RESERVED | PROCESSING_TRANSFER |
| TEMP_LOCKED | RESTRICTED | PENDING_VERIFICATION |
| HARD_LOCKED | RESTRICTED | UNDER_REVIEW |
| PERM_LOCKED | SEIZED | AWAITING_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





