Protocols
DKG (Distributed Key Generation)
The Distributed Key Generation (DKG) protocol creates a new dWallet by generating cryptographic key shares distributed between the user and the Ika network. This guide covers how to perform DKG from Move contracts.
Overview
DKG creates:
- A DWalletCap capability that authorizes signing operations
- Key shares distributed between user and network (neither party has the full key)
- A public key that can receive funds on other chains (Bitcoin, Ethereum, etc.)
dWallet Types
Shared dWallet (Recommended for Contracts)
Uses a public user secret key share, allowing the network to sign without user interaction:
Zero-Trust dWallet
Uses an encrypted user secret key share for maximum security:
Creating a Shared dWallet
Step 1: Prepare DKG Data (TypeScript)
Use the SDK to prepare the cryptographic parameters:
Step 2: Call Move Function
Step 3: Move Contract Implementation
Sign During DKG
You can request a signature during DKG to save time. This requires a pre-existing presign.
Prepare Sign During DKG Request
Complete Example: Bitcoin Multisig Initialization
From the multisig-bitcoin example:
Getting the dWallet Public Key
After DKG completes, you can get the public key from the dWallet:
Best Practices
- Use Shared dWallets for Contracts: They allow automated signing without user interaction
- Store DWalletCap Securely: It's the key to your dWallet - store it in your contract
- Request Initial Presign: After DKG, immediately request a presign for future operations
- Deduplicate Members: Use
vec_set::from_keys()to remove duplicate addresses
Next Steps
- Learn about Presigning to prepare for signatures
- See Signing for creating signatures