Context
walletAliasService.ts resolves wallet identity links across aliases and sources. referralService.ts already depends on canonical wallet resolution via this service.
Problem / Gap
Alias mappings are stored only in memory. Restarts wipe alias registrations, breaking referral attribution and any admin workflows that rely on persisted identity links.
Proposed approach
- Add Prisma tables for canonical wallet IDs, alias rows, and source metadata.
- Implement upsert/merge semantics matching current in-memory behavior.
- Seed service from DB on startup; keep in-memory cache for hot reads.
- Add admin endpoints to list and delete alias groups if not already exposed.
Acceptance criteria
Files/areas affected
backend/src/walletAliasService.ts
backend/src/walletAliasEndpoints.ts
backend/src/referralService.ts
backend/prisma/schema.prisma
Context
walletAliasService.tsresolves wallet identity links across aliases and sources.referralService.tsalready depends on canonical wallet resolution via this service.Problem / Gap
Alias mappings are stored only in memory. Restarts wipe alias registrations, breaking referral attribution and any admin workflows that rely on persisted identity links.
Proposed approach
Acceptance criteria
Files/areas affected
backend/src/walletAliasService.tsbackend/src/walletAliasEndpoints.tsbackend/src/referralService.tsbackend/prisma/schema.prisma