- The user’s authenticated Para wallet signs the transaction in the client.
- Your app’s sponsor wallet signs as the fee payer on the server.
Install
Follow Setup Solana Libraries, then install the packages used in this guide:Para’s Solana signers use the Solana Kit v2 signer interfaces. The versions above are compatible with the Para signer types used in this guide.
1. Create a Sponsor Wallet
The sponsor can be any Solana wallet your app controls and keeps funded with SOL. You can create and manage a keypair yourself, use a Para pregenerated wallet with a server-side signer, or create a REST API wallet. This guide uses a REST API wallet. Para manages the private key material, while your application keeps the wallet ID and address needed to use it. Run this code once from a trusted server environment:creating status. Use para.getWallet(sponsorWallet.id) until the wallet is ready and has an address.
Retain the ready wallet’s id and address wherever your application keeps its configuration. Fund the address with enough SOL to cover transaction fees. The examples below use SPONSOR_WALLET_ID and SPONSOR_WALLET_ADDRESS as placeholders for those two stored values.
You can store the returned wallet ID and address, or keep the
CUSTOM_ID and retrieve the wallet later with para.listWallets(). Use whichever approach fits your existing server configuration.2. Sign with the User’s Wallet
Run this code in the client after the user authenticates with Para. The sponsor’s public address is the fee payer, while the user’s Para signer remains the authority for the transfer instruction.partiallySignTransactionMessageWithSigners calls the user’s Para signer because it is attached to the transfer instruction. transactionBase64 contains the user’s signature, but it cannot be broadcast until the sponsor signs it.
Send the returned base64 transaction to your server using your application’s existing client-to-server transport.
You can send this value through an existing authenticated API. Fee sponsorship does not require a particular route, framework, or authentication model.
3. Sign with the Sponsor Wallet
Run this code on your server after it receives the user’s partially signed transaction. Create a Para REST Solana signer from the sponsor wallet details saved in step 1, then add its signature to the transaction. The signer needs the wallet ID to tell Para which wallet should sign. It needs the address so Solana Kit can place the returned signature in the fee payer’s signature slot.Apply your existing authorization rules before the sponsor signs. Check the expected user signer, allowed programs and instructions, transaction amounts, and fee limits.
4. Submit the Transaction
Both signatures are now present. Submit the transaction with a Solana RPC client:addSponsorSignature to submitTransaction. The network verifies both signatures, executes the user’s authorized instructions, and charges the transaction fee to the sponsor wallet.
Self-Managed Sponsor Wallet
If you manage the sponsor key yourself, replacecreateParaRestSolanaSigner with a Solana Kit keypair signer loaded from a base64-encoded 64-byte secret key in your server environment: