Protocols
Signing
Direct signing creates a signature immediately in a single transaction. Use this when you have authority to sign and don't need governance approval.
Overview
Signing requires:
- A VerifiedPresignCap (from presigning)
- A MessageApproval (authorizes signing the specific message)
- A message_centralized_signature (user's partial signature from SDK)
Signing Flow
Signing Flow
Start with Ready Presign
VerifiedPresignCap
(from pool)
▼
Approve Message
coordinator.approve_message()
MessageApproval
▼
Request Signature
coordinator.request_sign()
Signature ID
(network creates signature)
Message Approval
Before signing, you must approve the specific message:
Parameters
| Parameter | Description | Example Values |
|---|---|---|
signature_algorithm | Algorithm to use | 0=ECDSA, 1=Taproot, 4=EdDSA |
hash_scheme | Hash function | 0=SHA256, 1=KECCAK256 |
message | Bytes to sign | Transaction hash, message bytes |
Request Sign
Standard dWallet Signing
With Return ID
Imported Key Signing
Complete Signing Example
Move Contract
TypeScript: Prepare and Call
TypeScript: Retrieve Signature
Signing for Bitcoin Taproot
For Bitcoin Taproot transactions:
Signing for Ethereum
For Ethereum transactions:
Error Handling
| Error | Cause | Solution |
|---|---|---|
| Presign not valid | Network hasn't completed presign | Wait and retry, or check with is_presign_valid() |
| Invalid message approval | Capability doesn't match dWallet | Use correct DWalletCap |
| Insufficient funds | Not enough IKA/SUI | Fund the contract |
Best Practices
- Verify Presign First: Always verify presign before signing
- Replenish Pool: Add new presign after each signature
- Store Sign ID: Keep the sign ID to retrieve the signature later
- Handle Async: Signature creation is async - poll for completion
When to Use Future Signing Instead
Use Future Signing when:
- You need governance approval before signing
- Multiple parties must approve the transaction
- You want to separate commitment from execution
Next Steps
- Learn about Future Signing for two-phase signing
- See the Bitcoin Multisig Example for a complete implementation