Grat eliminates gas friction by acting as a trusted intermediary that pays network fees on behalf of your users. It uses a Stellar-native feature called Fee-Bump Transactions (CAP-0015) to achieve this without requiring access to user private keys or complicated smart contract wrappers.Documentation Index
Fetch the complete documentation index at: https://grat.mintlify.app/llms.txt
Use this file to discover all available pages before exploring further.
The Problem: Fees and Sequences
In a standard Stellar transaction, the account that initiates the transaction must pay the fee in XLM. This account must also have the correct sequence number. This creates two hurdles: users need XLM, and your app must manage sequence numbers for every user in real-time.The Solution: Fee-Bump Transactions
A fee-bump transaction allows a separate “sponsor” account to pay the fee for an “inner” transaction. Grat takes your user’s signed transaction, wraps it in a fee-bump envelope, and signs it with a relay-controlled account. The network deducts the XLM from Grat, while the inner transaction logic executes as if the user had paid for it.The Transaction Flow
- User Signs: Your user signs a transaction that performs the desired action (e.g., sending USDC).
- App Sends to Grat: Your app sends the XDR to the Grat relay server.
- Grat Acquires Channel: Grat pulls an available “channel account” from its internal pool.
- Builds Fee-Bump: Grat builds the fee-bump envelope using the channel account as the fee-paying source.
- Signs and Submits: Grat signs the outer envelope and submits it to the Stellar RPC.
- Result Returned: The relay polls for confirmation and returns the transaction hash and final result back to your app.
Channel Accounts and Parallelism
To handle many transactions simultaneously, Grat maintains a pool of channel accounts. Stellar requires transactions from the same account to be submitted sequentially. By using multiple channels, Grat can submit transactions in parallel, significantly increasing throughput and preventing sequence number bottlenecks.Classic vs Soroban
Grat provides unified support for both Stellar Classic and Soroban Smart Contracts.- Classic: Sponsoring simple payments, trustline creation, and account configuration.
- Soroban: Sponsoring host function invocations, including the complex resource fees (CPU, Memory, and Storage) required by smart contracts.