Private Key Guideline
Last updated
Last updated
When integrating with Phantasma blockchain you must decide where the private key is stored and who controls it. This choice affects security, trust, and user experience.
Hardware wallets such as Ledger are not yet supported. Support is planned according to the roadmap.
The app generates and stores the user's private key locally (e.g., in player settings, local storage, or secure enclave).
The SDK signs all transactions inside the app.
Pros:
Fully autonomous - no need for an external wallet.
Can automate transactions without user confirmation.
Cons:
Security risk: if your storage is compromised, the key is exposed.
You are responsible for implementing secure storage and backup.
Not compatible with hardware wallets (e.g., Ledger).
The private key is never stored in your app.
Transactions are signed by the wallet (e.g., Phantasma Link, Ledger), not by the game/app.
The app sends signing requests to the wallet.
Pros:
Lower trust requirement - your app never has access to the key.
Users keep control of their keys.
Works with hardware wallets.
Cons:
Requires wallet installation/configuration.
Transactions require explicit user approval.
High-security assets, sensitive transactions, hardware wallet users
Wallet-controlled key
Casual/low-value use, autonomous game mechanics, no external wallet expected
App-controlled key
You want maximum user trust with minimal onboarding friction
Consider auto-generated wallet with clear export/import options
Never hardcode private keys in source code or binaries.
If storing locally, protect the private key using all available security measures, such as strong encryption, a good password, and secure platform storage when possible.
Users should be able to back up their private keys (or seed phrases) and restore them when needed. Export must be secure and intentional.
Treat a private key like a password - leaking it compromises all assets.
App stores the key → More convenience, more risk
Wallet stores the key → More security, more steps for the user