Keyboard shortcuts

Press or to navigate between chapters

Press S or / to search in the book

Press ? to show this help

Press Esc to hide this help

Validation Rules

This appendix documents all input validation rules enforced by the server.

Username

PropertyRule
Length1–64 characters
First characterMUST be ASCII alphanumeric ([a-zA-Z0-9])
Allowed charactersASCII letters, digits, and underscores ([a-zA-Z0-9_])
UniquenessMUST be unique across the server

Regex: ^[a-zA-Z0-9][a-zA-Z0-9_]{0,63}$

Error message: "username must start with a letter or digit and contain only ASCII letters, digits, and underscores"

Group Name

Group names follow the same rules as usernames.

PropertyRule
Length1–64 characters
First characterMUST be ASCII alphanumeric ([a-zA-Z0-9])
Allowed charactersASCII letters, digits, and underscores ([a-zA-Z0-9_])
UniquenessMUST be unique across the server

Regex: ^[a-zA-Z0-9][a-zA-Z0-9_]{0,63}$

Password

PropertyRule
Minimum length8 characters

No maximum length or character restrictions.

Error message: "password must be at least 8 characters"

Alias (Display Name)

Used for both user aliases and group aliases.

PropertyRule
Maximum length64 characters
Forbidden charactersASCII control characters: 0x000x1F and 0x7F
UnicodeAllowed
UniquenessNOT required

Error messages:

  • "alias exceeds maximum length" (if > 64 characters)
  • "must not contain ASCII control characters" (if contains control characters)

Registration Token

PropertyRule
Allowed charactersASCII letters, digits, underscores, and hyphens ([a-zA-Z0-9_-])
Validation timingValidated at server config load time
ComparisonMUST use constant-time equality

Key Package Data

PropertyRule
Minimum size4 bytes
Maximum size16,384 bytes (16 KiB)
Bytes 0–1MUST be 0x00 0x01 (MLS version 1.0)
Bytes 2–3MUST be 0x00 0x05 (wire format mls_key_package, per RFC 9420 Section 6)

Message Expiry Seconds

PropertyRule
Allowed values-1 (disabled), 0 (delete-after-fetch), or any positive integer
Server constraintWhen the server has a non-disabled retention policy (not "-1"), the group expiry MUST NOT exceed the server retention value

Message Fetch Limit

PropertyRule
Default100 messages per request
Maximum500 messages per request

Values above 500 are capped to 500.

Signing Key Fingerprint

PropertyRule
FormatLowercase hexadecimal string
Length64 characters (SHA-256 output = 256 bits = 64 hex digits)
ValidationNot strictly validated on upload; stored as-is

Key Package Count Limits

PropertyRule
Maximum regular packages per user10
Maximum last-resort packages per user1 (new upload replaces previous)
Rate limit on consumption10 requests per minute per target user