Getting started with Solana Smart Wallets
Solana Wallet support is in beta. Please reach out if you run into any issues or need support integrating.
We support Smart Wallets on Solana, enabling developers to create embedded wallets, sign transactions, sponsor gas, and batch transactions on Solana. Create both EVM and Solana wallets with social login and use those wallets alongside existing Solana libraries like @solana/web3.js
to build seamless, gas-less user experiences!
Check out the demo to see Smart Wallets with gasless transactions on Solana in action.
Key features:
- Create Solana wallets with email, social login, passkeys, etc.
- Sign Solana messages and transactions
- Send Solana transactions
- Sponsor gas and rent for Solana transactions
- Batch multiple Solana instructions in a single transaction
This guide will walk you through setting up and using Smart Wallets on Solana.
Prerequisites
- Set up social login methods and user authentication
- Install a Solana library, such as
@solana/web3.js
to handle transaction construction and submission - Get an API key from Alchemy. Create an app on your dashboard and enable Solana and EVM networks (you’ll need both).
- Install the latest
@account-kit
packages:
Creating a Solana Wallet
First, set up user login and authentication if you haven’t already.
Next, add Solana to your configuration by using the solana
parameter when calling createConfig
in the config.ts file and replace the API key with your key.
Note: It is required to set the chain parameter in the config. You can choose any EVM chain that your app has enabled like sepolia
.
Getting a Solana Wallet address
Once a user has been authenticated, you can retrieve their Solana wallet address in 2 ways:
Usin the useSolanaSigner
hook
If you just want the Solana wallet address and signer, we recommending using this hook.
Using the useSolanaTransaction
hook
If you want to connect to a user’s Solana Wallet and send transactions, you should use the useSolanaTransaction
hook. This hook also exposes the Solana wallet address through the signer.address
parameter.
Not using React hooks?
If you’re not using React, use lower level libraries to convert your Alchemy signer instance into a Solana-compatible signer using the SolanaSigner
class. See Signer Solana docs.