Smart Wallets (server-side)
Set up a Smart Wallet in a server environment, in 5 minutes
Overview
Automated, programmable control over assets and funds allows developers to set permissions, customize transactions, and support real-time interactions with ease. This is all possible through Crossmint’s server-side Smart Wallets API, which enables seamless integration of smart contract wallets into any application stack.
This quickstart demonstrates how to:
- Create smart wallets and manage transactions from your backend, with no client-side blockchain dependencies
- Work with any environment that can make HTTP requests (Python, Node.js, etc.)
1. Create and Configure a Crossmint Project
To get started, create a developer account in the Crossmint Staging Console. Open that link, sign in, and accept the dialog to continue.
Then, navigate to project Settings > General, and change the wallet type to Smart Wallets
.
2. Get an API Key
Once you log in to the console, the next step is to create an API key.
Click the “Integrate” tab, then select “API Keys” from the top menu.
Within the Server-side keys section, click the “Create new key” button in the top right.
Then, select the scopes wallets.create
and wallets.read
under the Wallets API category and create your key.
Save this key for the next step.
3. Generate a Key Pair
Smart Wallets are controlled by one or more secrets that you hold, called the wallet “signers”.
In production, you may want to use passkeys, MPC wallets or some other secret management service to guard these, but for the purposes of this tutorial, we will generate a key that you can guard in your computer.
4. Create Your Smart Wallet
To create a new smart wallet, make a POST request to the /api/v1-alpha2/wallets
endpoint:
Now that your wallet is created, let’s create your first transaction:
5. Transaction Flow Overview
Smart wallet transactions follow a simple three-step process:
- Create Transaction - Submit your intended transaction (like transferring tokens or calling a contract)
- Submit Approval(s) - Sign and submit the required approval(s)
- Monitor Status - Once all approvals are submitted, Crossmint automatically broadcasts 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:
- Create a transaction with your intended operation
- Sign the approval message and submit it
- Monitor the transaction status as Crossmint handles the onchain broadcast
Note: Crossmint automatically broadcasts the transaction once all required approvals are submitted. No manual broadcasting is needed.
6. Create a transaction
Once the smart wallet is created, you can send transactions from it, such as transferring currency, interacting with smart contracts, or purchasing items.
Make a POST request to the /api/v1-alpha2/wallets/{walletLocator}/transactions
endpoint:
After creating the transaction, you’ll need to submit an approval with the required signature. See the next section for details on how to do so.
7. Sign the Approval Message
When you create a transaction, the response includes a message that needs to be signed.
Use your private key to sign this message:
Or generate a signature using your private key with either Python or JavaScript:
8. Submit Transaction Approval
After signing the message, submit your approval by making a POST request to the /api/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}/approvals
endpoint. Once all required approvals are submitted, Crossmint will automatically broadcast the transaction onchain.
The API will respond with the updated transaction status. If this was the final required approval, the status will be pending
, showing that Crossmint is broadcasting the transaction onchain:
Note: No additional action is required after submitting the approval. Crossmint will automatically broadcast the transaction once all required approvals have been submitted.
9. Monitor Transaction Status
You can monitor the transaction’s status by polling the /api/v1-alpha2/wallets/{walletLocator}/transactions/{transactionId}
endpoint.
The API will return the full transaction, including it’s status, which can be one of the following:
awaiting-approval
: Waiting for required approvalspending
: Broadcasting transaction onchainsuccess
: Transaction successfully executed onchainfailed
: Transaction failed during execution