Vessel
  • ⚓Introducing Vessel
    • Why Vessel Is The Exchange Crypto Needs?
    • Vessel's Roadmap for the Future of DeFi
  • ⚙️Technical Deep Dive
    • Sequencer
    • Prover
    • Contract
    • Data Availability
  • 💰VAELOB
    • Terminology
    • Order Book and AMM: Can We Have the Best of Both?
    • A Typical Trade in Vessel
    • Liquidity Pool Math
    • Concentrated Liquidity
    • Fee Calculation
    • Multi-Pool with Different Tick Spacing
  • 🎁Vessel Voyage
    • Vessel Mileage for Liquidity Providing
    • Vessel Coins for Referral
  • 🛳️Mainnet User Guide
    • Set up a Wallet
    • Deposit
    • Provide Liquidity to Vessel’s VAELOB
      • Access the Liquidity Pools
      • Add Liquidity
      • View Positions
      • Manage Positions
    • Trade
      • Order Types
      • Place Order
      • Cancel Order
      • Modify Order
      • Trading History
    • Internal Transfer - Send to Vessel's User
    • Withdraw Your Assets
    • Fees
      • Trading Fee
      • Gas Fee
      • AMM Fee
    • Trading Settings
  • 🛥️Testnet User Guide
    • Log in with Invitation Code
    • Setting up a Wallet
    • Switching Network
    • Funding Your Wallet
    • How to Deposit
    • How to Trade
    • How to Withdraw
    • Community Contribution
    • Vessel’s Referral Program
    • FAQs
  • 🗺️Smart Contract Deployments
  • 🐚Vessel Community Hub
    • Vessel Community Update: Q1 2024
    • Vessel Community Update: Q2 2024
    • Vessel Community Update: Q3 2024
  • 🎨Brand Kit
Powered by GitBook
On this page
  • Request Lifecycle on a well-behaved sequencer
  • Safe Guarantees if Sequencer is Malicious
  1. Technical Deep Dive

Sequencer

PreviousTechnical Deep DiveNextProver

Last updated 11 months ago

The sequencer serves user requests efficiently, fairly, and deterministically. It can be further divided into smaller components, including a gateway to inspect user requests and filter out malicious traffic, a matching engine to process user orders and update the internal state, a data server to stream market data to the trader API, and a witness generator to produce witnesses used by the prover.

From a user’s perspective, the sequencer can generally be seen as a high-performance server that sequences user requests and responds with the correct state updates, which are expected to be proved later.

Request Lifecycle on a well-behaved sequencer

A well-behaved sequencer will accept user requests and process them fairly, delivering the promised results as quickly as possible.

Once users receive the results, such as balance increments, they can operate on the new state immediately without waiting for the proof generation and finalization steps. The only exception is a withdrawal request, where users request to transfer assets out of the on-chain vault. Such on-chain transactions can only be executed with a valid proof, requiring users to wait for a proof generation and finalization cycle before claiming their assets from the contract.

The lengthy wait for withdrawal requests can be optimized by a mechanism known as . In this scenario, the operator vouches for the withdrawal request and sends assets to the withdrawer on-chain using an insurance fund. Subsequently, a SNARK proof will deduct the same amount from the withdrawer's off-chain account to reimburse the insurance fund and nullify the fast withdrawal request. The insurance fund is maintained in isolated storage, ensuring that user assets in the vault remain untouched during this process.

Safe Guarantees if Sequencer is Malicious

Although a malicious sequencer cannot manipulate or steal on-chain assets, it can still cause some issues. Here are some typical actions a malicious sequencer can take:

  • Deny a user's valid request.

  • Reorder requests in favor of arbitragers.

  • Return incorrect responses to users.

Vessel is committed to operating a well-behaved sequencer, and there is no benefit in running a malicious one, as it would only result in a loss of reputation without the capability to steal funds from the contract. Nonetheless, it is important to note that users can still claim their assets safely, bypassing a malicious sequencer, through a .

A force withdrawal is executed by sending a withdrawal instruction to the contract and prompting the prover to commit a SNARK proof in response. The prover must either validate the instruction and transfer the asset to the user’s account or invalidate the instruction by presenting a Merkle proof on the latest state root showing the user doesn’t own the claimed amount. If the prover fails to respond in a timely manner, the entire vault will enter an irrecoverable exodus mode, allowing users to directly submit Merkle proofs of their balances to withdraw their assets, with assistance from the Data Availability mechanism discussed in the next section.

⚙️
fast withdrawal
force withdrawal