Skip to content

[BUG][STELLAR ADDRESSES] Preserve canonical StrKey case and validate wallet fields #191

Description

@Obiajulu-gif

Summary

Administrative user routes lowercase wallet values before storing them, while the user schema accepts arbitrary strings. Stellar StrKeys should be decoded and re-encoded canonically rather than treated like case-insensitive emails.

Repository evidence

  • app/api/users/route.ts:41-44 lowercases walletAddress; app/api/users/[id]/route.ts:67-70 does the same.
  • models/User.ts:89-99 defines unique wallet strings without Stellar validation.

Scope

  • Validate account IDs with the shared Stellar StrKey validator and store canonical encoded values.
  • Reject contract IDs, muxed accounts, malformed keys, and case-altered values where unsupported.

Acceptance criteria

  • Valid G-addresses round-trip unchanged and invalid inputs fail before persistence.
  • Existing lowercase/corrupt values receive a safe migration report.

Tests

  • Cover canonical, lowercase, wrong checksum, wrong key type, whitespace, and duplicate variants.

Non-goals

  • Implementing wallet ownership proof, tracked separately.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

GrantFox OSSIssue tracked in GrantFox OSSMaybe RewardedIssue may be eligible for a GrantFox rewardThird CampaignCampaign: Third Campaign

Type

No type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions