Zero-Knowledge Architecture
How SVA preserves user privacy through zero-knowledge encryption.
What is Zero-Knowledge?
Zero-knowledge means that the service provider (SVA) cannot see or access user data in plaintext. All user data is encrypted client-side before being stored, and only the user (with their master key) can decrypt it.
Encryption Model
Data Storage
User Data → Encrypt (Client-Side) → Encrypted Data → Store in SVA Core
User data is encrypted in the browser before being sent to SVA Core:
- User enters data (e.g., email, name, phone)
- Browser encrypts data using session key
- Encrypted data is sent to SVA Core
- SVA Core stores encrypted data (cannot read it)
Data Retrieval
Encrypted Data → Fetch from SVA Core → Decrypt (Client-Side) → Plaintext Data
User data is decrypted only in the user's browser:
- Browser fetches encrypted data from SVA Core
- Browser decrypts data using session key
- Plaintext data is available only in browser
- SVA Core never sees plaintext data
OAuth Flow with Zero-Knowledge
Step 1: Consent Request
When a third-party app requests user data:
- User clicks "Sign In with SVA"
- SVA OAuth creates authorization request
- User is redirected to consent screen
At this point: SVA services don't know what data the user has.
Step 2: Consent Screen
On the consent screen:
- User unlocks vault (master key or passkey)
- Browser decrypts user data from vault
- Consent screen displays requested scopes
- User reviews what will be shared
At this point: Plaintext data exists only in the browser.
Step 3: Data Attestation
When user approves:
- Browser builds claims object from decrypted data:
{
email: decryptedData.email,
name: decryptedData.name,
phone: decryptedData.phone
} - Browser sends claims to SVA Core for attestation
- SVA Core validates and signs data token
- SVA Core never stores plaintext claims
At this point: SVA Core sees claims only during attestation, but doesn't store them.
Step 4: Token Exchange
- Third-party app exchanges code for tokens
- Data token (with claims) is included in response
- Third-party app can decode claims from token
At this point: Only the third-party app and user have access to plaintext data.
What SVA Services See
SVA OAuth Provider
- OAuth app registrations
- Authorization requests
- Authorization codes
- Access tokens
- Cannot see: User data in plaintext
SVA Core
- User accounts
- Encrypted vault data
- Data token signatures
- Cannot see: User data in plaintext (only during attestation)
SVA Client
- Consent UI
- Decrypted data (only in browser, never sent to server)
- Cannot see: User data on server (only in browser)
Data Token Privacy
Data tokens contain user claims, but:
- Short-lived: Expire in 5 minutes
- Single-use: Linked to specific authorization request
- Audience-bound: Only valid for specific client
- User-controlled: Only includes approved scopes
Master Key
The master key is the encryption key for user data:
- Never sent to server: Stored only client-side
- Derived from password: Using key derivation function
- Required for decryption: Cannot decrypt without it
- User responsibility: Lost master key = lost data
Passkey Support
Users can use passkeys instead of passwords:
- WebAuthn standard: Secure authentication
- No password required: More secure and convenient
- Same encryption: Data still encrypted with master key
Benefits
Privacy
- User data remains private
- Provider cannot read user data
- Only user can decrypt their data
Security
- Encrypted at rest
- Encrypted in transit
- No plaintext storage
User Control
- Users control what data to share
- Granular scope approval
- Can revoke access anytime
Limitations
Data Recovery
- If master key is lost, data cannot be recovered
- No password reset for encrypted data
- User must remember master key
Performance
- Encryption/decryption happens client-side
- Slightly slower than plaintext storage
- Acceptable trade-off for privacy
Comparison with Traditional OAuth
Traditional OAuth
User Data → Store Plaintext → OAuth Provider → /userinfo → Third-Party App
- Provider sees all user data
- Provider can read/modify data
- Privacy depends on provider
SVA OAuth (Zero-Knowledge)
User Data → Encrypt → Store Encrypted → Decrypt (Client) → Attest → Third-Party App
- Provider never sees plaintext
- Provider cannot read data
- Privacy by design
Best Practices
- Never send master key to server - Keep it client-side only
- Use strong passwords - For master key derivation
- Enable passkeys - More secure than passwords
- Backup master key - Store securely (user's responsibility)
- Educate users - About zero-knowledge and master key importance
Next Steps
- Learn about the OAuth Flow
- Understand Data Tokens
- Read about Service Communication