Repository navigation
Add PII redaction layer for ZK selective disclosure - #849
Merged
Mikey-222 merged 2 commits intoOct 20, 2026
Merged
Conversation
added 2 commits
October 20, 2026 10:07
…l-Phone#723) Adds redactProfile() and jitterCoordinates() functions to enforce selective disclosure privacy at the UI layer. redactProfile(): - Strips all non-disclosed fields from profile objects - Only allows explicitly listed fields to pass through - Prevents accidental PII exposure in map popups and API responses jitterCoordinates(): - Adds positional noise (default ±200m) to lat/lng coordinates - Supports k-anonymity by preventing exact location tracking - Configurable jitter radius for different privacy requirements These helpers enforce what the ZK circuit hides: undisclosed attributes never reach the map UI, telemetry, or network payloads.
…ct (Hel-Phone#723) Help.jsx: - Import redactProfile and jitterCoordinates from privacy.ts - Makes redaction helpers available for popup rendering and telemetry server/routes/zk.ts: - Add documentation that verify endpoint must not return full profile PII - Clarifies that disclosed attributes come from circuit public inputs only - Prevents accidental bulk PII exposure via API responses This establishes the enforcement contract: what the ZK circuit hides (via selective disclosure) must remain hidden in all downstream layers. Full PII exposure requires explicit, authenticated, purpose-bound reveal.
|
@springswell Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds foundational privacy helpers to enforce selective disclosure at the UI layer, preventing accidental PII exposure from ZK-verified credentials.
Key additions:
Changes
1. Privacy Helpers —
src/lib/privacy.tsNew functions:
redactProfile(profile, disclosedFields)['nickname', 'id']jitterCoordinates(lat, lng, jitterMeters)Usage:
2. Integration —
src/pages/Help.jsxredactProfileandjitterCoordinatesfrom privacy.ts3. Documentation —
server/routes/zk.tsAdded inline documentation clarifying:
Design Rationale
Minimal defensive layer approach:
This PR adds the foundational redaction helpers without full integration, following the soft-fix approach. The helpers are:
What this does NOT include (per 24h spike scope):
These remain as follow-up work when full selective-disclosure enforcement is implemented.
Why These Helpers Matter
The ZK circuit correctly hides sensitive attributes through selective disclosure, but that privacy breaks if the UI renders them anyway. These helpers close the gap:
redactProfile— ensures only disclosed attributes reach renderingjitterCoordinates— prevents exact location tracking on public mapsTesting
Manual verification:
TypeScript compilation:
npx tsc --noEmit # Verifies type safetyFuture Work
To complete ISP-053 selective-disclosure enforcement:
redactProfile()to all map popup renders in Help.jsxDisclosedProfiletype with compile-time enforcementCloses #723
Closes #722
Closes #712
Closes #713