Gas-free USDT0 Transfer and Unwrap
As a USDT-focused stablechain built to provide seamless and efficient user experiences, one of the Stable’s key innovations is the ability for users to transfer USDT0 and unwrap it into gasUSDT all without paying gas fees.
Key Features
- Gas-Free USDT0 Transfers: Users can send USDT0 tokens to other addresses without needing to hold or spend any gas tokens.
- Gas-Free USDT0 Unwrap: Users can convert USDT0 (the wrapped, ERC-20 style USDT token) into gasUSDT (the native gas token) without gas, allowing them to use the native token for additional on-chain activity
Note: Native gas token(gasUSDT) transfers between EOAs are restricted to prevent accidental transfers to centralized exchanges.
How It Works
Gas-free interactions are enabled through the use of EIP-2612 Permit Extension, allowing users to authorize token spending via off-chain signatures. The gas for the transaction is paid by a relayer operated by the Stable team.
Gas-free USDT0 Transfer
Simple USDT0 transaction is gas free, and here’s how the transfer process unfolds:
-
User Initiates Transfer via Web Frontend
The user requests a gas-free USDT0 transfer through Stable Wallet.
-
User Signs Permit Message
The frontend prompts the user to sign a permit message, which authorizes the
GaslessTxExecutor
contract to spend their USDT0 tokens. -
Frontend Sends Permit to Backend
The signed permit is forwarded to the Stable backend.
-
Backend Submits Transaction
The backend sends a transaction to the
GaslessTxExecutor
contract. The Stable backend account pays for the gas on behalf of the user. -
Executor Calls
permit
andtransferFrom
on USDT0 ContractUsing the signed permit, the contract:
- Calls
permit()
to register spending rights. - Calls
transferFrom()
to transfer tokens.
- Calls
-
USDT0 is Transferred to the Recipient
The tokens are moved from the sender’s account to the specified recipient.
Gas-free Unwrap
To use USDT0 for gas, it must be unwrapped into gasUSDT. This process is gas-free and here’s how the unwrap process works:
-
User Initiates via Frontend
The user initiates a gas-free USDT0 unwrap request through Stable Wallet.
-
User Signs Permit Message
The frontend prompts the user to sign a permit message, which authorizes the
GaslessTxExecutor
contract to spend the user’s USDT0. -
Frontend Sends Permit Request to Backend
The signed permit message is sent to the Stable backend for execution.
-
Backend Submits Transaction
The backend sends a transaction to the
GaslessTxExecutor
contract. The Stable backend account pays for the gas on behalf of the user. -
Executor Calls
permit
on USDT0 ContractThe
GaslessTxExecutor
contract calls thepermit()
method on the USDT0 contract, using the signature to authorize token spending. -
Executor Calls
withdrawTo
on OStableWrapper ContractThe executor then invokes the
withdrawTo()
method of theOStableWrapper
contract to begin the unwrap process. -
Wrapper Calls Approve and TransferFrom
The
OStableWrapper
contract:- Approves itself to pull USDT0 from the user’s account.
- Calls
transferFrom()
to actually move the tokens.
-
USDT0 Transferred to Wrapper
The specified amount of USDT0 is moved from the user’s account to the
OStableWrapper
. -
Wrapper Mints Native USDT
The wrapper then calls the
mint()
function on the bank precompile module of the Stable chain. -
Native USDT Sent to User
The bank precompile mints native USDT and deposits it directly into the user’s account. The user can now spend this native token on any other on-chain activity.
Stable simplifies the user experience by removing the need for gas in essential operations like USDT0 transfers and unwrapping. By leveraging EIP-2612 and a secure relayer design, Stable enables frictionless onboarding and seamless interactions, all powered by gas-free infrastructure.