Skip to main content
Create blockchain wallets using deterministic keys derived from your application’s root key. Each wallet address is unique to your application and consistently reproducible.

Prerequisites

Your application must be running in the Phala Cloud TEE environment with access to the dstack socket. In your docker-compose.yml:

Ethereum Wallet

ethereum.js

Solana Wallet

solana.js

Important Security Notes

  • Use secure functions: Always use toViemAccountSecure() and toKeypairSecure() (not the legacy versions)
  • Application-specific: Wallet addresses are unique to your application ID
  • Deterministic: Same path always generates the same wallet
  • Keep keys in TEE: Never expose private keys outside the secure environment

Multi-Wallet Support

Generate multiple wallets by using different paths:
multiWallet.js

Migration from v0.3.x

If you’re upgrading from dstack v0.3.x, wallet addresses will change when using secure functions. See the Migration from dstack v0.3 guide for detailed upgrade instructions and wallet migration strategies.