Skip to content

RFC: Atomic existing-user-only authentication for Web3 sign-in #2915

Open

Description

@RxVince

Summary

Request for feedback on a proposed existing-user-only Web3 authentication mode before merging implementation work.

Motivation

Some applications need to re-authenticate an existing Web3-linked account with transactional guarantees that Auth will never create a new user if identity resolution races with deletion, replacement, or concurrent login. Client-side checks are insufficient.

Proposal (high level)

  1. POST /web3/challenge — bind a one-time nonce to an existing verified identity + user UUID (request_id: WEB3_EXISTING_USER_ONLY). No session.
  2. Wallet signs SIWE/SIWS including that request ID and nonce.
  3. POST /token?grant_type=web3 with existing_user_only: true — consume challenge under row locks and issue tokens, or refuse without signup fallback.

Default Web3 signup/login behavior remains unchanged when existing_user_only is false or omitted.

Full RFC

The complete RFC (problem, semantics, invariants, rollout, open questions) is in the draft implementation branch:

https://github.com/RxVince/auth/blob/feat/web3-atomic-existing-user-only/docs/rfc/web3-atomic-existing-user-only-auth.md

Design notes: https://github.com/RxVince/auth/blob/feat/web3-atomic-existing-user-only/docs/web3-existing-user-only.md

Draft implementation

A draft PR against master will be linked below for review of tests and migration. This issue is for design feedback; maintainers may prefer changes before code review.

Maintainer questions

  • API naming and privacy of the challenge endpoint.
  • SDK surfacing and capability detection on hosted projects.
  • Whether optional expected_user_id belongs in v1.

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions