Ghost Labs
What is a gasless transaction on Solana, and how does fee sponsorship work?
A gasless transaction on Solana is one where the user does not pay the SOL fee because a different account, the sponsor, is set as the transaction's fee payer. Fee sponsorship is built into Solana: any signer can be the fee payer, so an app or relayer can pay the SOL while the user signs only for their own tokens.
Short answer: "Gasless" does not mean free. The fee is still paid in SOL, just by a sponsor. The sponsor signs as fee payer, the user signs as token owner, and the sponsor gets paid back in another token, through prepaid credit, or not at all. Ghost Gas is a prepaid version: you buy USDC credit once, and Ghost's relayer pays the SOL for each send.
How fees work on Solana
Every Solana transaction lists a fee payer. Per the Solana docs, the fee payer is the first signer, it pays a base fee of 5,000 lamports per signature plus any priority fee, and the fee is charged even if the transaction fails.
The fee sponsorship cookbook is explicit: any account that signs the transaction can be the fee payer, which enables native "gas abstraction" for token transfers, DeFi actions, and more.
The anatomy of a sponsored transaction
A sponsored USDC transfer usually has:
- Fee payer signature (sponsor). Pays the SOL.
- Owner signature (user). Authorizes the token transfer.
- Instructions. For example, compute budget settings, an optional instruction to create the recipient's token account, and a
TransferCheckedof USDC.
The SPL Token program only moves tokens when the owner signs. Being the fee payer does not grant authority over anyone's token account. That is why sponsorship can be safe for the user.
Who pays the sponsor back?
There are a few models:
- Free sponsorship. An app absorbs the cost, like a business paying postage.
- Pay in the same transaction. The transaction includes a token payment to the sponsor. Solana's atomicity means the sponsor is paid only if the transaction lands. The Solana cookbook describes this, and Solana Foundation's Kora implements it with configurable pricing.
- Prepaid credit. The user deposits ahead of time and the sponsor deducts per transaction. Ghost Gas uses this.
- Wallet deduction. A wallet like Phantom takes a flat fee from the token sent on eligible transfers.
The sponsor's risk, and how relayers handle it
A sponsor signs transactions that spend its own SOL. If it signs anything, attackers can make it pay for expensive transactions or create accounts at its expense. Responsible relayers validate before signing:
- Allowlists of programs, instructions, and tokens.
- Caps on compute units, priority fees, and signatures.
- Rate limits per user and per IP.
- Payment checks, so a transaction that skips the fee is rejected.
- Simulation, to confirm what the transaction will actually do.
Kora exposes these as [validation] settings such as allowed_programs, allowed_spl_paid_tokens, max_signatures, and max_allowed_lamports in its configuration docs.
How Ghost Gas sponsors fees
Ghost Labs is the team behind Ghost, an open-source privacy suite for USDC on Solana: Ghost Gas is prepaid USDC gas so a wallet with 0 SOL can send, and Ghost Shield unlinks withdrawals from deposits with zero-knowledge proofs.
- Signer
- User
- Fee payer
- Relayer
- Network
- SOL fee
Ghost's relayer applies a strict policy, from relayer/src/gas.ts in the repo:
- The fee payer must be the Ghost relayer.
- At most four instructions: compute budget limit and price (capped at 200,000 units and 1,000 micro-lamports), at most one idempotent token-account creation for the transfer destination, and exactly one
TransferCheckedof an allowlisted mint. - No approvals, authority changes, or plain transfers.
- The relayer must not appear as the source or authority of the transfer.
- 30 sponsored sends per hour per sender or IP by default.
The relayer builds the transaction, you sign it, it re-checks the shape, debits your gas note for that send's network cost plus a 1–2% platform fee, co-signs, and broadcasts. If the broadcast fails, the debit is refunded. See How it works and the API docs.
Why prepaid instead of per-transaction?
Because Ghost cares about the funding link. With prepaid credit, the wallet that pays (X1) and the wallet that spends (X2) are different, and X2 never receives SOL from X1. That removes the public edge described in How funding a wallet with SOL links your wallets on-chain. The trade-off is that the credit ledger is off-chain and trusted today, as our trust model says.
For a direct comparison with in-transaction payment, read Kora vs Ghost Gas. We have also proposed an in-transaction mode, covered in Pay-as-you-go gas.
FAQ
Are gasless transactions on Solana really free? No. A fee is still paid in SOL. Gasless means the user does not pay it in SOL; a sponsor does, and may charge the user in another token or not at all.
Can the fee payer steal my tokens? Not through a normal token transfer. Moving SPL tokens requires the owner's signature, and the fee payer's signature does not give it authority over your token account.
What stops someone from draining a sponsor's SOL? Sponsors validate every transaction before signing: allowed programs and instructions, caps on compute and priority fees, rate limits, and proof of payment.
How does Ghost Gas sponsor fees? Ghost's relayer is the fee payer. It accepts only a strict instruction shape, debits your prepaid gas note for that send's network cost plus a 1–2% platform fee, co-signs, and broadcasts.
Is fee sponsorship a Solana feature or a third-party hack? It is native. Any signer on a Solana transaction can be the fee payer, which Solana's own docs describe as fee sponsorship or gas abstraction.
See it in action
Top up at /app/credits and make a sponsored send at /app/send. Building an app? Start with How to add gasless USDC transfers to your Solana app and the code on GitHub.