Key Importing
Key importing allows you to bring an existing private key (from Bitcoin, Ethereum, etc.) into the Ika dWallet system. This enables you to manage existing wallets with Ika's distributed signing capabilities.
Overview
Key importing:
- Converts existing private keys to dWallet format
- Creates an
ImportedKeyDWalletCapfor authorization - Supports both zero-trust (encrypted) and shared (public) modes
- Enables signing for wallets you already control
Security Consideration
When importing a key, you're trusting the network with a share of your existing private key. This is different from DKG where the key is generated in a distributed manner.
Import Process
Import Process
Request Import Verification
TypeScript: Prepare Import
Move Contract Integration
Contract Structure
Import Function
Signing with Imported Keys
Imported keys use different functions for message approval and signing:
Approve Message
Request Sign
Complete Example
Presigning for Imported Keys
Imported keys require dWallet-specific presigns for ECDSA:
Future Signing with Imported Keys
For governance workflows with imported keys:
Converting to Shared Mode
You can convert an imported key dWallet from zero-trust mode (encrypted user share) to shared mode (public user share). This enables contract-owned signing without user interaction.
See Converting to Shared for the complete guide, including:
- How to save and use the user secret key share
- TypeScript SDK methods
- Move contract integration
- Security considerations
Key Differences from DKG dWallets
| Aspect | DKG dWallet | Imported Key dWallet |
|---|---|---|
| Capability Type | DWalletCap | ImportedKeyDWalletCap |
| Message Approval | approve_message() | approve_imported_key_message() |
| Sign Function | request_sign() | request_imported_key_sign() |
| Presign Type | Global (for Taproot/EdDSA) | dWallet-specific (for ECDSA) |
| Key Origin | Generated distributed | Imported from user |
Best Practices
- Secure Private Key Handling: Never log or expose the private key
- Use dWallet-Specific Presigns: For ECDSA with imported keys
- Consider Trust Model: Imported keys have different security properties than DKG
- Test Thoroughly: Verify signatures work on the target chain
Next Steps
- Learn about Integration Patterns for common use cases
- See the Bitcoin Multisig Example for a complete implementation