Platform

Overview

How It Works

Beneficiary Identity

Policy Corridors

Deterministic Finality

Architecture

Security Model

Governance

Integration

Solutions

Corridors Overview

Institutional Overview

Pricing

All Scenarios

Humanitarian Impact Fund

Assurance

Technical Assurance

Verify Receipt

Receipt Example

Developers

Documentation

APIs & Bridges

Architecture Docs

Glossary

BID API

Company

About

Team

Partners

Roadmap

Investors

Contact

Blog

All Documentation

Schedule Consultation
← Back to Patent Claims
Patent Claim 31 All Patents →

VRF Batch Auction Shuffling

Deterministic Fisher-Yates Intent Ordering for MEV Protection

Patent Claim JIL Sovereign February 2026 Claim 31 of 36

01Executive Summary

JIL Sovereign's retail lane engine uses a Verifiable Random Function (VRF) seed committed at batch creation time to drive a deterministic Fisher-Yates shuffle of all trade intents within each 3-second batch window. The shuffle order is derived from a SHA-256 hash chain seeded by the VRF output, making it both unpredictable before the batch closes and fully verifiable after clearing.

This mechanism eliminates the three primary MEV attack vectors in decentralized trading: frontrunning (inserting orders ahead of known intents), sandwich attacks (bracketing a victim's trade), and validator reordering (manipulating transaction sequence for profit). Any party with the VRF seed can independently reproduce the shuffle and verify that no reordering occurred.

Core Innovation: Combining VRF commitment at batch creation with hash-chain-driven Fisher-Yates shuffling creates an ordering that is cryptographically unpredictable during intent collection yet fully deterministic and verifiable after the batch closes. No party - including validators, relayers, or the clearing engine itself - can influence or predict the execution order of intents within a batch.

02Problem Statement

Maximal Extractable Value (MEV) - the profit validators and searchers extract by manipulating transaction ordering - costs DeFi users an estimated $1 billion or more annually. The fundamental problem is that transaction order within a block is determined by the block producer, creating an inherent information asymmetry that sophisticated actors exploit at the expense of regular users.

2.1 MEV Attack Taxonomy

  • Frontrunning: Observing a pending large buy order and inserting a buy order ahead of it, profiting from the price impact caused by the victim's trade.
  • Sandwich Attacks: Placing a buy order before and a sell order after a victim's trade, extracting value from both the price increase and decrease.
  • Time-Bandit Attacks: Validators reorganizing recent blocks to capture MEV opportunities that occurred in the past.
  • Just-In-Time Liquidity: Adding liquidity immediately before a large trade and removing it immediately after, capturing fees without bearing long-term risk.

2.2 Why Existing Approaches Fail

ApproachMechanismLimitationMEV Eliminated
Flashbots MEV-SharePrivate mempool + auctionRedistributes MEV, does not eliminate itPartial
Commit-Reveal SchemesEncrypted orders revealed laterRequires two transactions per order (2x gas)Partial
Fair Ordering (Chainlink)Decentralized sequencingFirst-come-first-serve still gameable by latencyPartial
CoW Protocol Batch AuctionsBatch with solver competitionSolvers can optimize for their own profitPartial
The Gap: No production system provides verifiable random ordering of trade intents within a batch auction where the randomness is both unpredictable before batch close and deterministically reproducible after. JIL's VRF-seeded hash chain shuffle is the first to achieve all three properties simultaneously: unpredictability, determinism, and public verifiability.

03Technical Architecture

The shuffle operates in three phases: VRF seed commitment at batch creation, intent collection during the batch window, and hash-chain-driven Fisher-Yates execution at batch close.

3.1 Shuffle Algorithm Steps

StepOperationInputOutput
1. Seed GenerationVRF evaluation at batch creationValidator private key + batch IDVRF proof + seed (32 bytes)
2. CommitmentPublish hash of VRF seed on-chainVRF seedSHA-256 commitment
3. Intent CollectionAccumulate intents during batch windowUser trade intentsOrdered list of N intents
4. Hash Chain InitInitialize chain with VRF seedVRF seedH0 = SHA-256(seed)
5. Fisher-YatesFor each position i from N-1 to 1First 4 bytes of Hi as index mod (i+1)Swap intents[i] and intents[j]
6. Hash Re-chainAfter each swap, advance hashCurrent hashHi+1 = SHA-256(Hi)
7. VerificationAnyone reproduces with revealed seedVRF seed + intent listIdentical shuffled order

3.2 Hash Chain Derivation

Starting from the VRF seed, the hash chain produces a sequence of 32-byte values: H0 = SHA-256(seed), H1 = SHA-256(H0), and so on. For each position i in the Fisher-Yates algorithm, the first 4 bytes of Hi are interpreted as a big-endian unsigned integer and taken modulo (i + 1) to produce the swap index j. This ensures uniform distribution across all valid positions.

3.3 VRF Properties

The VRF guarantees three properties: (1) the output is deterministic given the same key and input, (2) the output is indistinguishable from random without the private key, and (3) the VRF proof allows anyone to verify that the output was correctly generated from the claimed input. This means the batch creator cannot choose a favorable seed, and verifiers can confirm the seed was honestly generated.

04Implementation

4.1 Batch Lifecycle

  1. Batch creation: The retail lane engine opens a new batch every 3 seconds (configurable via BATCH_WINDOW_MS). At creation, a VRF seed is generated and its SHA-256 commitment is stored with the batch record.
  2. Intent accumulation: During the 3-second window, trade intents arrive via POST /v1/retail/intent/submit. Each intent is stored with the batch ID and arrival timestamp.
  3. Batch close: When the window expires, the batch is closed and no further intents are accepted. The engine retrieves all intents and applies the VRF-seeded Fisher-Yates shuffle.
  4. Clearing: The shuffled intents are processed through the iterative price discovery algorithm. The clearing price, individual fills, and the VRF seed are published in the batch result.
  5. Verification: The VRF seed is revealed post-clearing. Any party can verify the commitment, regenerate the hash chain, replay the Fisher-Yates shuffle, and confirm that the published execution order matches.

4.2 Rotate-First Pattern

To prevent race conditions between the batch timer marking a batch as CLEARING and new intent submissions, the engine uses a rotate-first pattern: it creates the next batch and updates the active batch pointer before processing the closing batch. This ensures that late-arriving intents go into the new batch rather than being rejected or lost.

4.3 Timer Implementation

The batch timer uses setTimeout recursion instead of setInterval to prevent overlapping ticks when clearing takes longer than the batch window. Each timer callback schedules the next tick only after the current clearing is complete, guaranteeing sequential batch processing.

05Integration with JIL Ecosystem

5.1 Execution Router

The execution router directs intents to the retail lane (batch auction) or the RFQ lane based on size, market state, and entity toxicity. Only intents routed to the retail lane participate in VRF-shuffled batch auctions. RFQ intents are processed individually through the request-for-quote pipeline.

5.2 Market State Awareness

Batch parameters adapt to the current market state. In ELEVATED state, batch windows may be extended and maximum batch sizes reduced to limit exposure during volatile conditions. In STRESSED state, most intents are routed to RFQ, and only small retail-sized orders participate in batch auctions.

5.3 Settlement Pipeline

Cleared batch results feed into the P2P settlement architecture. Each fill generates a settlement message published to the appropriate compliance zone topic on RedPanda, where the authorized validator processes the settlement including compliance checks, ledger commits, and proof generation.

5.4 Proof Verifier

The proof verifier service can independently verify any batch's shuffle by fetching the VRF seed, reconstructing the hash chain, and replaying the Fisher-Yates algorithm. This on-chain verification is available as a public API endpoint, enabling any user to prove that their intent was processed in a fairly shuffled order.

MEV Elimination: Because the VRF seed is committed before intents are collected and revealed only after the batch closes, no party can observe pending intents and manipulate the ordering. Frontrunning requires knowing the execution order in advance, which the VRF commitment makes impossible. Sandwich attacks require inserting orders at specific positions, which the random shuffle makes unpredictable.

06Prior Art Differentiation

SystemOrdering MethodVerifiableUnpredictableJIL Advantage
Uniswap v2/v3Block proposer orderingNoNoJIL removes proposer ordering power entirely
CoW ProtocolSolver competitionPartialNo - solver knows orderJIL uses cryptographic randomness, not solver discretion
Flashbots ProtectPrivate mempoolNoPartialJIL makes ordering verifiably random, not just private
Chainlink FSSFair sequencing (FCFS)YesNo - latency gameableJIL shuffle eliminates latency advantage
PenumbraEncrypted mempool + batchPartialYesJIL provides hash-chain verifiable shuffle proof
Key Differentiator: JIL Sovereign is the first system to combine VRF seed commitment at batch creation, SHA-256 hash chain derivation for Fisher-Yates shuffle indices, and post-clearing seed revelation for public verification. This provides all three properties simultaneously - unpredictability during collection, determinism during execution, and verifiability after clearing - which no existing MEV protection mechanism achieves.

07Implementation Roadmap

Phase 1
Months 1 - 3

Core Shuffle Engine

Implement VRF seed generation and commitment. Build SHA-256 hash chain for Fisher-Yates index derivation. Deploy 3-second batch window with rotate-first pattern. Create verification API endpoint for post-clearing shuffle proof.

Phase 2
Months 4 - 6

On-Chain Verification

Publish VRF proofs and shuffle commitments on-chain. Implement smart contract verification of shuffle correctness. Build explorer UI for batch inspection with step-by-step shuffle replay. Third-party audit of VRF implementation.

Phase 3
Months 7 - 9

Multi-Validator VRF

Distributed VRF using threshold signatures across multiple validators. No single validator can influence the seed. Commit-reveal protocol across validator set. Aggregate VRF proof published in batch header.

Phase 4
Months 10 - 12

Cross-Batch Fairness

Statistical analysis of cross-batch ordering fairness. Detection of timing manipulation attempts at batch boundaries. Adaptive batch windows based on intent arrival rates. Research into post-quantum VRF constructions.

08Patent Claim

Claim 31: A method for ordering trade intents within a batch auction on a decentralized exchange to prevent maximal extractable value extraction, comprising: generating a verifiable random function seed at batch creation time using a validator's private key and the batch identifier as inputs; committing a cryptographic hash of the VRF seed on-chain before any intents are collected for the batch; collecting trade intents during a configurable batch window without revealing the VRF seed; upon batch close, deriving a sequence of swap indices using a SHA-256 hash chain initialized with the VRF seed wherein each chain element provides the first four bytes interpreted as an unsigned integer modulo the remaining positions for a Fisher-Yates shuffle; applying the Fisher-Yates shuffle using the derived indices to produce a deterministic permutation of the collected intents; revealing the VRF seed and proof after clearing to enable any third party to independently reproduce the shuffle and verify that the published execution order is correct.