Building · Industrial infrastructure AI · Oracles · Blockchain for industry Remote · Global

White papers

05
Combined system v1.0 Arbitrum One · Ethereum L1
Ukiyo Network · Combined Technical White Paper

Ukiyo Network

A production-verified credit system for the industrial economy
Document type: Combined system white paper · Version 1.0
Execution environment: Arbitrum One · Settlement root: Ethereum L1
Components: SPOOL Protocol · Fulfillment Oracle · Agency for Smart Contracts
Classification: Public

1. Executive Summary

Ukiyo Network builds AI, oracle, and blockchain systems that make industrial production legible in real time, and turn that legibility into credit and settlement at industrial scale. The network is a single system composed of three layers, each answering a distinct question that industrial credit depends on.

The Fulfillment Oracle answers what is true about a production order. The Agency for Smart Contracts answers what may be done on the basis of that truth. SPOOL Protocol answers what credit and settlement follows. Together they form an unbroken chain from factory floor to on-chain credit, with attested evidence at the base, bounded authority in the middle, and capital movement at the top.

The network deploys on Arbitrum One for execution and anchors to Ethereum L1 for finality. Arbitrum's ~250ms block time makes continuous risk response viable, EIP-4844 blob economics make frequent oracle attestation affordable, and Stylus runs compute-heavy credit logic in Rust at a fraction of EVM gas costs. The result is a credit system that responds to production as it happens rather than at quarterly reporting intervals.

2. The Network Thesis

Industrial finance is constrained not by a shortage of capital but by a shortage of legible, continuous, verifiable information about production. Lenders cannot observe the factory floor; they observe documents about the factory floor, delivered weeks after the fact.

Where production can be observed in real time and attested cryptographically, credit can be priced and executed in real time as well. Each of the three layers removes one specific obstacle to that outcome.

AI, oracle, and blockchain systems that make production legible in real time — and turn that truth into markets, credit, and settlement at industrial scale.
ObstacleLayer that removes itMechanism
Evidence is slow, documentary, and single-sourcedFulfillment OracleContinuous multi-source fusion, cryptographic attestation, fail-closed publication
Automation is either unbounded or too slowAgency for Smart ContractsAllowlisted actions, argument bounds, simulation gating, human escalation
Credit terms are periodic rather than continuousSPOOL ProtocolScore-linked advances, continuous repricing, automated repayment waterfall

3. System Architecture: Three Layers, One System

The three layers are not independent products. They form a directed dependency chain in which each layer consumes the output of the one beneath it and produces an input for the one above it.

Industrial production → Fulfillment Oracle → Agency for Smart Contracts → SPOOL Protocol → On-chain credit & settlement

SPOOL Protocol — credit and settlement

A production-verified credit network where AI agents watch fulfillment oracles and execute allowlisted smart-contract actions: minting order NFTs, funding industry spools, and advancing stablecoins to suppliers.

Fulfillment Oracle — evidence

Oracle agents fuse ERP, computer vision, and logistics into a live Fulfillment Probability Score, cryptographically attested so agents never trust a PDF or a single opaque server.

Agency for Smart Contracts — governance

Policy-bounded DeFi agents that sit between live oracle feeds and on-chain markets, executing only allowlisted risk actions and escalating high-impact moves to human multi-sig.

3.1 Layer responsibilities

LayerHoldsProducesNever does
Fulfillment OracleData connectors, scoring models, attestation keysAttested Fulfillment Probability ScoresMove funds, decide policy, hold capital
Agency for Smart ContractsPolicy engine, allowlists, multi-sig authorityApproved or escalated call decisionsProduce evidence, hold capital
SPOOL ProtocolOrder NFTs, industry spools, stablecoin balancesCredit positions, advances, settlementsProduce evidence, decide its own policy

3.2 Trust boundaries

Each boundary between layers is a point where a security property is either preserved or lost. No single layer's compromise is sufficient to move capital outside policy.

BoundaryCrossing mechanismProperty enforced
Industrial → OracleERP APIs, computer vision, logistics feedsSource diversity; no single feed is authoritative
Oracle → AgencyEIP-712 attested score publicationProvenance and integrity; freshness window
Agency → SPOOLIPolicyEngine.evaluate gateAllowlist, argument bounds, simulation state diff
SPOOL → L2/L1Arbitrum execution, Ethereum settlement rootFinality per action class; sequencer failure containment

4. Component Relationship Matrix

Every layer connects to every other layer in a defined direction. The matrix below is the authoritative statement of those connections.

From ↓ / To → Fulfillment Oracle Agency for Smart Contracts SPOOL Protocol
Fulfillment Oracle — Supplies attested scores the Agency watches; state transitions (Paused, Degraded) are escalation inputs Supplies attested scores SPOOL verifies before any order state change
Agency for Smart Contracts Reads scores; treats Oracle state transitions as triggers — Gates every SPOOL-mutating call; escalates high-impact actions to multi-sig
SPOOL Protocol Defines order identifiers (supplierId, buyerId, deadline) the Oracle scores against Provides the state the Agency simulates against and the targets its allowlist names —

4.1 Dependency properties

RelationshipTypeFailure propagation
Oracle → SPOOLHard dependencyOracle Paused halts new advances via the freshness window
Oracle → AgencyHard dependencyOracle Paused triggers Agency escalation
Agency → SPOOLHard dependency for agent actionsAgency Paused stops new agent actions; settlement in flight completes
SPOOL → AgencySimulation dependencySPOOL Paused causes Agency advance proposals to revert and escalate
SPOOL → OracleIdentifier dependencyMissing order identifiers leave scores unbound; credit cannot proceed
Agency → OracleObservation dependencyMissed state transition means the Agency continues proposing against a fail-closed Oracle

4.2 What each layer guarantees to the others

LayerGuarantees to the network
Fulfillment OracleScores are attested by authorized signers; stale scores are distinguishable from valid ones; publication fails closed when feeds go dark; L1 anchoring continues independently of L2 publication.
Agency for Smart ContractsNo agent call reaches SPOOL unless it passes the allowlist, argument bounds, and simulation; high-impact actions require multi-sig; keys and limits never enter model context.
SPOOL ProtocolOrder state transitions are guarded by caller and state; advances are bounded by the attested score; the repayment waterfall cannot be blocked by a failing recipient; losses apply to junior capital first.

5. The Fulfillment Oracle — Evidence Layer

The Oracle converts physical production data into a form that on-chain contracts can verify and act upon. It does not custody funds and does not execute credit actions; its authority is limited to attesting a score.

5.1 Ingestion

Three data classes are ingested, each with different latency, schema, and reliability characteristics.

SourceTypical latencySchema volatilityHandling
ERP APIsMinutes to hoursHigh (vendor-specific)Connector layer with per-vendor adapters
Computer visionSecondsLow (image + metadata)Streaming inference pipeline
Logistics APIsMinutesMediumPolling plus webhook ingestion
erp.orders.raw  ──┐
vision.frames   ──┼──▶ normalizer ──▶ production.events.normalized ──▶ scorer
logistics.ship  ──┘

The normalizer rejects events with missing required fields rather than imputing them silently. Silent imputation produces a score that appears valid but is not grounded in observed production.

5.2 Scoring

The Fulfillment Probability Score is a continuous estimate of on-time, to-specification fulfillment, produced by a PyTorch model.

Feature familyExamplesSource
Order characteristicsNotional, lead time, complexity, deadline slackERP
Production velocityUnits completed per shift, cycle time trendERP, vision
Quality signalsDefect rate, rework events, visual anomaly scoreVision
Supplier historyOn-time rate, past delays, capacity utilizationERP
Logistics stateCarrier status, transit time deviation, port congestionLogistics

The model outputs a calibrated probability, not a raw logit. Calibration is monitored per vertical, because a shift in Auto does not imply a shift in Pharma.

5.3 Attestation

Attestation turns a score into evidence. Consumers verify EIP-712 typed data signatures that bind the score to a domain (chain ID, verifying contract) and a structured payload.

bytes32 constant SCORE_TYPEHASH = keccak256(
    "Score(bytes32 orderId,uint16 scoreBps,uint64 timestamp,bytes32 dataRoot)"
);

struct Score {
    bytes32 orderId;
    uint16  scoreBps;
    uint64  timestamp;
    bytes32 dataRoot; // Merkle root of supporting evidence
}

function verifyScore(
    Score calldata s,
    bytes calldata signature,
    address authorizedOracle
) internal view returns (bool) {
    bytes32 digest = _hashTypedDataV4(
        keccak256(abi.encode(SCORE_TYPEHASH, s.orderId, s.scoreBps, s.timestamp, s.dataRoot))
    );
    return ECDSA.recover(digest, signature) == authorizedOracle;
}

Threshold signatures (k-of-n oracle nodes) are supported for scores that carry higher weight, preventing any single signer from publishing a score unilaterally.

5.4 Fail-closed publication

StateTriggerBehavior
NormalAll feeds fresh; model healthyPublish scores to Arbitrum
DegradedOne feed stale; model drift detectedPublish with uncertainty flag; consumers may widen haircuts
PausedCritical feed absent or attestation failureStop publishing; emit pause event
RecoveringFeeds restored; model re-validatedResume with conservative scores; monitor

Consumers distinguish "no score" from "score of zero." The registry exposes lastPublishedAt and state so a consumer can reject a score older than its freshness window. L1 root anchoring halts when the Oracle enters Paused, so consumers relying on the root see the same fail-closed signal.

6. The Agency for Smart Contracts — Governance Layer

The Agency holds authority and constraints. It never holds capital and never produces evidence. Its authority is bounded by enumeration: an action is permitted only if it appears on the allowlist, passes argument-level bounds, and survives simulation.

6.1 Policy engine

interface IPolicyEngine {
    struct Policy {
        address target;        // contract the agent may call
        bytes4  selector;      // function selector allowed on target
        uint256 maxValue;      // max native/stablecoin value per call
        uint64  validAfter;    // time window start
        uint64  validUntil;    // time window end
        bool    enabled;
    }

    function setPolicy(bytes32 policyId, Policy calldata p) external onlyGovernance;
    function evaluate(
        address agent,
        address target,
        bytes4 selector,
        uint256 value,
        bytes calldata data
    ) external view returns (bool allowed, string memory reason);
}

The engine stores policies, not intentions. The agent supplies the intended call; the engine decides whether that call is permitted. An empty allowlist authorizes nobody; an empty blocklist authorizes everybody.

6.2 Allowlist and argument bounds

mapping(address => mapping(bytes4 => bool)) public allowedSelector;

function evaluate(...) external view returns (bool, string memory) {
    if (!allowedSelector[target][selector]) {
        return (false, "SELECTOR_NOT_ALLOWED");
    }
    if (value > maxValue[target][selector]) {
        return (false, "VALUE_EXCEEDS_LIMIT");
    }
    return (true, "");
}

Selector filtering alone is insufficient when a single function can be called with dangerous arguments. Argument-level policy decodes calldata and enforces bounds:

function checkAdvanceArgs(bytes calldata data) internal pure returns (bool) {
    (, uint256 amount) = abi.decode(data[4:], (uint256, uint256));
    return amount <= MAX_ADVANCE;
}

6.3 Simulation gate

Before execution, the agent simulates the proposed call against a forked Arbitrum state. Simulation detects calldata errors and produces a state diff compared against expected bounds.

ActionExpected state diffRejection condition
PausePaused flag = true; no balance changesAny balance change
RepriceSpread parameter changes within boundsSpread outside [min,max]
NotifyEvent emitted; no storage changeUnexpected storage write
AdvanceOutstanding increases by amountAmount ≠ intended; recipient unexpected

6.4 Escalation

CriterionEscalation triggerRationale
ValueCall value above thresholdLarge transfers warrant human review
IrreversibilityAction cannot be undoneErrors are permanent
ScopeAction affects protocol-wide parameterSystemic impact
NoveltySelector not previously exercisedUnfamiliar code path

The multi-sig is a threshold scheme (m-of-n) with signers using hardware wallets or MPC. The policy engine enforces that escalated actions are only executable by the multi-sig address, so the agent cannot bypass escalation even if compromised.

6.5 Key separation

  1. Model context separation: the model receives observations and outputs proposals; it does not receive secrets.
  2. Signing separation: the signer is a separate service (HSM, MPC, or hardware wallet) that accepts only policy-approved calldata.
  3. Policy separation: policy parameters are stored on-chain and changed only through timelocked governance anchored to Ethereum L1.

7. SPOOL Protocol — Credit and Settlement Layer

SPOOL holds and moves capital. It never produces evidence and never decides its own policy. Every SPOOL-mutating call initiated by an agent passes through the Agency first.

7.1 Order NFT

interface IOrderNFT is IERC721 {
    struct OrderData {
        bytes32 supplierId;
        bytes32 buyerId;
        uint256 notional;
        uint64  createdAt;
        uint64  deadline;
        OrderState state;
        bytes32 latestAttestationHash;
        uint16  fulfillmentScoreBps; // 0–10000
    }
    enum OrderState { Created, Funded, InProduction, Shipped, Delivered, Settled, Defaulted }

    function mintOrder(OrderData calldata data) external returns (uint256 tokenId);
    function updateState(uint256 tokenId, OrderState newState) external;
    function attachAttestation(uint256 tokenId, bytes32 attestationHash) external;
    function orderData(uint256 tokenId) external view returns (OrderData memory);
}
TransitionPreconditionAuthorized callerOn-chain effect
Created → FundedSpool has sufficient liquidity; Agency approvedSpool contractAdvance recorded against order
Funded → InProductionSupplier confirms start; score above thresholdAgent (allowlisted)Milestone logged
InProduction → ShippedLogistics event attestedOracle callbackScore updated
Shipped → DeliveredBuyer receipt attestedOracle callbackRepayment scheduled
Any → DefaultedScore below floor or deadline exceededAgent or multi-sigSpool loss allocation

7.2 Industry spools

interface ISpool {
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);
    function withdraw(uint256 shares, address receiver, address owner) external returns (uint256 assets);
    function fundOrder(uint256 orderTokenId, uint256 amount) external onlyRole(FUNDER_ROLE);
    function totalAssets() external view returns (uint256);
    function totalShares() external view returns (uint256);
    function convertToShares(uint256 assets) external view returns (uint256);
    function convertToAssets(uint256 shares) external view returns (uint256);
}

Senior and junior tranches are held in separate share classes, with a subordination invariant enforced after every loss allocation:

juniorAssets >= seniorAssets * juniorRatioBps / 10000

When a default occurs, losses apply to junior capital first. A breach of the invariant triggers the spool into a Paused state.

7.3 Advances and repayment

advance = notional * advanceRatioBps / 10000 * scoreBps / 10000

advanceRatioBps is a per-vertical parameter and scoreBps is the latest attested Fulfillment Probability Score. The product form means a declining score linearly reduces available liquidity.

  1. Buyer payment is received by escrow or a designated settlement address.
  2. Principal is returned to the spool.
  3. Accrued interest is distributed according to the tranche structure.
  4. Any residual is released to the supplier.

The waterfall uses a pull-payment pattern so a failing recipient cannot block settlement.

7.4 Merkle-verified order metadata

Supporting documents—ERP snapshots, inspection reports, logistics records—are batched into Merkle trees. Only the Merkle root is stored on-chain; per-order leaves are published off-chain and verified on demand.

8. Cross-Layer Interfaces

The layers communicate through three narrow interfaces. Each is small enough to audit and to reason about in isolation.

8.1 Oracle → SPOOL: score delivery

interface IFulfillmentConsumer {
    function onScoreUpdate(
        bytes32 orderId,
        uint16  scoreBps,
        uint64  timestamp,
        bytes   calldata attestation
    ) external;
}

The callback verifies that timestamp is within a freshness window and that the attestation recovers to an authorized oracle signer before updating any order state. If verification fails, the callback reverts and the order remains in its prior state.

8.2 Agency → SPOOL: gated execution

Every agent-initiated SPOOL call is routed through the policy engine. The engine validates the (target, selector, value) triple and decodes the arguments before forwarding.

function executeGuarded(
    address target,
    bytes calldata data,
    uint256 value
) external onlyAgent returns (bytes memory) {
    bytes4 selector = bytes4(data[:4]);
    (bool allowed, string memory reason) = policyEngine.evaluate(
        msg.sender, target, selector, value, data
    );
    require(allowed, reason);
    (bool ok, bytes memory ret) = target.call{value: value}(data);
    require(ok, "CALL_FAILED");
    return ret;
}

8.3 SPOOL → Agency: simulation state

The Agency's simulation stage forks Arbitrum state and executes the proposed SPOOL call against it. The resulting state diff is compared to the expected diff for that action class. SPOOL does not need to expose a dedicated simulation interface; the fork runs against the deployed contract bytecode.

function test_simulateAdvance_onArbitrum() public {
    vm.createSelectFork(vm.envString("ARBITRUM_RPC_URL"));
    uint256 orderId = _mintTestOrder();
    uint256 advance = spool.previewAdvance(orderId);
    vm.prank(agent);
    spool.fundOrder(orderId, advance);
    assertEq(spool.advances(orderId), advance);
}

9. End-to-End Flow: A Worked Transaction

The following traces a single advance from production event to settlement, naming the layer responsible at each step.

#LayerActionOutput
1OracleERP, vision, and logistics streams are fused; the scorer computes a Fulfillment Probability Score for order #1234.Score: 8,750 bps
2OracleThe score is signed as EIP-712 typed data and published to the Arbitrum registry. A Merkle root is anchored to L1 hourly.Attested score on Arbitrum
3AgencyThe agent observes the score change and proposes an advance of 50,000 USDC against order #1234.Proposed calldata
4AgencyIPolicyEngine.evaluate confirms the selector is allowlisted and the amount is within bounds.Allowed
5AgencyThe agent forks Arbitrum state, executes the proposed call, and confirms the state diff matches the expected advance.Simulation passed
6AgencyIf the amount exceeded the escalation threshold, the call would route to multi-sig. At 50,000 USDC it is within the agent's autonomous bound.Execute
7SPOOLfundOrder verifies the order is in Created state, the spool has liquidity, and the attached score is fresh.Order → Funded
8SPOOLStablecoins are transferred to the supplier under a pull-payment pattern.Supplier receives 50,000 USDC
9OracleSubsequent production events update the score; a decline triggers an Agency reprice proposal.Updated score
10AgencyThe reprice is proposed, evaluated, simulated, and executed within bounds.Spread adjusted
11SPOOLBuyer payment settles; the waterfall returns principal, distributes interest, and releases residual.Order → Settled

At no point does the Oracle move funds, does the Agency hold capital, or does SPOOL decide its own policy. Each step crosses exactly one boundary, and each boundary has a defined check.

10. Arbitrum L2 Architecture

The network deploys on Arbitrum One as its primary execution environment, with Ethereum L1 as the settlement root.

10.1 Cost model

Arbitrum fees have two components: L2 execution gas and L1 data posting. EIP-4844 blobs reduced L2 posting costs by 10–100× compared to calldata, with post-Dencun typical fees falling to fractions of a cent. Per-order state transitions and frequent oracle attestations are therefore economically viable.

OperationTypical cost driverDesign
Mint order NFTStorage writesPack state, score, and timestamps into one slot
State transitionStorage write + eventEvent-based indexing; registry stores only latest
Oracle attestationCalldata + signature verifyBatch multiple orders per attestation tx
Advance / repayToken transfer + accountingPull-payment waterfall to avoid push failures

10.2 Finality model

Arbitrum exposes three confirmation levels. Soft finality (latest) is a sequencer promise, sub-second but reversible. Parent-chain safe (safe) means the batch is posted and the containing block has reached Ethereum's safe block—roughly 12–15 minutes, revertible only by a deep parent-chain reorg. Parent-chain final (finalized) means the batch has reached Ethereum's finalized block.

ActionFinality requiredRationale
Pause advanceSoft (sequencer, sub-second)Risk-reducing; safe under any outcome
Reprice spreadSoftReversible; next tick can correct
Advance stablecoinsParent-chain safe (~12–15 min)Irreversible value transfer
Repayment settlementParent-chain finalCloses credit position

The native L1 withdrawal bridge carries a ~7-day optimistic challenge period. Small repayments settle entirely on Arbitrum; large repayments requiring L1 settlement either disclose the challenge period or route through a fast bridge with explicit counterparty risk disclosure.

10.3 Sequencer failure

Arbitrum's sequencer is currently operated by the Arbitrum Foundation with a decentralization roadmap. Sequencer unavailability is distinct from oracle feed loss and is handled separately.

  • Detection: block height monitored; a stall beyond 30 seconds (roughly 120 missed blocks) triggers degraded mode.
  • Containment: no new advances are proposed; outstanding positions remain open; submitted risk-reducing actions remain valid.
  • Recovery: critical pause actions are force-included via the Arbitrum delayed inbox on L1.
  • Policy: the policy engine records the maximum acceptable staleness of sequencer confirmation; beyond it, escalation triggers automatically.

10.4 Stylus

Arbitrum Stylus introduces a coequal WebAssembly virtual machine alongside the EVM, allowing contracts written in Rust to compile to WASM and run alongside Solidity contracts sharing the same state tree. Rust-compiled WASM contracts execute faster with significantly lower gas fees: 4–10× cost savings in AMM-style workloads and 100–500× cheaper memory for compute-intensive operations.

ComponentLayerRuntimeWhy
Order NFT, spool accounting, access controlSPOOLSolidityStorage-heavy, integration-heavy
Advance calculation, score aggregation, invariant checkingSPOOLStylus (Rust)Compute-heavy, memory-intensive
Policy evaluationAgencySolidityIntegration with call forwarding
Score verificationOracle consumersSolidityEIP-712 recovery is EVM-native

Cross-contract calls use the shared state tree, so no bridge is needed between the two VMs.

10.5 Timeboost

Arbitrum Timeboost provides an optional express lane that grants a controller priority inclusion for a short window. In the default configuration, express-lane transactions are processed immediately while others face a ~200ms delay. The Agency uses Timeboost for risk-reducing actions that should not queue behind routine traffic.

ActionTimeboost useRationale
PauseRecommendedRisk-reducing; latency matters
RepriceRecommendedTime-sensitive; spread must track score
NotifyOptionalEvent-only; latency less critical
AdvanceNot usedIrreversible; waits for parent-chain safe finality

Empirical analysis of Timeboost (April–July 2025, 11.5 million express-lane transactions) found that express-lane control is highly centralized, with two entities winning more than 90% of auctions, and that auction competition declined over time. Timeboost is therefore an optimization for risk-reducing actions only, never a security dependency, and never used for value-moving actions.

10.6 Network allocation

WorkloadNetworkReason
SPOOL credit contractsArbitrum OneStylus for compute, Timeboost for agent latency
Consumer-facing UI, supplier portalBaseCoinbase distribution, cheaper simple transfers
L1 settlement root, governance timelockEthereumCanonical finality

Cross-chain state is reconciled explicitly: a supplier advancing on Arbitrum and receiving on Base implies a bridge hop that is accounted for in repayment timing and risk disclosure.

11. Security Model: Separation of Powers

The network's central security property is that no single component's compromise is sufficient to move capital outside policy.

ComponentHoldsIf compromisedBlast radius
Fulfillment OracleAttestation keysFalse scores could be publishedBounded by SPOOL's freshness window and the Agency's simulation; no direct fund movement
Agency (agent)Proposal capabilityMalicious calldata proposedRejected by policy engine unless allowlisted and simulated; escalation prevents high-impact execution
Agency (policy)Allowlists, boundsOverly permissive policyGovernance timelock on L1 allows reversal; emergency pause available
SPOOLCapitalContract bugBounded by invariants; spool pause and junior-first loss allocation contain damage
Multi-sigEscalated authorityCollusionRequires m-of-n compromise; independent signers with hardware custody
Agents propose; contracts enforce; keys and limits stay off-model.

The same principle applies at every layer. The Oracle proposes a score; SPOOL's freshness check enforces it. The agent proposes a call; the policy engine enforces it. The agent proposes a high-impact action; the multi-sig enforces it.

12. Failure Coupling and Degraded Modes

The layers are coupled by design, and the coupling is directional. Each component's state change propagates to the others in a defined way.

TriggerSPOOLAgencyOracle
Oracle → PausedAdvances halt via freshness window; repayments continueEscalation triggered; no new advances proposed—
Oracle → DegradedAdvances reduce proportionally to the conservative scoreReprice proposed within bounds—
Agency → PausedSettlement in flight completes; no new agent actions—Publication continues
SPOOL → Paused—Advance proposals revert and escalatePublication continues
Sequencer stallNo new state changesDegraded mode; force-include pause via L1 delayed inboxL1 root anchoring continues independently
Multi-sig unavailableExisting positions continue to settleHigh-impact actions blocked; risk-reducing actions still execute within agent boundsPublication continues

Each degraded mode is a controlled reduction in capability rather than a cascade. An Oracle pause stops new credit but does not prevent repayment. An Agency pause stops new agent actions but does not stop settlement. A SPOOL pause stops advances but does not blind the Oracle.

13. Testing and Verification Strategy

LayerScopeTooling
UnitIndividual functions, state transitionsFoundry forge test
IntegrationSpool + order NFT + oracle callbackFoundry with mock oracle
ForkReal Arbitrum state, real stablecoinsvm.createSelectFork(ARBITRUM_RPC_URL)
InvariantSystem-wide properties under fuzzingFoundry invariant testing
Cross-layerOracle → Agency → SPOOL end-to-endFork suite with all three contracts deployed
Failure drillSequencer stall, Oracle pause, policy rejectionSimulated state + delayed-inbox path

The cross-layer suite verifies that a score change correctly propagates through the Agency's evaluation and produces the expected SPOOL state diff, and that a rejected call escalates rather than retries.

14. Deployment Topology and Observability

ComponentDeploymentAnchor
SPOOL contractsArbitrum OneEthereum settlement root
Agency policy engine + multi-sigArbitrum OneEthereum governance timelock
Oracle registryArbitrum OneEthereum Merkle root, hourly
Consumer surfacesBaseReads via signed off-chain payloads

Observability covers chain-specific and cross-layer signals: Arbitrum sequencer liveness, L1 finality lag, attestation freshness, policy rejection rate, escalation frequency, and spool utilization per tranche. Alerts fire when any of these crosses a threshold, and the agent runtime treats sequencer staleness as a fail-closed trigger independent of Oracle status.

15. Governance

Policy and contract changes are high-impact and are governed with a timelock anchored to Ethereum L1. The timelock gives users time to exit if a change is hostile, and gives defenders time to react to a compromised governance key.

  • Timelock delay: sufficient for the protocol's risk profile (48–72 hours).
  • Policy versioning: each policy set has a version hash; consumers verify which policy was active at execution time.
  • Emergency pause: a separate, narrower mechanism on Arbitrum that can pause but not unpause or upgrade.
  • L1 anchor: the timelock and policy version root live on Ethereum, so governance changes inherit L1 finality even though execution happens on Arbitrum.

16. Risk Factors

  • Evidence risk. The network's credit decisions rest on the Fulfillment Probability Score. Model error or source corruption propagates through every downstream layer.
  • Governance risk. Allowlists and escalation thresholds determine whether the Agency prevents unbounded automation or merely relocates it.
  • Execution risk. Smart contracts governing credit and stablecoin movement are exposed to implementation defects and adversarial exploitation.
  • Industrial counterparty risk. Suppliers and buyers in real supply chains may default, delay, or fail to meet specification.
  • Systemic coupling. Because the three layers are interdependent, a failure at one layer is not isolated from the others; the failure matrix in Section 12 defines the propagation.
  • L2 risk. Sequencer centralization, delayed hard finality, and the ~7-day L1 withdrawal challenge period apply to the Arbitrum deployment.
  • Regulatory risk. Tokenized credit, stablecoin advances, and cross-border industrial finance are subject to evolving regulation across jurisdictions.
Disclaimer. This document is provided for informational purposes and does not constitute financial, legal, or investment advice. Digital assets and DeFi protocols carry significant risk, including total loss of capital. Stablecoin advances and industrial credit instruments may be regulated in some jurisdictions.
© 2025 Ukiyo Network. All rights reserved.
Combined system technical white paper, first edition.
Components: SPOOL Protocol · Fulfillment Oracle · Agency for Smart Contracts.
Credit layer v3.0 Credit & settlement
Ukiyo Network · Technical White Paper

SPOOL Protocol

Production-verified credit on Arbitrum
Document type: Technical white paper · Version 3.0
Execution environment: Arbitrum One · Settlement root: Ethereum L1
Classification: Public

1. Executive Summary

SPOOL Protocol is a production-verified credit network in which AI agents watch fulfillment oracles and execute allowlisted smart-contract actions: minting order NFTs, funding industry spools, and advancing stablecoins to suppliers. The protocol's operating principle is continuous rather than quarterly risk response: agents observe, decide, simulate, and then act—pausing advances, repricing spreads, and notifying buyers as production risk moves.

SPOOL deploys on Arbitrum One as its primary execution environment, with Ethereum L1 as the settlement root. Arbitrum's ~250ms block time and low fees make per-order state transitions and frequent oracle attestations economically viable, while Stylus—Arbitrum's Rust-to-WASM execution layer—runs compute-heavy credit logic at a fraction of EVM gas costs. This white paper specifies the contract architecture, finality assumptions, sequencer failure handling, Stylus split, and settlement mechanics.

2. System Context and Trust Boundaries

SPOOL operates across four trust domains. The boundaries between them are where security properties are either preserved or lost.

DomainComponentsTrust assumptionFailure impact
IndustrialERP systems, production lines, logistics providersData reflects physical production, with latencyCorrupted evidence propagates to credit decisions
OracleFulfillment Oracle agents, attestation signersScores are attested and fail closedStale or absent evidence; credit pause
ExecutionSPOOL agent runtime, policy engine, simulationAgent stays within allowlist; simulation precedes executionErroneous but bounded action
On-chain (L2)SPOOL contracts on Arbitrum OneArbitrum sequencer liveness + fraud-proof finalitySequencer downtime; delayed hard finality
On-chain (L1)Settlement root on EthereumEthereum L1 finalityFund loss or invariant violation

The separation of evidence, authority, and execution is structural. A compromised oracle cannot move funds; a compromised agent cannot exceed its allowlist; a compromised contract cannot alter the attestation history.

3. Order NFT: Token Standard and State Machine

The order NFT is SPOOL's primary coordination primitive. It represents a production order and carries the state that credit logic reads and writes.

3.1 Token standard

Each order is unique—distinct supplier, buyer, milestones, and risk parameters—so SPOOL uses ERC-721 rather than ERC-1155.

interface IOrderNFT is IERC721 {
    struct OrderData {
        bytes32 supplierId;
        bytes32 buyerId;
        uint256 notional;
        uint64  createdAt;
        uint64  deadline;
        OrderState state;
        bytes32 latestAttestationHash;
        uint16  fulfillmentScoreBps; // 0–10000
    }
    enum OrderState { Created, Funded, InProduction, Shipped, Delivered, Settled, Defaulted }

    function mintOrder(OrderData calldata data) external returns (uint256 tokenId);
    function updateState(uint256 tokenId, OrderState newState) external;
    function attachAttestation(uint256 tokenId, bytes32 attestationHash) external;
    function orderData(uint256 tokenId) external view returns (OrderData memory);
}

3.2 State machine invariants

TransitionPreconditionAuthorized callerOn-chain effect
Created → FundedSpool has sufficient liquidity; agent action approvedSpool contractAdvance recorded against order
Funded → InProductionSupplier confirms start; score above thresholdAgent (allowlisted)Milestone logged
InProduction → ShippedLogistics event attestedOracle callbackScore updated
Shipped → DeliveredBuyer receipt attestedOracle callbackRepayment scheduled
Any → DefaultedScore below floor or deadline exceededAgent or multisigSpool loss allocation

