tanX Docupaper
AboutTrade
  • ABOUT
    • 📒tanX Docupaper
  • TECH
    • 👩‍💻Tech Docupaper
      • 🏨High level architecture
      • 🤔Starkware logic
      • 🌊Transactional flow
        • Off-chain accounts
        • The deposit flow
        • The withdrawal flow
        • The trade flow
        • The transfer flow
        • Full withdrawal
    • 🔌API Documentation
      • 😋Getting started
        • Test connectivity
      • 📈Market
        • 24hr Tickers Price
        • K-line/Candlestick data
        • Orderbook
        • Recent trades
      • ↔️Trading
        • Create order
        • Get order
        • List orders
        • Cancel order
        • Bulk Cancel
        • List trades
      • 🔐Account
        • Generating L2 Key Pairs
        • Login
        • Deposit
        • Withdrawal
        • Profile Information
        • Balance details
        • Profit and loss details
      • 🌏Web-socket stream
        • 🗝️Private web-socket connection
        • 👥Public websocket connection
      • ✨Internal Transfer
        • Create Internal Transfer
        • Get Internal Transfer
        • Check User Existence
        • List Internal Transfers
      • 🧪SDK Reference
        • NodeJS SDK
        • Python SDK
  • LEGAL
    • ‼️tanX Disclaimer
Powered by GitBook
On this page
  • 1. User enters a request to transfer funds on tanX.
  • 2. tanX sends a TransferRequest transaction to Starkware.
  • 3. Starkware checks the validity of the request.
  • 4. Starkware includes the transfer in a batch.

Was this helpful?

  1. TECH
  2. Tech Docupaper
  3. Transactional flow

The transfer flow

PreviousThe trade flowNextFull withdrawal

Last updated 1 year ago

Was this helpful?

1. User enters a request to transfer funds on tanX.

User enters a request to transfer funds using tanX.

2. tanX sends a TransferRequest transaction to Starkware.

tanX sends out a transfer request transaction to the Starkware gateway, using the add_transaction API with the TransferRequest transaction type.

The request includes the following information:

amount

The quantized amount of the asset to transfer.

sender_public_key

The sender’s public Stark key.

sender_vault_id

The sender’s vault id.

receiver_public_key

The receiver’s public Stark key.

receiver_vault_id

The receiver’s vault id.

token

The token to be transferred.

fee_info_user

The maximum fee that the sender is willing to pay for the transaction.

expiration_timestamp

The time after which the request is no longer valid, in hours since the Unix epoch.

nonce

A nonce issued by tanX, to prevent replay attacks.

signature

The sender’s signature.

3. Starkware checks the validity of the request.

Starkware checks the following to validate the transfer request:

  • The balance in the sender’s vault is sufficient to fulfill the transaction.

  • The maximum fee that the party is willing to pay for the transaction is not less than the actual fee.

  • The transaction request has not expired.

  • According to the orders tree, the order has not already been fulfilled.

4. Starkware includes the transfer in a batch.

If the transfer request is valid, the transfer is included in a batch to be submitted on-chain along with a validity proof.

👩‍💻
🌊
Transafer flow architecture