How to Integrate Gasless Transactions On Solana With Turnkey
Turnkey offers flexible infrastructure to create and manage private keys. By combining the secure private key infrastructure and with gas abstracted transactions, developers can easily integrate account abstraction features for any Turnkey-powered wallets.
Setting up Gasless Transactions on Solana (SVM)
Turnkey offers deep and robust support for the Solana (SVM) ecosystem. We utilize the Ed25519 cryptographic curve as the primitive for signing transactions, provide address derivation support, and make it easy to integrate for SVM through various SDKs. Beyond this, Solana developers can also leverage SVM transaction parsing and policies, managed by the Turnkey Policy Engine.
Here’s how to take advantage of Turnkey’s composable primitives for gas abstraction:
Option 1: Using Solana Address Fee Payer
For this approach, we will leverage examples/with-solana, a full example of Solana transaction construction, and broadcasting using @turnkey/with-solana. For a more comprehensive, full-stack example that leverages passkeys, check out examples/with-solana-passkeys.
First, you’ll need to use one of the two optional environmental variables: SOLANA_ADDRESS_FEE_PAYER
. While optional, the variable is necessary to create a separate fee payer address. The setup is as simple as passing in the fee payer address into the withFeePayer.ts
Option 2: Build a Paymaster on Solana using Turnkey
This method showcases the flexibility of Turnkey infrastructure and was written and open sourced by another developer building on top of Turnkey. Please note that the repo referenced below is not maintained by Turnkey itself.
Build a Paymaster on Solana using Turnkey is easy to follow and will guide you from start to finish:
- Admin: Setting up Turnkey account, API keys, and Solana public/private key pairs
- Installing Dependencies
- Frontend Implementation
- Backend Implementation
- Receiving and Broadcasting the Completed Transactions
Setting up Gasless Transactions on Ethereum (EVM)
At the moment, Turnkey does not offer out-of-the-box gas sponsorships for the EVM ecosystem. This may change soon, and any updates will be announced via our official channels.
For now, you can leverage Turnkey’s partnerships with ZeroDev and Alchemy to provide gasless experiences to the end-users. Refer to the Account Abstraction article for more information.
Thinking about gasless transactions for other chains?
If you have questions, feedback, or find yourself in need of a gas abstraction or integration that doesn’t exist yet, please get in touch with us!
- Join our slack community here
- Contact us at hello@turnkey.com