Set up a Non-Custodial Wallet in a server environment in 5 minutes
With Crossmint’s Wallets API, you can create a Solana wallet with a non-custodial signer that you control. This means that:
This quickstart demonstrates how to create such wallets and send transactions from them.
Crossmint abstracts away all Solana-related fees, including: - Transaction fees for all operations - Rent for new token accounts - Account creation fees
To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.
Crossmint offers two consoles: staging, for development and testing, and production.
Once you log in to the console, the next step is to create an API key.
wallets.create
, wallets.read
, wallets.fund
, wallets:balance.read
,wallets:nfts.read
, wallets:transactions.create
and wallets:transactions.read
Smart Wallets are controlled by one or more secrets that you hold, called the wallet “signers”.
For the purposes of this tutorial, we will generate a key that you can guard in your computer.
To create a new non-custodial wallet, make a POST request to the Create Wallet endpoint, specifying the admin signer type and address:
This funding step is only to get USDC tokens that we’ll transfer in the next step. You don’t need to fund the wallet for gas fees, as Crossmint abstracts away all transaction fees.
Now that your wallet is created, let’s give it some funds so that you can complete your first transfer transaction.
To do so we will call the Fund Wallet endpoint, using the wallet address returned from the previous step as the wallet locator.
Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items. Non-custodial smart wallet transactions follow a simple three-step process:
Once all approvals are submitted, Crossmint will automatically broadcast the transaction onchain
Here’s a quick visualization of the flow:
The following sections will walk you through implementing each step. You’ll need to:
Crossmint automatically broadcasts the transaction once all required approvals are submitted. No manual broadcasting is needed.
Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items.
When creating transactions, you don’t need to worry about: - Transaction fees — Crossmint will cover all fees - Rent for new token accounts — Crossmint handles account creation and rent - Correct blockhash — You can use the placeholder shown below
As an example, let’s send 0.5 USDC from your wallet to a new recipient address.
The first step is to create a Base58 encoded serialized Solana transaction. To create a transaction, you will need to:
"11111111111111111111111111111111"
as the blockhash (Crossmint will replace this)The transaction will be properly configured on Crossmint’s servers with the correct values before execution. Crossmint will also pay for the transaction fee.
Now the serialized transaction data can be passed to the Create Transaction endpoint.
Before execution, transactions require authorization from the admin signer. This authorization is performed by calling the Approve Transaction endpoint with the appropriate signature.
Solana transactions have a validity window of 150 blocks (~60-90 seconds). Make sure to submit your approvals within this window. If the transaction expires, you’ll need to send and approve a new transaction.
To monitor the transaction status, you can call the Get Transaction endpoint.
The API will return the full transaction, including it’s status, which can be one of the following:
pending
: Broadcasting transaction onchainsuccess
: Transaction successfully executed onchainfailed
: Transaction failed during executionSet up a Non-Custodial Wallet in a server environment in 5 minutes
With Crossmint’s Wallets API, you can create a Solana wallet with a non-custodial signer that you control. This means that:
This quickstart demonstrates how to create such wallets and send transactions from them.
Crossmint abstracts away all Solana-related fees, including: - Transaction fees for all operations - Rent for new token accounts - Account creation fees
To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.
Crossmint offers two consoles: staging, for development and testing, and production.
Once you log in to the console, the next step is to create an API key.
wallets.create
, wallets.read
, wallets.fund
, wallets:balance.read
,wallets:nfts.read
, wallets:transactions.create
and wallets:transactions.read
Smart Wallets are controlled by one or more secrets that you hold, called the wallet “signers”.
For the purposes of this tutorial, we will generate a key that you can guard in your computer.
To create a new non-custodial wallet, make a POST request to the Create Wallet endpoint, specifying the admin signer type and address:
This funding step is only to get USDC tokens that we’ll transfer in the next step. You don’t need to fund the wallet for gas fees, as Crossmint abstracts away all transaction fees.
Now that your wallet is created, let’s give it some funds so that you can complete your first transfer transaction.
To do so we will call the Fund Wallet endpoint, using the wallet address returned from the previous step as the wallet locator.
Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items. Non-custodial smart wallet transactions follow a simple three-step process:
Once all approvals are submitted, Crossmint will automatically broadcast the transaction onchain
Here’s a quick visualization of the flow:
The following sections will walk you through implementing each step. You’ll need to:
Crossmint automatically broadcasts the transaction once all required approvals are submitted. No manual broadcasting is needed.
Now that the wallet is funded, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items.
When creating transactions, you don’t need to worry about: - Transaction fees — Crossmint will cover all fees - Rent for new token accounts — Crossmint handles account creation and rent - Correct blockhash — You can use the placeholder shown below
As an example, let’s send 0.5 USDC from your wallet to a new recipient address.
The first step is to create a Base58 encoded serialized Solana transaction. To create a transaction, you will need to:
"11111111111111111111111111111111"
as the blockhash (Crossmint will replace this)The transaction will be properly configured on Crossmint’s servers with the correct values before execution. Crossmint will also pay for the transaction fee.
Now the serialized transaction data can be passed to the Create Transaction endpoint.
Before execution, transactions require authorization from the admin signer. This authorization is performed by calling the Approve Transaction endpoint with the appropriate signature.
Solana transactions have a validity window of 150 blocks (~60-90 seconds). Make sure to submit your approvals within this window. If the transaction expires, you’ll need to send and approve a new transaction.
To monitor the transaction status, you can call the Get Transaction endpoint.
The API will return the full transaction, including it’s status, which can be one of the following:
pending
: Broadcasting transaction onchainsuccess
: Transaction successfully executed onchainfailed
: Transaction failed during execution