Creating a Pregenerated Wallet
Method Parameters
object
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.
Securing the User Share
After creating a pregenerated wallet, you must securely store the user share. This component is critical for the wallet’s operation and security.Secure Storage Best Practices
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!
Storage Security Recommendations
- Encrypt user shares in-transit and at-rest
- Implement access controls for your share database
- Maintain regular database backups to prevent data loss
- Create disaster recovery processes for compromise scenarios
- Have a key rotation plan in case of security incidents
- Complete security fire drills before launching
Using a Pregenerated Wallet
To use a pregenerated wallet for blockchain operations, you need to:- Retrieve the encrypted user share from your database
- Decrypt the user share
- Load it into your Para client instance
Signing Operations
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.Using with Blockchain Libraries
Pregenerated wallets work seamlessly with all blockchain integration libraries. Here are some examples:Wallet Claiming Flow
For applications that need to transfer ownership of pregenerated wallets to users, implement a client-side claiming flow. Your backend still prepares the stored user share for the authenticating identifier before the client receives it.- Look up the stored pregenerated wallet from the authenticating identifier
- Decrypt and load the stored user share into a fresh server-side Para client
- Update the pregenerated wallet identifier if it was created with a custom ID
- Return the updated user share to the client
- Let the client SDK load the share and claim the wallet
Calling
setUserShare before updatePregenWalletIdentifier lets the server SDK update the wallet metadata in the
loaded share. Return that updated share to the client so the loaded wallet identifier matches the user’s auth
identifier during claim.Core Pregeneration Methods
Best Practices
- Choose appropriate identifiers that align with your application architecture
- Implement robust encryption for user share storage
- Create backup systems to prevent data loss
- Use a separate database for user share storage with enhanced security
- Monitor for suspicious activity in your pregenerated wallet systems
- Implement rate-limiting to prevent abuse of wallet creation
- Document your recovery procedures for security incidents
- Consider multi-region replication for high-availability systems