Converting to Shared dWallet
This guide explains how to convert a zero-trust dWallet (encrypted user share) or imported key dWallet to a shared dWallet (public user share). This enables contracts to sign autonomously without user interaction.
Irreversible Operation
Converting a dWallet to shared mode is irreversible. Once the user secret key share is made public, it cannot be made private again. Only proceed if you understand the security implications.
Overview
When you initially create a dWallet, you have two options:
- Zero-trust mode: User share is encrypted, requiring user interaction for every signature
- Shared mode: User share is public, enabling autonomous contract signing
If you created a dWallet in zero-trust mode but later want to enable contract-owned signing, you can convert it to shared mode.
Prerequisites
To convert a zero-trust dWallet to shared mode, you must have:
- The original user secret key share - This is returned from
prepareDKGAsync()during dWallet creation - Ownership of the dWallet - Only the dWallet owner can initiate conversion
- IKA and SUI tokens - For protocol fees
Save Your Secret Key Share
When creating a zero-trust dWallet, always save the userSecretKeyShare returned from
prepareDKGAsync() if you might want to convert to shared mode later.
Move Integration
Function Signature
Parameters
| Parameter | Type | Description |
|---|---|---|
self | &mut DWalletCoordinator | The coordinator shared object |
dwallet_id | ID | The ID of the dWallet to convert |
public_user_secret_key_shares | vector<u8> | The user secret key share to make public |
session_identifier | SessionIdentifier | Unique session ID for this operation |
payment_ika | &mut Coin<IKA> | IKA tokens for protocol fees |
payment_sui | &mut Coin<SUI> | SUI tokens for gas fees |
ctx | &mut TxContext | Transaction context |
Contract Example
Here's how a contract might handle conversion:
TypeScript SDK Usage
The SDK provides a convenient method for converting dWallets:
Using IkaTransaction
Method Signature
Converting Imported Key dWallets
The same process applies to imported key dWallets. When you import a key using prepareImportedKeyDWalletVerification(), save the returned secret share:
dWallet Types After Conversion
After conversion, your dWallet type changes:
| Before | After |
|---|---|
ZeroTrustDWallet | SharedDWallet |
ImportedKeyDWallet (zero-trust) | ImportedKeyDWallet (shared) |
The SDK's getDWalletType() method reflects these changes:
Security Considerations
When to Convert
Convert to shared mode when:
- Your contract needs to sign autonomously (DAOs, automated systems)
- You're transferring dWallet ownership to a smart contract
- Multiple parties need to authorize signatures through contract logic
When to Stay Zero-Trust
Keep zero-trust mode when:
- You want maximum security with user approval for every signature
- The dWallet holds high-value assets
- You're the sole controller and prefer explicit authorization
Best Practices
-
Evaluate before creation: If you know you'll need shared mode, create the dWallet as shared from the start using
request_dwallet_dkg_with_public_user_secret_key_share() -
Secure storage: If saving the secret share for potential future conversion, store it securely (encrypted, hardware security module, etc.)
-
Access control: After conversion, implement robust access control in your Move contract to protect the shared dWallet
-
Audit trail: Log conversion events for security auditing
Verifying Conversion
After submitting the conversion request, the Ika network processes it asynchronously. You can verify the conversion completed by checking the dWallet's public_user_secret_key_share field:
Error Handling
Common errors when converting:
| Error | Cause |
|---|---|
EDWalletUserSecretKeySharesAlreadyPublic | dWallet is already in shared mode |
| Invalid session | Session identifier was already used |
| Insufficient payment | Not enough IKA or SUI for fees |
Next Steps
- Learn about Shared dWallet Contracts for contract-owned signing
- See Signing for how to sign with shared dWallets
- Review Future Signing for two-phase signing patterns