MemoryVault
Privacy-first encrypted knowledge vault for notes.
Awards
The problem it solves
Nillion MemoryVault is a privacy-first personal knowledge base that addresses privacy and security concerns when storing and processing personal information.
Core Problems Solved:
-
Privacy-preserving storage: Notes, memories, code snippets, bookmarks, and documents are encrypted at rest using Nillion’s nilDB. Data is stored in a distributed, encrypted format where operators cannot see plaintext.
-
Private AI processing: AI features (search, Q&A, summarization) run in Trusted Execution Environments (TEEs) via nilAI. Queries and computations remain private—operators cannot see your queries or data.
-
Secure knowledge management: Store sensitive information (personal notes, job opportunities, research, ideas, code snippets, bookmarks) with confidence that it remains private and encrypted.
-
User data isolation: Email/password authentication ensures each user only sees their own notes. Data is isolated per user using Nillion’s decentralized identity (DID) system.
Use Cases:
- Personal knowledge base: Store and organize personal notes, ideas, and research
- Private journaling: Keep private thoughts and memories encrypted
- Research notes: Store research with AI-powered search and summarization
- Developer code library: Save code snippets with syntax highlighting and language detection, accessible privately
- Tweet/bookmark saving: Save tweets and bookmarks with full content preservation
- Question answering: Ask questions about your stored knowledge using private AI
How It Makes Tasks Easier/Safer:
- Zero-knowledge architecture: Your data is encrypted end-to-end; even service operators cannot access it
- AI-powered without privacy trade-offs: Get AI search, summarization, and Q&A without exposing data to third parties
- User-owned data: You control your data with selective sharing capabilities
- Secure by default: All operations use encryption and TEEs automatically
Challenges we ran into
Challenge 1: Module Initialization Conflicts
Problem: @nillion/nilai-ts bundles its own @nillion/nuc, causing conflicts when importing both @nillion/nuc and @nillion/secretvaults in Next.js. This led to runtime errors like TypeError: Cannot read properties of undefined (reading ‘add’).
Solution: Switched to dynamic imports for nilAI functions to defer module loading and prevent initialization conflicts. Instead of static imports at the top of files, I used await import(‘@nillion/nilai-ts’) inside functions to load modules only when needed.
Challenge 2: Circular Dependency in Authentication
Problem: A circular dependency between getNillionClients() → getUserSignerForAuthenticatedUser() → getUserById() → getNillionClients() caused the /notes API endpoint to hang indefinitely in a pending state.
Solution: Refactored getUserById() to create its own builder client directly instead of calling getNillionClients(), breaking the cycle. Added timeout handling to prevent indefinite hangs and provide better error diagnostics.
Challenge 3: User Lookup with Owned Collections Problem: The users collection was created as owned, which made listDataReferences() fail with 401 Unauthorized errors. Users couldn’t log in after registration because the system couldn’t find their accounts.
Solution: Implemented a deterministic UUID v4 generation from email hashes, allowing direct lookup via getUserById() instead of listing all references. This eliminated the need for listDataReferences() on owned collections and resolved authentication issues.