0x protocol is an open, permissionless protocol that allows for ERC20 tokens to be traded on the Ethereum blockchain using off-chain order relays in conjunction with on-chain settlements.
What does this mean?
Decentralized exchanges are often praised for their security benefits as users retain control over their funds through smart contracts. The trade-off is unfortunately increased gas costs, as any interaction on the blockchain requires a gas fee to be executed. Initiating a trade, executing it, canceling all require gas fees, on top of the gas costs on deposits and withdrawals. This is where 0x protocol enters the scene by streamlining token exchanges on the Ethereum blockchain by utilizing off-chain order relays which means that initiating orders and canceling orders are both done off-chain – only value transfers are executed on-chain and requires a gas fee. To broadcast orders 0x uses ‘relayers’. Read more about relayers here.
Off-chain order relay, on-chain settlement diagram from the 0x whitepaper.
“Gray rectangles and circles represent Ethereum smart contracts and accounts, respectively. Arrows pointing to Ethereum smart contracts represent function calls; arrows are directed from the caller to the callee. Smart contracts can call functions within other smart contracts. Arrows external to the Ethereum blockchain represent information flow.”