Trades on Renegade are facilitated through network nodes called “relayers.” Relayers are stand-in parties that represent traders and perform multi-party computations (MPCs) on their behalf to find counter-flow and execute trades.
Relayers are the only parties that can view the contents of a connected wallet in plaintext — doing so for the purposes of settling orders by matching liquidity between traders. Relayers communicate with other relayers through “handshakes” to update the state of the network, propagate new open orders, and perform the ZK-MPC calculations necessary to execute trades.
By default, users are connected to the Renegade relayer, but they can use other public relayers or run their own relayer for a trustless trading experience with no relayer fees.
How relayers work
Renegade is a peer-to-peer crossing network where users communicate with each other to find counterflow and make trades. Relayers perform this communication function on behalf of users while preserving order privacy before and after a trade.
Trust-minimization between the relayer and the end-trader is crucial. A relayer can only ever match outstanding orders and settle previous matches. They never custody assets, and they only have view access to the user wallet.
Here’s how relayers facilitate trading:
- Connecting to a wallet: To begin trading, users select a relayer to connect their wallets to. This relayer can view the open orders and wallet balances in plain text. By default, users connect to the Renegade relayer.
- Gossiping open orders: Once a wallet opens a new order, its connected relayer will “gossip” the order information throughout the network, letting other relayers know that a new order has been opened.
- Running MPCs to find order matches: Relayers managing wallets with open orders perform pairwise MPCs to see if there is a liquidity match. Since relayers do not know what open order is on the other side, most MPCs don’t return a match. If an MPC does return a match, however, a swap occurs and the relayers commit the result of the swap on-chain as a ZK proof.
- Updating wallet balances: After a successful match, the wallet balances of the two traders are updated to reflect their new holdings. The counterparties to a match only learn what tokens were swapped, they do not know the full order position of their counterparty.
Running your own relayer
Renegade users are free to pick what relayer they use. By default, new wallets are connected to the Renegade relayer, but users can also connect to other publicly-available relayers.
Users who are especially conscious about speed, privacy, or cost can run their own relayer. Running your own relayer ensures that all wallet information remains private to you.