Raidz identity and social linking
Status: production runtime active; external user consent has not been exercised as part of operator verification.
Trust model
Raidz creates a private creator profile and a random, HTTP-only, SameSite=Lax session before any provider is linked. The session contains no wallet key, OAuth token or Telegram credential. Users explicitly connect and disconnect each provider.
Wallet
- The web app uses Reown AppKit with the Ethers adapter instead of depending on a browser-injected wallet.
- The supported network is Robinhood Chain ID
4663; AppKit requests a switch when necessary. - The API creates a five-minute, single-use challenge bound to
app.raidz.fun, the checksummed wallet address, chain ID, issue time and expiry. - The message says explicitly that it is not a transaction or token approval.
- The server recovers the signer and rejects wrong-chain, wrong-wallet, invalid, expired, consumed and replayed proofs.
- Only the address, chain, verification time and signature hash are retained. The signature is not logged.
X
- OAuth 2.0 Authorization Code with PKCE and unpredictable state.
- Read-only scopes:
users.read,tweet.readandoffline.access. - No post, Like, Repost, Follow or reply scope.
- State and verifier expire after five minutes and are single-use.
- The verifier and returned token material are encrypted at rest with AES-256-GCM.
- The normalized public profile is retained; the provider subject is HMAC-hashed with a separate identity pepper.
- Callback, token and profile failures return a bounded reason code without leaking provider material.
- The production client, callback, PKCE challenge and read-only scope request have passed a provider authorization preflight. No operator completed a user-consent flow.
- A separate bearer-token identity lookup returned HTTP
402 Payment Required; X API reads may require PAYG usage balance before a post-consent profile lookup can complete. No plan, bundle, subscription or spend was purchased.
Telegram
- Telegram Login data is verified server-side using Telegram's HMAC construction.
- Payloads older than five minutes, more than one minute in the future, malformed hashes and invalid signatures are rejected.
- The provider subject is HMAC-hashed. Only normalized name, handle and public avatar URL are retained.
- Telegram account identity does not imply channel ownership; channel proof remains a separate future feature.
- The app also offers an explicit external link to
https://t.me/Raidz_fun. It never attempts to join a channel on a user's behalf. - The production bot is
@RaidzFun_bot. Its token passed provider validation, its command set is installed, and the bot is an administrator of@Raidz_fun.
Operational wallet
- A project hot wallet is separate from user wallet connection and never enters the browser bundle.
- Wallet material may be loaded only from the protected
/wallets/raidzvault or an external signer. - Secret files, private keys and seed phrases are never committed, logged or copied into deployment reports.
- The protected runtime wallet is configured for Robinhood Chain
4663; its public address is0x1352eF6957f8248DBCba4Ed96bb93B4E7a7406A9. - At verification it held
0 wei. No signing, funding, approval, transfer or transaction was attempted.
Profile privacy
- Profiles begin private and unavailable for work.
- Display name, bio, language, region, narrative and availability are user-controlled.
- Jurisdiction is collected for eligibility and is not public by default.
- Provider connections show a normalized handle/address and verification state, not credentials.
- Disconnect removes the social link and encrypted provider token, or revokes wallet linkage.
- Public-profile publishing remains an explicit toggle.
Threat cases and controls
| Threat | Control |
|---|---|
| Session fixation or theft | Random UUID session, HTTP-only Secure cookie, expiry, revocation field, no session ID in URLs |
| CSRF | SameSite cookie, JSON mutation requests, same-origin API proxy, disabled cross-origin API access |
| Wallet replay | Single-use database challenge, five-minute expiry, atomic consumption |
| Wrong domain/chain/wallet | Server-generated message bound to domain, chain 4663 and checksummed address |
| OAuth interception | PKCE S256, unpredictable state, session binding, exact redirect URI |
| OAuth secret disclosure | Server-only environment injection, AES-256-GCM at rest, logger redaction |
| Telegram replay/forgery | HMAC verification, timing-safe comparison and five-minute freshness window |
| Account collision | Unique provider-subject and user-provider constraints |
| Excessive social access | Read-only X scopes and explicit normalized-field consent |
| Accidental public exposure | Private and unavailable defaults; explicit visibility controls |
Production configuration
Secret values are delivered from a root-only host vault through read-only Compose mounts. The container entrypoint copies only an allowlist into a private in-container runtime directory, applies restrictive permissions, then drops to the unprivileged service account. Direct secret values are neither placed in Compose environment variables nor committed.
RAIDZ_AUTH_ENCRYPTION_KEY: base64url-encoded 32-byte keyRAIDZ_IDENTITY_PEPPER: high-entropy HMAC pepperRAIDZ_X_CLIENT_IDand, when required,RAIDZ_X_CLIENT_SECRETRAIDZ_TELEGRAM_BOT_TOKEN;RAIDZ_TELEGRAM_BOT_IDis optional because the numeric ID is derived from a valid token, andRAIDZ_TELEGRAM_BOT_USERNAMEis optional public metadataRAIDZ_REOWN_PROJECT_ID: Reown Cloud project ID, passed to the web build asNEXT_PUBLIC_REOWN_PROJECT_ID
The RAIDZ_* names above are host-side Compose inputs. Inside the API container, each secret may be supplied directly or through the corresponding AUTH_ENCRYPTION_KEY_FILE, IDENTITY_PEPPER_FILE, X_CLIENT_ID_FILE, X_CLIENT_SECRET_FILE, TELEGRAM_BOT_TOKEN_FILE, or RAIDZ_HOT_WALLET_FILE; production uses the file form. The registered X callback is exactly https://app.raidz.fun/api/v1/auth/x/callback. Provider buttons remain visibly gated when configuration is absent. The Telegram bot is packaged under the integrations Compose profile and runs only with its protected token mount.

ATTENTION, WITH PROOF.