A single onlyAuthorized modifier checks both the caller and the current state, so an agent cannot skip states or re-enter a settled order.

4. Industry Spool Contracts

An industry spool is a sector-specific liquidity pool. Lenders deposit stablecoins; the spool allocates capital to order NFTs within its vertical (Auto, Pharma, Electronics).

4.1 Core accounting

interface ISpool {
    function deposit(uint256 assets, address receiver) external returns (uint256 shares);
    function withdraw(uint256 shares, address receiver, address owner) external returns (uint256 assets);
    function fundOrder(uint256 orderTokenId, uint256 amount) external onlyRole(FUNDER_ROLE);
    function totalAssets() external view returns (uint256);
    function totalShares() external view returns (uint256);
    function convertToShares(uint256 assets) external view returns (uint256);
    function convertToAssets(uint256 shares) external view returns (uint256);
}

The share/asset conversion uses a virtual offset and dead-shares mechanism to prevent first-depositor inflation attacks, the standard ERC-4626 mitigation.

4.2 Risk tranching

Senior and junior tranches are held in separate share classes, with a subordination invariant enforced after every loss allocation:

juniorAssets >= seniorAssets * juniorRatioBps / 10000

When a default occurs, losses apply to junior capital first. A breach of the invariant triggers the spool into a Paused state.

4.3 Merkle-verified order metadata

Supporting documents—ERP snapshots, inspection reports, logistics records—are batched into Merkle trees. Only the Merkle root is stored on-chain; per-order leaves are published off-chain and verified on demand. This preserves verifiability while keeping storage costs low, following the pattern established by Centrifuge V3 and other production RWA systems.

5. Stablecoin Advance and Repayment Logic

Suppliers receive stablecoin advances against verified order NFTs. Repayment is automated as fulfillment progresses and buyer payments settle on-chain.

5.1 Advance calculation

advance = notional * advanceRatioBps / 10000 * scoreBps / 10000

advanceRatioBps is a per-vertical parameter and scoreBps is the latest attested Fulfillment Probability Score. The product form means a declining score linearly reduces available liquidity, producing the intended continuous-response behavior.

5.2 Repayment waterfall

  1. Buyer payment is received by an escrow contract or a designated settlement address.
  2. Principal is returned to the spool.
  3. Accrued interest is distributed according to the tranche structure.
  4. Any residual is released to the supplier.

The waterfall uses a pull-payment pattern so a failing recipient cannot block settlement.

6. Agent Execution Pipeline

The SPOOL agent executes a four-stage cycle: observe, decide, simulate, act. This is a pipeline with a hard gate between simulation and execution.

StageInputOutputFailure behavior
ObserveLatest oracle attestations, on-chain stateStructured observation vectorIf attestation is stale, halt
DecideObservation vector, policy boundsProposed action + calldataNo action if outside allowlist
SimulateProposed calldata, Arbitrum fork of current stateSimulation trace, gas estimate, state diffAbort if simulation reverts or diff exceeds bounds
ActSimulation-approved calldataSubmitted transactionEscalate to multisig if value above threshold

Simulation runs against a forked Arbitrum state pinned to the latest block. Foundry's fork primitives (vm.createFork, vm.selectFork, vm.rollFork) allow the agent to test the exact call it intends to submit against the same contract versions deployed on Arbitrum One.

function test_simulateAdvance_onArbitrum() public {
    vm.createSelectFork(vm.envString("ARBITRUM_RPC_URL"));
    uint256 orderId = _mintTestOrder();
    uint256 advance = spool.previewAdvance(orderId);
    vm.prank(agent);
    spool.fundOrder(orderId, advance);
    assertEq(spool.advances(orderId), advance);
}

State can change between simulation and inclusion, so the simulation gate is complemented by post-execution invariant checks rather than treated as a guarantee on its own.

7. Oracle Integration Interface

SPOOL consumes attested Fulfillment Probability Scores through a narrow interface that fails closed when attestations are absent.

interface IFulfillmentConsumer {
    function onScoreUpdate(
        bytes32 orderId,
        uint16  scoreBps,
        uint64  timestamp,
        bytes   calldata attestation
    ) external;
}

The callback verifies that timestamp is within a freshness window and that the attestation recovers to an authorized oracle signer before updating any order state. If verification fails, the callback reverts and the order remains in its prior state.

8. Arbitrum L2 Architecture: Cost, Finality, and Sequencer Risk

Arbitrum One is an optimistic rollup using the Nitro stack. Execution happens on L2, data is posted to Ethereum L1, and correctness is guaranteed by interactive fraud proofs with a challenge window. The choice of Arbitrum has direct consequences for SPOOL's cost model, finality assumptions, and agent behavior.

8.1 Cost model

Arbitrum fees have two components: L2 execution gas and L1 data posting. EIP-4844 blobs reduced L2 posting costs by 10–100× compared to calldata, with post-Dencun typical fees falling to fractions of a cent. Per-order state transitions and frequent oracle attestations are therefore economically viable.

OperationTypical cost driverDesign
Mint order NFTStorage writesPack state, score, and timestamps into one slot
State transitionStorage write + eventEvent-based indexing; registry stores only latest
Oracle attestationCalldata + signature verifyBatch multiple orders per attestation tx
Advance / repayToken transfer + accountingPull-payment waterfall to avoid push failures

8.2 Finality model

Arbitrum exposes three confirmation levels. Soft finality (latest) is a sequencer promise, sub-second but reversible. Parent-chain safe (safe) means the batch is posted and the containing block has reached Ethereum's safe block—roughly 12–15 minutes, revertible only by a deep parent-chain reorg. Parent-chain final (finalized) means the batch has reached Ethereum's finalized block, revertible only if Ethereum itself reverts a finalized block. Each SPOOL action states which level it requires.

ActionFinality requiredRationale
Pause advanceSoft (sequencer, sub-second)Risk-reducing; safe under any outcome
Reprice spreadSoftReversible; next tick can correct
Advance stablecoinsParent-chain safe (~12–15 min)Irreversible value transfer
Repayment settlementParent-chain finalCloses credit position

The native L1 withdrawal bridge carries a ~7-day optimistic challenge period. Small repayments settle entirely on Arbitrum; large repayments requiring L1 settlement either disclose the challenge period or route through a fast bridge with explicit counterparty risk disclosure.

8.3 Sequencer failure

Arbitrum's sequencer is currently operated by the Arbitrum Foundation with a decentralization roadmap. Sequencer unavailability is distinct from oracle feed loss and is handled separately.

  • Detection: the agent runtime monitors Arbitrum block height; a stall beyond 30 seconds (roughly 120 missed blocks) triggers degraded mode.
  • Containment: no new advances are proposed; outstanding positions remain open; submitted risk-reducing actions remain valid.
  • Recovery: critical pause actions are force-included via the Arbitrum delayed inbox on L1.
  • Policy: the policy engine records the maximum acceptable staleness of sequencer confirmation; beyond it, escalation triggers automatically.

8.4 Network allocation

WorkloadNetworkReason
SPOOL credit contractsArbitrum OneStylus for compute, Timeboost for agent latency
Consumer-facing UI, supplier portalBaseCoinbase distribution, cheaper simple transfers
L1 settlement rootEthereumCanonical finality

Cross-chain state is reconciled explicitly: a supplier advancing on Arbitrum and receiving on Base implies a bridge hop that is accounted for in repayment timing and risk disclosure.

9. Stylus and the Rust Execution Path

Arbitrum Stylus introduces a coequal WebAssembly virtual machine alongside the EVM, allowing contracts written in Rust to compile to WASM and run alongside Solidity contracts sharing the same state tree.

9.1 What Stylus changes

Rust-compiled WASM contracts execute faster with significantly lower gas fees: 4–10× cost savings in AMM-style workloads and 100–500× cheaper memory for compute-intensive operations. Solidity remains appropriate for storage-heavy and integration-heavy contracts. The split is explicit: Solidity for state, Stylus for compute.

9.2 SPOOL components on Stylus

ComponentWhy Stylus
Advance calculationProduct of notional, ratio, and score across batched orders is compute-heavy
Score aggregationCombining multiple oracle attestations per order benefits from cheaper memory and compute
Invariant checkingPost-execution verification across all spools is compute-intensive

9.3 Interoperability and safety

Stylus contracts call Solidity and vice versa without disrupting Ethereum equivalence. Rust's memory safety and the Stylus SDK's default-disabled reentrancy reduce common vulnerability classes; the newer ecosystem implies less battle-tested tooling, so Stylus modules receive additional audit coverage before mainnet deployment.

The order NFT, spool accounting, and access control remain in Solidity. Advance preview, score aggregation, and invariant verification run in Stylus. Cross-contract calls use the shared state tree, so no bridge is needed between the two VMs.

10. Security Model and Failure Modes

FailureDetectionContainmentRecovery
Oracle attestation forgerySignature recovery mismatchCallback reverts; no state changeRotate oracle signer via governance
Stale scoreTimestamp outside freshness windowAdvances pausedOracle resumes publishing
Agent compromisedProposed selector outside allowlistPolicy contract rejectsRotate agent key
Simulation–execution divergenceState diff exceeds boundPost-execution invariant check revertsManual review
Spool insolvencyJunior tranche breachedSpool pausedGovernance recapitalization or wind-down
Sequencer stallBlock height stagnates beyond thresholdNew advances halted; degraded modeForce-include pause via L1 delayed inbox

Invariant checks are implemented as view functions that the agent calls after every action and that any external party can call to detect a breach.

11. Testing and Simulation Strategy

LayerScopeTooling
UnitIndividual functions, state transitionsFoundry forge test
IntegrationSpool + order NFT + oracle callbackFoundry with mock oracle
ForkReal Arbitrum state, real stablecoinsvm.createSelectFork(ARBITRUM_RPC_URL)
InvariantSystem-wide properties under fuzzingFoundry invariant testing

Fork testing against Arbitrum One is particularly important because SPOOL integrates with deployed stablecoin contracts and oracle infrastructure outside the team's control. The runtime pins the fork URL to the deployment chain recorded in the policy engine; simulating against the wrong chain produces misleading state diffs.

12. Deployment and Observability

Deployment targets Arbitrum One for SPOOL contracts, Ethereum L1 for the settlement root, and Base for consumer surfaces. Foundry scripts with deterministic broadcast and on-chain verification provide reproducibility.

Observability covers both chain-specific and cross-chain signals: Arbitrum sequencer liveness, L1 finality lag, attestation freshness, and spool utilization per tranche. Alerts fire when any of these crosses a threshold, and the agent runtime treats sequencer staleness as a fail-closed trigger independent of oracle status.

Disclaimer. This white paper is for informational purposes and does not constitute financial, legal, or investment advice. Digital assets and DeFi protocols carry significant risk, including total loss of capital.
© 2025 Ukiyo Network. SPOOL Protocol technical white paper, version 3.0.
Execution environment: Arbitrum One. Settlement root: Ethereum L1.
Evidence layer v3.0 Evidence & attestation
Ukiyo Network · Technical White Paper

Fulfillment Oracle

Cryptographically attested production truth on Arbitrum
Document type: Technical white paper · Version 3.0
Publication: Arbitrum One (freshness) · Ethereum L1 (finality anchor)
Classification: Public

1. Executive Summary

The Fulfillment Oracle is the evidence layer of Ukiyo Network. Oracle agents fuse ERP, computer vision, and logistics into a live Fulfillment Probability Score, cryptographically attested so that on-chain agents never trust a PDF or a single opaque server. The oracle ingests, scores, attests, publishes, and fails closed when feeds go dark.

The oracle publishes to Arbitrum One on every update—cheap under EIP-4844 blob economics—and anchors a Merkle root of all scores to Ethereum L1 periodically for hard finality. This two-tier design gives consumers both freshness and finality without paying L1 costs per score. This white paper specifies ingestion, scoring, attestation, publication, cross-chain consumption, fail-closed behavior, and security analysis.

2. Oracle Role and Trust Boundary

The oracle converts physical production data into a form that on-chain contracts can verify and act upon. It does not custody funds and does not execute credit actions; its authority is limited to attesting a score.

PropertyRequirementRationale
AuthenticityConsumer can verify which oracle produced a scorePrevents impersonation
IntegrityScore cannot be altered after attestationPrevents tampering in transit
FreshnessConsumer can reject stale scoresPrevents acting on outdated production state
Availability semanticsAbsence of score is distinguishable from a score of zeroFail-closed design requires this distinction

3. Data Ingestion Architecture

The oracle ingests three data classes, each with different latency, schema, and reliability characteristics.

SourceTypical latencySchema volatilityHandling
ERP APIsMinutes to hoursHigh (vendor-specific)Connector layer with per-vendor adapters
Computer visionSecondsLow (image + metadata)Streaming inference pipeline
Logistics APIsMinutesMediumPolling plus webhook ingestion

3.1 Streaming backbone

Kafka is the streaming backbone. One topic per source class, schema validation at ingest, and a normalized event written to a unified topic for scoring.

erp.orders.raw  ──┐
vision.frames   ──┼──▶ normalizer ──▶ production.events.normalized ──▶ scorer
logistics.ship  ──┘

The normalizer rejects events with missing required fields rather than imputing them silently. Silent imputation produces a score that appears valid but is not grounded in observed production.

4. Fulfillment Probability Score: Feature and Model Design

The Fulfillment Probability Score is a continuous estimate of on-time, to-specification fulfillment, produced by a PyTorch model. The reference feature families are standard in production-lateness prediction and are consistent with the described data sources.

Feature familyExamplesSource
Order characteristicsNotional, lead time, complexity, deadline slackERP
Production velocityUnits completed per shift, cycle time trendERP, vision
Quality signalsDefect rate, rework events, visual anomaly scoreVision
Supplier historyOn-time rate, past delays, capacity utilizationERP
Logistics stateCarrier status, transit time deviation, port congestionLogistics

The model outputs a calibrated probability, not a raw logit. Calibration is monitored after deployment and rechecked per vertical, because a shift in Auto does not imply a shift in Pharma.

4.1 Model risk controls

  • Calibration monitoring: compare predicted probabilities to realized outcomes in rolling windows.
  • Drift detection: monitor feature distributions per vertical.
  • Fallback policy: if drift exceeds a threshold, the oracle widens uncertainty or enters a degraded mode rather than publishing with false confidence.

5. Attestation Scheme

Attestation turns a score into evidence. SPOOL and downstream consumers verify EIP-712 typed data signatures that bind the score to a domain (chain ID, verifying contract) and a structured payload.

bytes32 constant SCORE_TYPEHASH = keccak256(
    "Score(bytes32 orderId,uint16 scoreBps,uint64 timestamp,bytes32 dataRoot)"
);

struct Score {
    bytes32 orderId;
    uint16  scoreBps;
    uint64  timestamp;
    bytes32 dataRoot; // Merkle root of supporting evidence
}

5.1 On-chain verification

function verifyScore(
    Score calldata s,
    bytes calldata signature,
    address authorizedOracle
) internal view returns (bool) {
    bytes32 digest = _hashTypedDataV4(
        keccak256(abi.encode(SCORE_TYPEHASH, s.orderId, s.scoreBps, s.timestamp, s.dataRoot))
    );
    return ECDSA.recover(digest, signature) == authorizedOracle;
}

The dataRoot field commits to supporting evidence—ERP snapshots, vision frames, logistics records—without putting it all on-chain. Consumers request the Merkle proof off-chain when needed.

Threshold signatures (k-of-n oracle nodes) are supported for scores that carry higher weight, preventing any single signer from publishing a score unilaterally.

6. Two-Tier Publication on Arbitrum and Ethereum

Attested scores are published through three channels. The choice of chain matters because attestation freshness and cost interact.

ChannelChainMechanismTrade-off
L2 registryArbitrum OneContract stores latest attested score per orderComposable; cheap enough to update frequently
L1 rootEthereumPeriodic Merkle root of scores anchored to L1Maximum finality; batched to control cost
Event streamArbitrum OneEmit attested score events; consumers indexCheapest; requires indexer
Off-chain API—Signed payload over HTTPSFastest; consumer verifies signature

6.1 Two-tier design

Scores are published to Arbitrum on every update and a Merkle root of all scores is anchored to Ethereum L1 hourly. Consumers that need L1 finality verify against the L1 root; consumers that need freshness read Arbitrum directly. The two tiers give both properties without paying L1 costs per score.

6.2 Why Arbitrum for the freshness tier

Arbitrum's ~250ms block time means a published score can be read by the next block. For SPOOL agents that pause or reprice on score changes, sub-second publication is materially better than a chain with multi-second blocks. The L1 root provides the hard guarantee; Arbitrum provides the operating cadence.

7. Cross-Chain Consumption and Finality

SPOOL is deployed on Arbitrum and consumer surfaces on Base, so the score must be readable on both. Three options are available:

  • Dual publication: oracle signs the same score for both chains; each chain has a registry contract.
  • Canonical plus bridge: Arbitrum is canonical; Base reads via a light-client or attestation bridge.
  • Off-chain signed payload plus on-chain verification: consumer contracts verify the signature directly, no bridge needed.

The third option is the default because it is simplest and avoids bridge risk. On-chain registries are used only where synchronous reads are required.

7.1 Freshness under L2 finality assumptions

Arbitrum's soft confirmation is a sequencer promise, reversible until the batch reaches L1. The consumer contract checks timestamp against its freshness window and, for irreversible actions, waits for parent-chain safe or parent-chain final confirmation. The registry exposes lastPublishedAt, state, and lastAnchoredRoot so consumers can choose their finality threshold.

Consumer actionScore read fromFinality requirement
Pause advanceArbitrum registry (soft)None beyond sequencer inclusion
Reprice spreadArbitrum registry (soft)None
Advance stablecoinsArbitrum registry, cross-checked against L1 rootParent-chain safe

8. Fail-Closed State Machine

Fail-closed behavior is a state machine, not a single flag.

StateTriggerBehavior
NormalAll feeds fresh; model healthyPublish scores to Arbitrum
DegradedOne feed stale; model drift detectedPublish with uncertainty flag; consumers may widen haircuts
PausedCritical feed absent or attestation failureStop publishing; emit pause event
RecoveringFeeds restored; model re-validatedResume with conservative scores; monitor

Consumers distinguish "no score" from "score of zero." The registry exposes lastPublishedAt and state so a consumer can reject a score older than its freshness window. L1 root anchoring halts when the oracle enters Paused, so consumers relying on the root see the same fail-closed signal.

9. Multi-Source Consensus and Node Management

Independent scoring nodes are aggregated with a configurable agreement threshold.

  • Node registry: each node registers a source name, weight, and status on-chain.
  • Weighted aggregation: the published score is a weighted median or weighted mean of node outputs.
  • Agreement threshold: if weighted agreement falls below a threshold, the round is void and the oracle enters Degraded or Paused.

This prevents a single compromised node from setting the score, while allowing the network to tolerate one or two faulty nodes depending on configuration.

10. Security Analysis

ThreatMitigationResidual risk
Source data poisoningMulti-source fusion; anomaly detection; cross-checksCoordinated poisoning across sources
Oracle key compromiseHSM/MPC custody; threshold signatures; key rotationThreshold collusion
Replay across chainsEIP-712 domain separator with chainIdMisconfigured domain
Stale score acceptanceFreshness window enforced by consumerConsumer misconfiguration
Model evasionAdversarial testing; feature diversityNovel production patterns
Arbitrum sequencer stallL1 root anchoring continues independently of L2 publicationL2 consumers see stale scores until sequencer recovers

Attestation proves provenance and integrity, not accuracy. Consumers treat the score as evidence with uncertainty, not as ground truth.

11. Testing and Model Risk

  • Backtesting: evaluate the score on historical orders with known outcomes, per vertical.
  • Shadow mode: run the model in parallel with existing credit decisions before it drives advances.
  • Canary publication: publish scores for a small set of orders and compare against outcomes.
  • Drift monitoring: alert on feature distribution shift and calibration degradation.
  • Attestation testing: Arbitrum fork tests that verify signature recovery and freshness rejection against the actual registry contract.
  • Cross-chain consistency: verify that the L1 Merkle root matches the Arbitrum registry state at anchor time.
Disclaimer. This white paper is for informational purposes and does not constitute financial, legal, or investment advice. Digital assets and DeFi protocols carry significant risk, including total loss of capital.
© 2025 Ukiyo Network. Fulfillment Oracle technical white paper, version 3.0.
Publication: Arbitrum One and Ethereum L1.
Governance layer v3.0 Policy & execution
Ukiyo Network · Technical White Paper

Agency for Smart Contracts

Policy-bounded agent execution on Arbitrum
Document type: Technical white paper · Version 3.0
Execution environment: Arbitrum One · Governance anchor: Ethereum L1
Classification: Public

1. Executive Summary

The Agency for Smart Contracts is a framework for policy-bounded DeFi agents that sit between live oracle feeds and on-chain markets. Agents watch scores, simulate contract calls, and execute only allowlisted risk actions—pause, reprice, notify, advance. High-impact moves escalate to human multi-sig. The design principle is explicit: agents propose; contracts enforce; keys and limits stay off-model.

The Agency deploys on Arbitrum One alongside SPOOL, with the policy engine and multi-sig co-located for minimal cross-contract latency. Arbitrum's ~250ms block time makes risk-reducing actions fast enough to matter, while Timeboost provides an optional express lane for latency-sensitive pauses and reprices. This white paper specifies the policy engine, allowlist semantics, simulation gate, escalation design, Timeboost usage, sequencer resilience, and testing strategy.

2. Threat Model: Unbounded Admin and Manual Delay

ThreatDescriptionAgency control
Unbounded admin keyA single key can call any function on any targetAllowlist of targets and selectors
Agent model compromiseModel proposes malicious calldataOn-chain selector filtering; simulation gate
Manual response latencyHumans cannot react at machine speedAutonomous execution within bounded scope
High-impact autonomous errorAgent executes a large, irreversible actionValue-threshold escalation to multi-sig
Credential leakageModel or runtime exposes signing keysKeys held in HSM/MPC; never in model context

3. Policy Engine Contract Architecture

The policy engine is an on-chain contract that acts as a gatekeeper: it allows only approved modules, targets, and selectors to execute transactions. It sits between the agent and the target protocol on Arbitrum One.

interface IPolicyEngine {
    struct Policy {
        address target;        // contract the agent may call
        bytes4  selector;      // function selector allowed on target
        uint256 maxValue;      // max native/stablecoin value per call
        uint64  validAfter;    // time window start
        uint64  validUntil;    // time window end
        bool    enabled;
    }

    function setPolicy(bytes32 policyId, Policy calldata p) external onlyGovernance;
    function evaluate(
        address agent,
        address target,
        bytes4 selector,
        uint256 value,
        bytes calldata data
    ) external view returns (bool allowed, string memory reason);
}

The engine is stateless with respect to agent strategy: it stores policies, not intentions. The agent supplies the intended call; the engine decides whether that call is permitted.

An empty allowlist authorizes nobody; an empty blocklist authorizes everybody. The semantics are explicit in the contract to prevent misconfiguration.

4. Allowlist Semantics and Selector Filtering

The allowlist is the core security boundary. It is defined at the level of (target, selector), not merely target, because a contract may expose both safe and dangerous functions.

mapping(address => mapping(bytes4 => bool)) public allowedSelector;

function evaluate(...) external view returns (bool, string memory) {
    if (!allowedSelector[target][selector]) {
        return (false, "SELECTOR_NOT_ALLOWED");
    }
    if (value > maxValue[target][selector]) {
        return (false, "VALUE_EXCEEDS_LIMIT");
    }
    return (true, "");
}

4.1 Argument-level constraints

Selector filtering alone is insufficient when a single function can be called with dangerous arguments (e.g., transfer(address,uint256)). Argument-level policy decodes calldata and enforces bounds:

function checkAdvanceArgs(bytes calldata data) internal pure returns (bool) {
    (, uint256 amount) = abi.decode(data[4:], (uint256, uint256));
    return amount <= MAX_ADVANCE;
}

Parameter-level control and spending limits are enforced alongside function-level permissions.

5. Simulation Gate on Arbitrum Forks

Before execution, the agent simulates the proposed call against a forked Arbitrum state. Simulation detects calldata errors and produces a state diff that can be compared against expected bounds.

5.1 Fork simulation

Foundry fork testing runs against real chain state without deploying to a live network, using vm.createFork, vm.selectFork, and vm.rollFork. The agent runtime invokes the same simulation against an Arbitrum fork so that the state diff reflects the actual contract versions deployed on Arbitrum One.

function test_simulatePause_onArbitrum() public {
    vm.createSelectFork(vm.envString("ARBITRUM_RPC_URL"));
    uint256 before = spool.totalAssets();
    vm.prank(agent);
    spool.pause();
    assertTrue(spool.paused());
    assertEq(spool.totalAssets(), before);
}

The runtime pins the fork URL to the deployment chain recorded in the policy engine. Simulating against a different chain produces misleading diffs.

5.2 State-diff bounds

ActionExpected state diffRejection condition
PausePaused flag = true; no balance changesAny balance change
RepriceSpread parameter changes within boundsSpread outside [min,max]
NotifyEvent emitted; no storage changeUnexpected storage write
AdvanceOutstanding increases by amountAmount ≠ intended; recipient unexpected

6. Human Escalation and Multi-Sig Design

High-impact moves escalate to human multi-sig. The escalation boundary is defined by objective, on-chain criteria rather than agent judgment.

CriterionEscalation triggerRationale
ValueCall value above thresholdLarge transfers warrant human review
IrreversibilityAction cannot be undoneErrors are permanent
ScopeAction affects protocol-wide parameterSystemic impact
NoveltySelector not previously exercisedUnfamiliar code path

The multi-sig is a standard threshold scheme (m-of-n) with signers using hardware wallets or MPC. The policy engine enforces that escalated actions are only executable by the multi-sig address, so the agent cannot bypass escalation even if compromised.

7. Timeboost and Latency-Sensitive Escalation

Arbitrum Timeboost provides an optional express lane that grants a controller priority inclusion for a short window. In the default configuration, express-lane transactions are processed immediately while others face a ~200ms delay. The Agency uses Timeboost for risk-reducing actions that should not queue behind routine traffic.

ActionTimeboost useRationale
PauseRecommendedRisk-reducing; latency matters
RepriceRecommendedTime-sensitive; spread must track score
NotifyOptionalEvent-only; latency less critical
AdvanceNot usedIrreversible; waits for parent-chain safe finality

Independent empirical analysis of Timeboost (April–July 2025, 11.5 million express-lane transactions) found that express-lane control is highly centralized, with two entities winning more than 90% of auctions, and that auction competition declined over time. The Agency therefore treats Timeboost as an optimization for risk-reducing actions only, never as a security dependency, and never for value-moving actions. If the express lane is unavailable or unaffordable, pause and reprice still execute on the normal path with the standard ~200ms delay.

8. Key Separation and Off-Model Credentials

The design principle "keys and limits stay off-model" means the AI model never has access to signing keys, RPC credentials, or policy parameters. Three separations are enforced architecturally:

  1. Model context separation: the model receives observations and outputs proposals; it does not receive secrets.
  2. Signing separation: the signer is a separate service (HSM, MPC, or hardware wallet) that accepts only policy-approved calldata.
  3. Policy separation: policy parameters are stored on-chain on Arbitrum and changed only through governance (timelocked, with the version hash anchored to Ethereum L1), not by the agent.

For cases where policy confidentiality matters, off-chain policy evaluation with an on-chain proof is available: the ruleset remains secret, the on-chain guard verifies the proof, and enforcement remains on-chain.

9. Agent Runtime and Calldata Construction

The agent runtime constructs calldata for allowlisted actions. Construction is typed and schema-validated before simulation.

type ProposedAction = {
  target: `0x${string}`;
  selector: `0x${string}`;
  data: `0x${string}`;
  value: bigint;
};

function buildAdvance(orderId: bigint, amount: bigint): ProposedAction {
  return {
    target: SPOOL_ADDRESS,
    selector: spoolInterface.getSighash("fundOrder"),
    data: encodeFunctionData({ abi: spoolAbi, functionName: "fundOrder", args: [orderId, amount] }),
    value: 0n,
  };
}

TypeScript is the orchestration language; a typed builder prevents the class of errors where calldata is constructed with the wrong ABI or argument order.

10. Sequencer Failure and L2 Resilience

Arbitrum's sequencer is currently centralized. If the sequencer stalls, agent actions cannot be included in the normal path. This is distinct from oracle failure and is handled separately.

  • Detection: the agent runtime monitors Arbitrum block height; a stall beyond 30 seconds (roughly 120 missed blocks at ~250ms block time) triggers degraded mode.
  • Containment: the agent stops proposing value-moving actions; risk-reducing actions already submitted remain valid.
  • Recovery: critical pause actions are force-included via the Arbitrum delayed inbox on L1.
  • Policy: the policy engine records the maximum acceptable staleness of sequencer confirmation; beyond it, escalation triggers automatically to the multi-sig, which acts via the delayed inbox.

The Agency distinguishes sequencer soft confirmation from parent-chain safe finality. A pause executed under soft confirmation is a valid risk-reducing action even if the batch has not yet reached L1, because the pause cannot cause loss by itself. An advance, by contrast, waits for parent-chain safe confirmation (~12–15 minutes) before being treated as final.

11. Security Analysis and Failure Modes

FailureDetectionContainment
Agent submits disallowed selectorPolicy engine evaluate returns falseTransaction reverts before target call
Agent submits allowed selector with malicious argsArgument-level policy; simulation state diffRevert or escalation
Simulation passes but execution divergesPost-execution invariant checkRevert if invariant broken
Multi-sig signer collusionThreshold policy; independent signersRequires m-of-n compromise
Policy misconfigurationGovernance review; timelock anchored to L1Timelock allows reversal
Sequencer stallBlock-height stall detectionDegraded mode; force-include pause via L1 delayed inbox

12. Testing Strategy

  • Policy unit tests: every allowlist and argument bound has a positive and negative test.
  • Simulation fork tests: run the agent's proposed calldata against Arbitrum forked state and assert the expected state diff.
  • Escalation tests: verify that high-value calls route to multi-sig and cannot be executed by the agent address.
  • Invariant tests: fuzz sequences of allowed actions and assert system invariants hold.
  • Sequencer-failure drill: simulate a stalled sequencer and verify that degraded mode triggers and the delayed-inbox path works for a pause.

Foundry's four testing types—unit, integration, fork, and staging—map directly onto this strategy, with the fork suite pinned to Arbitrum One.

13. Governance and Policy Upgrades

Policy changes are high-impact and are governed with a timelock anchored to Ethereum L1. The timelock gives users time to exit if a policy change is hostile, and gives defenders time to react to a compromised governance key.

  • Timelock delay: sufficient for the protocol's risk profile (48–72 hours).
  • Policy versioning: each policy set has a version hash; consumers verify which policy was active at execution time.
  • Emergency pause: a separate, narrower mechanism on Arbitrum that can pause but not unpause or upgrade.
  • L1 anchor: the timelock and policy version root live on Ethereum, so policy changes inherit L1 finality even though execution happens on Arbitrum.
Disclaimer. This white paper is for informational purposes and does not constitute financial, legal, or investment advice. Digital assets and DeFi protocols carry significant risk, including total loss of capital.
© 2025 Ukiyo Network. Agency for Smart Contracts technical white paper, version 3.0.
Execution environment: Arbitrum One. Governance anchor: Ethereum L1.

Build the next industrial market with us

Operators, enterprises, and partners exploring AI, oracles, and blockchain for industry — we're open to serious conversations.