LogoLogo
zkBob AppLinks & Resources
  • 🦹zkBob Overview
    • zkBob
    • Basic Concepts
      • Getting Started
      • Open-Source and Decentralized
      • Multichain Deployment
      • Usage Statistics
      • Use Cases
        • Employee Salary
        • Vendor Purchasing
      • Development Timeline
      • zk Privacy Solution Comparison
    • zkBob Pools
      • USDC Pool on Polygon (sunsets January 31, 2025)
      • USDC Pool on Optimism
      • ETH Pool on Optimism
      • USDT Pool on Tron (sunsets Oct 29, 2024)
    • Fees
      • Unspent note handling
    • Deposit & Withdrawal Limits
    • Compliance & Security
      • TRM Labs Integration
    • Conferences, Workshops, Videos
      • International Videos
    • Governance
    • BOB Stablecoin
    • zkBob FAQ
  • πŸ¦Έβ€β™‚οΈzkBob Application
    • UI Overview
    • Account Creation
      • Login to an existing account
      • Lost Password
      • Metamask / Web3 Wallet Warning
    • Deposits
    • Transfers
      • Multitransfers
    • Withdrawals
      • Native Token Conversion
    • Generate a Receiving Address
    • Optional KYC
    • zkBob Direct Deposits
    • Support ID
    • Payment Links
    • Integrated Services
    • Multilingual support
      • PortuguΓͺs
      • Русский
      • δΈ­ζ–‡
  • πŸ‘©β€βš•οΈTechnical Implementation
    • zkBob Application Overview
    • Deployed Contracts
    • Smart Contracts
      • zkBob Pool Contract
        • Transaction Calldata
      • Bob Token Contract
      • Verifier contracts
      • Operator Manager Contract
        • Mutable Operator Manager
      • Voucher (XP) Token Contract
    • Accounts and Notes
      • Accounts
      • Notes
    • Relayer Node
      • Relayer Operations
      • Optimistic State
      • REST API
    • zkBob Keys
      • Address derivation
      • Ephemeral keys
    • zkSNARKs & Circuits
      • Transfer verifier circuit overview
    • zkBob Merkle Tree
      • The Poseidon Hash
    • Elliptic Curve Cryptography
    • Transaction Overview
      • Common Structure
      • Memo Block
        • Memo Block Encryption
      • Transaction Types
      • Nullifiers
      • Signing a Transaction
      • The Transaction Lifecycle
    • Client Library SDK
      • Configuration
        • Initializing the client
          • Client Configuration
        • Attaching a User Account
          • Account Configuration
        • Switching Between Pools
      • Account-less Mode Operations
        • Converting Token Amounts
        • Transaction Fees
        • Transaction Constraints
        • Using the Delegated Prover
        • Getting the State
        • Gift Cards
        • Client Library Status
        • Helpers
        • Versioning
      • Full Mode Operations
        • Balances and History
        • Shielded Addresses
        • Account State
        • Fee Estimations
        • Transaction Configuration
        • Sending Transactions
        • Transaction Maintenance
        • Direct Deposits
        • Gift Cards Maintenance
        • Ephemeral Deposits
        • Forced Exit
        • Other Routines
      • Common Types
      • Full Functions List
      • Utilities
  • πŸ‘©β€πŸ«Deployment
    • Trusted Setup Ceremony
    • Contract Deployment
    • Relayer Subsystem
  • πŸ‘·β€β™‚οΈRoadmap
    • On the Roadmap
    • Exploratory Features
      • XP (Experience Points)
        • XP-based Auctions
      • Multi-chain Custom Rollup Deployment
      • Round-robin Operator Manager
      • Compounding
  • πŸ§‘β€πŸ’»Jobs
    • Zero-Knowledge Researcher & Protocol Developer
  • 🧩Resources
    • Visual Assets
    • Hackathons
      • zkBob Cloud
    • Release Notes
      • October 11, 2023
      • July 13, 2023
      • June 13, 2023
      • March 28, 2023
      • January 30, 2023
      • January 16, 2023
      • January 2, 2023
      • Releases 2022
    • Security Audit
    • Github
    • Link tree
Powered by GitBook
On this page

Was this helpful?

  1. Technical Implementation

Relayer Node

An intermediary between zkBob clients and contract

PreviousNotesNextRelayer Operations

Last updated 2 years ago

Was this helpful?

The relayer is a client interface to the zkBob solution. The main purpose of the relayer is to process an input transaction, calculate Merkle tree proofs, and send them to the contract.

The relayer node is not a mandatory component of the system - users can create transactions and interact with the Pool contract directly. However, possible issues can arise with direct interaction:

  1. If the Merkle tree on the client side is not continuously synced it is not possible to create the correct proof required for the transaction.

  2. When the Pool is congested (many users sending simultaneous transactions), the time delay between proof calculation and transaction delivery to the pool may lead to collisions. If a transaction is sent during this time interval the Merkle tree root will change and the transaction will be reverted (while still consuming gas).

The relayer solves these issues by enforcing strict transaction ordering. Moreover it takes on the heavy tree proof computations and pool state synchronisation. You can simply query the current pool state instead of extracting it from the pool's calldata. In general the relayer helps to facilitate contract interaction.

The relayer cannot compromise transactions or conduct "Man in the Middle" type attacks. Due to the underlying zero-knowledge infrastructure of the protocol, it cannot steal money, reveal shielded balances, decrypt transactions receiver\amount or change transactions. The worst it can do is provide an incorrect state to the user.

An advantage of using a relayer is increased anonymity due to abstracted gas payments. When you directly interact with the zkBob contract your actions can be disclosed implicitly because you pay gas fees on the native blockchain.

  • The relayer consists of a Merkle tree instance and transaction storage.

  • The Merkle tree is based on a key-value database. It supports adding new leaves, root updating, and zkSNARK proofs building.

  • Transaction storage is used to to save encrypted accounts and notes. The relayer can provide a fast reply to the client during the state synchronization.

  • Clients interact with the relayer via the .

  • .

Relayer scalability

zkBob is developed to support a multi-relayer configuration, however the current implementation assumes a single relayer in the network. A multiple relayer scheme is planned for the future.

πŸ‘©β€βš•οΈ
REST API
Relayer github repo