# Gasless Transaction Framework

### <mark style="color:purple;">Introduction</mark>

To eliminate gas-related friction, our protocol implements a **gasless transaction framework**, leveraging cryptographic signatures and off-chain relayers for cost-free user interactions. This framework comprises two core components:

### <mark style="color:purple;">1. EIP-2612 Permit for Gasless Deposits</mark>

* We adopt the **EIP-2612** standard, enabling users to sign an off-chain permit message using their private key. This permit, compliant with ERC-20 token standards, authorizes token transfers without requiring an on-chain approval transaction, reducing gas costs to zero for the user.
* The signed permit is processed by off-chain relayers, which execute the deposit transaction on-chain, covering gas fees through a subsidized model. This can be expressed as:

$$
gas(A) = 0
$$

The relayer verifies ( S ) using ( A )'s public key and executes the transfer.

* This mechanism is particularly advantageous for **high-frequency traders**, as it minimizes entry barriers and enhances user experience.

### <mark style="color:purple;">2. Signature-Based Gasless Actions</mark>

* For other critical operations, such as order placement and cancellations, we employ **ECDSA signature-based authentication**. Users sign an off-chain message that authorizes the transaction, which is then executed on-chain by relayers or bundled with other actions.
* The **signature verification process** ensures transaction integrity, using the following function:

$$
V(S, P) \rightarrow {True, False}
$$

where:

* ( V ) is the verification function,
* ( S ) is the signature,
* ( P ) is the public key.

If verified, the transaction is executed, maintaining gas costs at zero for the user.

* We use **ECDSA encoding** to ensure the process cannot retrieve the private key from the signed message in any way.

### <mark style="color:purple;">Key Benefits</mark>

* **Zero Gas Costs**: Users can transact without spending gas fees.
* **Improved Security**: Transactions are executed only with explicit user consent.
* **Enhanced User Experience**: Reduces friction, especially for high-frequency traders.
* **Efficient Execution**: Relayers handle transactions without compromising decentralization.

By integrating this framework, our protocol ensures seamless, gasless transactions while preserving security and decentralization.
