Prerequisite: How Rent Sponsorship works
Prerequisite: How Rent Sponsorship works
Rent sponsorship is a built-in feature of the Light SDK’s that sponsors rent-exemption for all account types to reduce creation cost.
This is dealt with under the hood in a way that doesn’t disrupt the UX of what your users are used to with SPL-token.Rent-exemption: sponsored by a rent sponsor PDA.Every Solana account requires a rent-exempt balance in SOL upon creation.
A rent sponsor PDA by Light Protocol pays the rent-exemption cost for the account so account creators never lock up SOL for rent.Top-ups: paid by the fee payer.The
feePayer on the transaction bumps a small virtual rent balance (766 lamports by default)
on each write to keep the account active (hot balance).
If you’re building a wallet or dApp, set your application as the fee payer and your users never pay rent or top-ups.“Cold” accounts virtual rent balance below threshold (eg 24h without write bump) get auto-compressed.
The cold account’s state is cryptographically preserved on the Solana ledger.
Users can load a cold account into hot state in-flight when using the account again.
How to use Sponsored Rent Top-Ups for Accounts and Transfers
To sponsor top-ups for other users, set thefeePayer field to the public key of the account that will pay the top-ups.
Any account that signs the transaction can be the fee payer, which enables rent top-up sponsorship for Solana.
The following example shows how to transfer a token from one user to another and sponsor the top-up for the transaction.
You can set the fee payer to any signing account on any transaction with Light Token.
- TypeScript Client
- Rust Client