Skip to content

feat: flag-gated slices of spikes 637, 639, 640, 641 (SEP-10 sessions, network config, age gating, licensing) - #577

Merged
Darkvader-ship-it merged 1 commit into
PHASE-STELLAR:mainfrom
UltimateUser1:feat/spikes-637-639-640-641-auth-age-license-network
Oct 18, 2026
Merged

Darkvader-ship-it merged 1 commit into
PHASE-STELLAR:mainfrom
UltimateUser1:feat/spikes-637-639-640-641-auth-age-license-network

Conversation

@UltimateUser1

Copy link
Copy Markdown
Contributor

Summary

First flag-gated slices of four spikes. Each one ships default-off behind its own phase-* flag, so nothing changes for existing users until the flag is set.

Spike Issue Flag What lands
641 SEP-10 web auth #503 phase-162 Challenge tx issued by the server and signed by the wallet, verified and redeemed once, then an opaque 1h bearer session. Only the SHA-256 of the token is stored.
640 Mainnet readiness #502 phase-163 STELLAR_NETWORK picks the canonical passphrase. A conflicting override throws. Mainnet needs PHASE_MAINNET_CUTOVER_ACK=1. The viewer gate now resolves its passphrase through this module.
637 Age gating #499 phase-164 A birth year is declared against the SEP-10 session wallet. Only the derived band is stored, and the first declaration is final. Creating a world with age_gate: "18+" | "21+" requires a creator session and an age that meets the gate, otherwise 451 AGE_GATE_REQUIRED.
639 Licensing attestation #501 phase-165 The first world creation for a collection requires a creator-signed PHASE_LICENSE_ATTESTATION_V1 declaration. Rights basis is one of five values, and non-original bases need evidence_cid. Nonces are never reused and each collection is declared once.

Scope honesty

The four issues are written as 4–8 week spikes with testnet tx-hash proofs and full acceptance criteria. This PR does not claim to meet all of them. The gaps are listed below and recorded in PROJECT_ARCHITECTURE.md §10 and docs/TECHNICAL.md §15.

  • 641: existing acting_wallet / X-Wallet-Address routes are not migrated to sessions. No client wallet-kit flow yet.
  • 640: no seeding or ceremony tooling. No live mainnet proof.
  • 637: gating applies only to world creation. Viewer- and claim-side gating and KYC are not implemented.
  • 639: market listing, bulk CSV, and revocation do not yet surface or enforce the declaration.
  • Sidecar writes are unlocked (single-instance only, same as the other JSON sidecars).

Config

  • SEP10_SERVER_SECRET (server only), SEP10_HOME_DOMAIN, SEP10_WEB_AUTH_DOMAIN
  • STELLAR_NETWORK (testnet default), PHASE_MAINNET_CUTOVER_ACK
  • Flags: FEATURE_PHASE_162 … FEATURE_PHASE_165 (or the NEXT_PUBLIC_ variants)

Rollback

Unset the flags and restart. Auth routes return 404, gated world creation is ignored, and license attestation is no longer required. The new sidecars (auth-sessions.json, age-declarations.json, license-attestations.json) stay on disk and are inert.

Closes

Closes #503
Closes #502
Closes #499
Closes #501

…onfig, age gating, licensing)

Spike 641 (SEP-10 web auth):
- lib/sep10-auth.ts: challenge build/verify via WebAuth, single-use challenges,
  opaque hashed bearer sessions with 1h TTL
- GET /api/auth/challenge, POST/DELETE /api/auth/session
- flag phase-162

Spike 640 (mainnet readiness):
- lib/stellar-network.ts: STELLAR_NETWORK selects canonical passphrase,
  conflicting overrides throw, mainnet requires PHASE_MAINNET_CUTOVER_ACK=1
- viewer-authorization now resolves its passphrase through this module
- flag phase-163

Spike 637 (age gating):
- lib/age-gate.ts: conservative band from birth year, first declaration final,
  only the band is persisted
- POST /api/age-gate/declare bound to the session wallet
- POST /api/world accepts age_gate 18+/21+, returns 451 AGE_GATE_REQUIRED
- flag phase-164

Spike 639 (licensing attestation):
- lib/license-attestation.ts: PHASE_LICENSE_ATTESTATION_V1 canonical message,
  rights taxonomy with evidence rules, nonce-unique, one per collection
- POST /api/world requires license_attestation on first creation when enabled
- flag phase-165

Docs: PROJECT_ARCHITECTURE.md flag rows, docs/TECHNICAL.md env/sidecar section.

Closes PHASE-STELLAR#503
Closes PHASE-STELLAR#502
Closes PHASE-STELLAR#499
Closes PHASE-STELLAR#501

Co-Authored-By: Claude Haiku 5.5 <noreply@anthropic.com>
@drips-wave

drips-wave Bot commented Oct 18, 2026

Copy link
Copy Markdown

@UltimateUser1 Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Darkvader-ship-it
Darkvader-ship-it merged commit f67a0c9 into PHASE-STELLAR:main Oct 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment