Zex Finance
  • Introduction
  • Zex Overview
    • Traditional DEXs
      • Zex vs. DEX
        • Synchronization
        • Verification
    • How CEXs Works
      • Zex vs. CEX
        • TXs Verification
        • On-chain Intraction
        • Custody and Transparency
  • Tech Architecture
    • High-level Architecture
    • Smart Contacts
    • ZexPorta
      • Deposit
      • Withdraw
      • Validators
    • ZexCora
Powered by GitBook
On this page
  • Services within the Withdraw Component
  • Withdrawal Transaction Workflow
Export as PDF
  1. Tech Architecture
  2. ZexPorta

Withdraw

PreviousDepositNextValidators

The Withdraw is a component of the ZexPorta module and responsible for ensuring that all user withdrawal requests are securely processed and finalised. It leverages the decentralized architecture to maintain transparency and integrity throughout the withdrawal process. Below is a detailed breakdown of its services and workflow:

Services within the Withdraw Component

The Withdraw Component consists of the following key services:

  1. Database

    • Functionality: Tracks and updates the status of withdrawal transactions. Withdrawal requests progress through states such as pending and successful.

    • Technology: Uses a MongoDB database for efficient data management.

  2. Observer

    • Functionality: Monitors and records withdrawal requests submitted by users via the ZexCora. Inserts new withdrawal requests into the database with a pending status for further processing.

  3. Signature Aggregator (SA)

    • Functionality:

      • Sends pending withdrawal requests to Validators for verification.

      • Aggregates the signature shares issued by Validators.

      • Issues an ECDSA signature to enhance the security of the process.

    • Technology: Implements the Signature Aggregator component of the PyFrost library.

Withdrawal Transaction Workflow

The withdrawal transaction process follows the sequence outlined in the diagram. Each step ensures that user requests are securely validated and completed efficiently.

  1. Read Withdrawal Requests

    • The Observer retrieves withdrawal requests submitted by users through the ZexCora.

  2. Insert Withdrawal Request into the Database

    • The Observer records the withdrawal request in the database with a pending status.

  3. Fetch Pending Withdrawal Requests

    • The SA retrieves pending withdrawal requests from the database for validation and processing.

  4. Send Withdrawal Nonce to Validators for Verification

    • The SA sends the nonce (i.e. a unique identifier for withdrawal on each chain) associated with the withdrawal request to Validators for verification.

  5. Validators Retrieve Withdrawal Data

    • Validators independently fetch withdrawal data using withdrawal nonce from the ZexCora.

  6. Validators Verify and Send Signature Shares

    • Validators validate the data of the withdrawal transaction and issue partial signatures.

    • These signature shares are sent back to the SA.

  7. Send Withdrawal and Signatures to the Vault

    • The SA aggregates the signature shares and issues an ECDSA signature itself to enhanced security.

    • The aggregated data, including the signatures, is sent to the Vault interface.

  8. Update Withdrawal Status to Successful

    • The SA updates the transaction status in the database to successful.

    • The Vault interface completes the withdrawal process by transferring tokens from the Vault to the user’s address.