Raxx · internal docs

internal · gated ↑ index

ADR 0017 — Founders Referral: 6-byte base64url slug for link identifiers

Status: Proposed Date: 2026-04-23 Deciders: software-architect Related: docs/architecture/founders-referral-service.md §4 Parent card: #207


Context

Each Founder gets a unique, shareable referral link. The slug in that link must be:

Three practical options existed: sequential integer IDs, UUID v4, and short random base64url tokens.


Decision

Generate 6 random bytes via os.urandom(6) (or platform CSPRNG equivalent), base64url-encode (RFC 4648 §5, no padding), yielding an 8-character URL-safe slug.

Link format: https://getraxx.com/r/{8-char-slug}

On collision (DB UNIQUE violation on slug): retry up to 3 times, then raise an application error. Collision is expected once every ~281 trillion slugs at any practical cohort size.


Consequences

Positive

Negative


Alternatives considered

UUID v4 (128-bit / 36 chars)

UUID v4 is cryptographically sound and collision-resistant. Rejected because it produces 36-character strings including hyphens, which are cumbersome to share verbally or in short messages. The URL would be https://getraxx.com/r/550e8400-e29b-41d4-a716-446655440000 — not user-friendly.

Sequential integer ID (e.g., Founder #127)

Simple, zero collision risk. Rejected because it is guessable and enumerable: a bad actor can iterate all Founder IDs, attribute signups to arbitrary Founders, and manipulate referral attribution. Even if attribution has limited monetary value in v1, the principle of not having guessable resource identifiers in a trading-adjacent product applies.

ULID (128-bit, 26 chars, time-sortable)

Better than UUID for readability; still 26 characters. Also encodes a timestamp, which leaks link-creation timing. Rejected on both length and information-leakage grounds.


Revisit when