Protocols
Future Signing
Future signing splits the signature process into two phases, allowing you to separate user commitment from final execution. This is essential for governance systems, multisig wallets, and any workflow requiring approval before signing.
Overview
Future signing enables:
- Governance Workflows: Vote on transactions before signing
- Multisig Approvals: Require multiple parties to approve
- Time-Delayed Execution: Commit now, execute later
- Conditional Signing: Sign only when conditions are met
Two-Phase Process
Two-Phase Process
PHASE 1: COMMIT
User creates partial signature and stores it
request_future_sign()
UnverifiedPartialUserSignatureCap
(store with request)
▼
▼
Governance / Approval Process
Network verifies partial signature
▼
PHASE 2: EXECUTE
After approval, complete the signature
verify_partial_user_signature_cap()
approve_message()
request_sign_with_partial_user_signature()
Phase 1: Request Future Sign
Create a partial user signature and store it for later:
Parameters
| Parameter | Description |
|---|---|
dwallet_id | ID of the dWallet to sign with |
presign_cap | Verified presign (consumed) |
message | The message bytes to sign |
hash_scheme | Hash function (e.g., 0=SHA256) |
message_centralized_signature | User's partial signature from SDK |
Phase 2: Complete Signing
After approval (voting, time-lock, etc.), complete the signature:
Verify Partial Signature
Complete with Message Approval
Complete Example: Governance Workflow
Request Structure
Phase 1: Create Request
Voting
Phase 2: Execute After Approval
Matching Partial Signatures
You can verify that a partial signature matches a message approval:
For imported keys:
Checking Validity
Check if a partial signature is ready for verification:
Real-World Example: Bitcoin Multisig
From the multisig-bitcoin example:
Imported Key Future Signing
For imported key dWallets:
Best Practices
- Store Partial Caps Securely: They're required for Phase 2
- Validate Before Execute: Check approval conditions in your contract
- Handle Expiration: Consider adding time limits to requests
- Prevent Double Execution: Mark requests as executed
- Match Messages: Verify partial signature matches message approval
When to Use Direct Signing Instead
Use Direct Signing when:
- You have immediate authority to sign
- No approval workflow is needed
- Simplicity is preferred
Next Steps
- See the Bitcoin Multisig Example for a complete implementation
- Learn about Key Importing for existing private keys