Overview
Path 1: User Recovery
For values encrypted with dual encryption:- Instant (no network)
- Only for user’s own data
- Requires stored recovery data
- No authorization needed
Path 2: MPC Decryption
For values without user recovery or computed results:Step 1: Create Authorization
In your program, create an authorization PDA:Step 2: Request Decryption
Client requests decryption from the sequencer:MPC Flow
Characteristics:- Requires authorization PDA
- Network round-trip
- Works for any authorized data
- Threshold security (k-of-n MPC)
Choosing a Path
| Scenario | Path | Reason |
|---|---|---|
| User views own balance | User Recovery | Data user encrypted |
| User views own order | User Recovery | Data user encrypted |
| User views match result | MPC | Computed by program |
| Counterparty views match | MPC | Not their encrypted data |
Implementation Patterns
Pattern 1: Self-Viewing Data
For data users encrypt and want to view later:Pattern 2: Authorized Results
For computed results:Pattern 3: Conditional Results
Share results only under certain conditions:Security Considerations
User Recovery
- Recovery data must be stored securely
- Loss of recovery data = must use MPC
- Never transmit recovery data unencrypted
MPC Decryption
- Authorization is permanent
- Verify conditions before authorizing
- Threshold security protects against single-party compromise