Documentation Index
Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Overview
This guide walks you through creating EVM wallets using Dynamic’s Python SDK. You’ll learn how to choose a threshold signature scheme, back up key shares, and handle errors.Prerequisites
Step 1: Choose Your Security Model
Dynamic supports two threshold signature schemes:TWO_OF_TWO (Default, recommended)
- Security: Highest — requires both your server and Dynamic’s infrastructure
- Availability: Lower — both parties must be online to sign
- Use case: Default for all server-side wallets
TWO_OF_THREE (Advanced)
- Security: High — requires 2 of 3 shares
- Availability: Medium — tolerates one party being offline
- Use case: Setups that need to tolerate one share being offline
Step 2: Create Your First Wallet
create_wallet_account returns a WalletProperties object — the user-facing fields are account_address and wallet_id.
password parameter encrypts your key shares and backs them up to Dynamic at keygen time. Keep this password — you’ll need it to sign and to recover shares. threshold_signature_scheme defaults to TWO_OF_TWO if omitted.
Step 3: Store Wallet Information
After creating a wallet, store the address and wallet ID for later use:load_wallet(address) and pass password= to subsequent sign calls — the SDK transparently recovers the encrypted key shares from Dynamic’s backup:
Step 4: Handle Errors
All SDK exceptions inherit fromDynamicSDKError. The most relevant subclasses for wallet creation and lookup are AuthenticationError (bad or expired API token) and WalletNotFoundError (raised by load_wallet and get_wallet_from_map when the address is unknown).
Best Practices
- Password security — Use a strong, unique password per wallet. Consider storing it encrypted in a secrets manager.
- Store wallet ID — Save the
wallet_idalongside the address in your database. It’s needed for delegated signing. - Error handling — Always handle
DynamicSDKErrorand its subclasses. - Context manager — Use
async withso the HTTP client is properly closed.