Create and manage server-side pregenerated wallets using Para’s Server SDK
Pregenerated wallets are a powerful feature of Para that enable server-side wallet creation without requiring user authentication. This approach allows your application to perform blockchain operations autonomously, making it ideal for agent-based systems, automated workflows, and backend services.
The pregeneration flow works by creating a wallet associated with an identifier of your choice (email, phone, username, or custom ID). Para then provides you with the user share of the 2/2 MPC key, which you must securely store on your server until it’s either claimed by a user or used for signing operations.
The identifier can be an email or phone number, a third-party user ID (for Farcaster, Telegram, Discord, or X), or a custom ID relevant to your application. Choose an identifier that works best for your application architecture.
After creating a pregenerated wallet, you must securely store the user share. This component is critical for the wallet’s operation and security.
You must securely store this user share in your backend, associated with the user’s identifier. If this share is lost, the wallet becomes permanently inaccessible.
We strongly recommend implementing robust encryption for user shares both in transit and at rest. Consider using a high-entropy encryption key with AES-GCM encryption. Do not store encryption keys in the same database as the encrypted data.
Para offers pre-launch security reviews for teams in the Growth tier or above. Reach out to the Para team for assistance with your implementation!
To use a pregenerated wallet for blockchain operations, you need to:
When implementing setUserShare
in API routes or serverless functions, it’s critical to create a new Para client instance for each request. This prevents different users’ shares from conflicting with each other. Creating a new Para client has minimal overhead and won’t impact request performance.
Once the user share is loaded, you can test the wallet functionality by signing a message. However, for production use, we recommend using the blockchain library integrations described in the next section.
Pregenerated wallets work seamlessly with all blockchain integration libraries. Here are some examples:
Claiming pregenerated wallets must be done client-side with the Para Client SDK. The Server SDK does not support the key rotation operations required for wallet claiming.
For applications that need to transfer ownership of pregenerated wallets to users, you’ll need to implement a client-side claiming flow. This process involves:
For a comprehensive guide on implementing the claiming flow, refer to our web documentation:
AI Agents
Pregenerated wallets enable autonomous AI agents to perform blockchain operations. For example, an AI trading agent could analyze market conditions and execute trades using its own wallet, without requiring human intervention or authentication.
Automated Workflows
Create automation systems that perform recurring blockchain operations on predetermined schedules. For instance, a DeFi yield harvesting service could automatically collect and reinvest yields at optimal times using pregenerated wallets.
User Pre-provisioning
Create wallets for your existing user base before they engage with blockchain features. When users are ready to interact with these features, they can claim ownership of their pregenerated wallet through a seamless onboarding process.
Background Services
Build backend services that perform blockchain operations on behalf of users or systems. For example, a gas fee management service could optimize transaction timing based on network conditions without requiring user input.
Cross-platform Systems
Maintain consistent wallet identities across different platforms by using the same pregenerated wallets. This allows users to have a unified experience regardless of which platform they’re using to access your service.
Here’s a reference example demonstrating the creation and secure storage of pregenerated wallets:
Check out some novel use cases of pregenerated wallets created by our community: