Skip to content

​In short

By default, the transaction’s fee payer needs a little SOL to pay its fee. A fee-payer service such as Kora lets your app pay instead, so customers only ever hold dollars.
You’ve used this in: Payments Step 4 Pay-per-call Step 4

​How it works

Every transactionTransactionsA transaction is a signed request to change the shared ledger. It either fully happens or doesn't happen at all, and once confirmed anyone can look it up.Learn more (Transactions: A transaction is a signed request to change the shared ledger. It either fully happens or doesn’t happen at all, and once confirmed anyone can look it up.) names a fee payer: the account whose SOL pays the network feeFeesEvery transaction pays a small flat network fee, currently a fraction of a cent, whatever the amount. The transaction's fee payer pays, and that can be your app rather than your customer.Learn more (Fees: Every transaction pays a small flat network fee, currently a fraction of a cent, whatever the amount. The transaction’s fee payer pays, and that can be your app rather than your customer.). The fee payer is always the first signer. It does not have to be the person moving the money. To sponsor a transaction, your app sets its own account as the fee payer. Both parties then sign the same transaction:
  • the sender signs to authorize moving their tokens;
  • the sponsor signs to authorize paying the network fee.
The sender needs no SOL at all. The sponsor needs SOL, but never holds the tokens being transferred. A sponsor can also pay the storage depositRent (storage deposit)Every account holds a small refundable deposit for the space it takes up. Opening a USDC account for a new customer costs about 0.0015 SOL, which comes back if the account is closed.Learn more (Rent (storage deposit): Every account holds a small refundable deposit for the space it takes up. Opening a USDC account for a new customer costs about 0.0015 SOL, which comes back if the account is closed.) for any account the transaction creates, such as a first-time customer’s USDC token account.

​Example

The sender transfers 0.5 tokens to the recipient. A third keypair, the fee payer, pays the fee. The output is from a local Surfpool network.
Kit
Output from a local Surfpool network
Output

​Sponsoring in production

Signing as fee payer for anything a client sends you is risky: someone could drain your SOL with transactions you didn’t intend to pay for. Before your service signs, check what the transaction does, limit which programs and amounts it may touch, and rate-limit each user. Kora is a fee-payer service that does this for you. It signs only transactions that pass the policy you configure, and it can charge users in a token such as USDC instead of SOL.