๐Ÿ—ผRelayers

Portal Gate's Relayers are key actors in ensuring anonymity.

Relayers are public 0x wallets that send transactions and pay gas to the underlying blockchain on Portal Gate privacy usersโ€™ behalves. Private transactions thus appear publicly to originate from Relayer addresses. As they are simply a cryptocurrency wallet, anyone can theoretically be a Relayer. Relayers run a micro Node.Js that broadcast fees to Relayer Clients (i.e. wallets equipped with Portal Gate). Relayers also automatically process transactions when received.

When users send a transaction in Portal Gate, they select an appropriate Relayer, typically based on low fees and availability. The transaction is encrypted in transit, and its contents cannot be read by the Relayer, except for a fee that is packaged to pay for the Relayerโ€™s services. Upon receipt of a transaction, the selected Relayer will validate its packaged fee and submit the transaction to the underlying blockchain network. Through submitting the transaction, the Relayer obfuscates the sender, amount, receiver and token details. This anonymises transactions so they cannot be associated with the senderโ€™s 0x public address.

NOTE: At no point do Relayers custodial hold users' funds nor do they confirm transactions themselves, they merely transfer encrypted information for confirmation by the underlying blockchain infrastructure. Relayers are also unable to decrypt details about the transactions, nor can they change the details of a transaction as changing any information would lead to an invalid hash and be rejected by the system as an incorrect cryptographic proof.

The Relayer network is robust from a game theory perspective. If a userโ€™s chosen Relayer refuses to pass on a transaction for whatever reason, then they can send it to another cooperative Relayer. All that it takes is for at least 1 cooperative Relayer to submit the data on-chain for the underlying blockchainโ€™s ledger to update.

Relayer Type

Withdrawal Relayer

When the user withdraws the fund, the user can choose to use the withdrawal relayer to initiate the transaction to preserve maximum privacy.

ZKCredential Updater Relayer

When users need to refresh their KYC credentials, user can choose to use ZKCredential Updater Relayer to preserve max privacy.

Relayer Architecture

  1. TreeWatcher module keeps track of Account Tree changes and automatically caches the actual state in Redis and emits treeUpdate event to redis pub/sub channel.

  2. The server module is an Express.js instance that accepts HTTP requests.

  3. The controller contains handlers for the Server endpoints. It validates input data and adds a Job to the Queue.

  4. The queue module is used by Controller to put and get Job from the queue (bull wrapper).

  5. The status module contains a handler to get a Job status. It's used by UI for pull updates

  6. Validate contains validation logic for all endpoints.

  7. The worker is the main module that gets a Job from the queue and processes it.

Last updated