/
Contact usSee pricingStart building
    Introduction
    Overview
    Postman
    Users
      Create user
      Search users
      Get user
      Update user
      Exchange primary factor
    • Delete

      • Delete user
        Delete user email
        Delete user phone number
        Delete user WebAuthn registration
        Delete user biometric registration
        Delete user TOTP
        Delete user crypto wallet
        Delete user password
        Delete user OAuth registration
    Magic links
    • Via email

      • Send magic link
        Log in or create user
        Invite
        Revoke pending invite
    • Embeddable

      • Create
      Authenticate
    OAuth
      Attach
      Authenticate
    • Start

      • Google
        Amazon
        Apple
        Bitbucket
        Coinbase
        Discord
        Facebook
        Figma
        GitHub
        GitLab
        Linkedin
        Microsoft
        Salesforce
        Slack
        Snapchat
        TikTok
        Twitch
        Twitter
        Yahoo
    Passwords
      Create
      Authenticate
      Strength check
      Migrate
    • Reset options

      • Password reset by email start
        Password reset by email
        Password reset by existing password
        Password reset by session
    One-time passcodes (OTP)
    • Via SMS

      • Send
        Login or create user
    • Via Whatsapp

      • Send
        Login or create user
    • Via email

      • Send
        Login or create user
      Authenticate
    Session management
      Session object
      Get JWKS
      Get sessions
      Authenticate Session
      Revoke session
      Migrate session
      Attest Session
      Exchange Access Token
    Passkeys & WebAuthn
    • Register

      • Start
        Register
    • Authenticate

      • Start
        Authenticate
      Update
      List WebAuthn Credentials
    Time-based one-time passcodes (TOTP)
      Create
      Authenticate
      Get recovery codes
      Recover
    Crypto wallets
      Authenticate start
      Authenticate
    M2M Authentication
      M2M Client Object
    • Token

      • Get Access Token
        Authenticate Access Token
    • M2M Client

      • Create M2M client
        Get M2M client
        Search M2M clients
        Update M2M client
        Delete M2M client
    • Rotate secret

      • Start secret rotation
        Rotate secret
        Cancel secret rotation
    Connected Apps
      Exchange Authorization Code
      Exchange Refresh Token
    • Tokens

      • Connected App ID Token Object
        Connected App Access Token Object
    • Configuration

      • Get JWKS
        Get OpenID Configuration
    • Methods

      • Introspect Token
        Authenticate Access Token (Local)
        Revoke Token
        Get UserInfo
    • Consent Management

      • Start OAuth Authorization
        Submit OAuth Authorization
        Get Authorized Connected Apps for a User
        Revoke Connected App Access to a User
    • Application Management

      • Dynamic Client Registration
        Create Connected App
        Get Connected App
        Search Connected Apps
        Update Connected App
        Delete Connected App
    • Rotate secret

      • Start secret rotation
        Rotate secret
        Cancel secret rotation
    RBAC
      Resource object
      Role object
      Scope object
      Get RBAC Policy
    User Impersonation
      Authenticate Token
    Resources
      Email templates
      URL validation
      Metadata
      User states
    Errors
      Overview
      Error object
      400
      401
      403
      404
      405
      429
      499
      500
      503
Get support on SlackVisit our developer forum

Contact us

Consumer Authentication

/

API reference

/

Crypto wallets

/

Authenticate start

Start Crypto Wallet authentication

POST
https://test.stytch.com/v1/crypto_wallets/authenticate/start

Initiate the authentication of a crypto wallet. After calling this endpoint, the user will need to sign a message containing the returned challenge field.

For Ethereum crypto wallets, you can optionally use the Sign In With Ethereum (SIWE) protocol for the message by passing in the siwe_params. The only required fields are domain and uri. If the crypto wallet detects that the domain in the message does not match the website's domain, it will display a warning to the user.

If not using the SIWE protocol, the message will simply consist of the project name and a random string.


Body parameters


crypto_wallet_type* string

The type of wallet to authenticate. Currently ethereum and solana are supported. Wallets for any EVM-compatible chains (such as Polygon or BSC) are also supported and are grouped under the ethereum type.


crypto_wallet_address* string

The crypto wallet address to authenticate.


user_id string

The unique ID of a specific User. You may use an external_id here if one is set for the user.


session_token string

The session_token associated with a User's existing Session.


session_jwt string

The session_jwt associated with a User's existing Session.


siwe_params object

The parameters for a Sign In With Ethereum (SIWE) message. May only be passed if the crypto_wallet_type is ethereum.

domain* string

Only required if siwe_params is passed. The domain that is requesting the crypto wallet signature. Must be an RFC 3986 authority.

uri* string

Only required if siwe_params is passed. An RFC 3986 URI referring to the resource that is the subject of the signing.

statement string

A human-readable ASCII assertion that the user will sign. The statement may only include reserved, unreserved, or space characters according to RFC 3986 definitions, and must not contain other forms of whitespace such as newlines, tabs, and carriage returns.

chain_id string

The EIP-155 Chain ID to which the session is bound. Defaults to 1. Must be the string representation of an integer between 1 and 9,223,372,036,854,775,771, inclusive.

issued_at string

The time when the message was generated. Defaults to the current time. All timestamps in our API conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.

not_before string

The time when the signed authentication message will become valid. Defaults to the current time. All timestamps in our API conform to the RFC 3339 standard and are expressed in UTC, e.g. 2021-12-29T12:33:09Z.

message_request_id string

A system-specific identifier that may be used to uniquely refer to the sign-in request. The message_request_id must be a valid pchar according to RFC 3986 definitions.

resources array[string]

A list of information or references to information the user wishes to have resolved as part of authentication. Every resource must be an RFC 3986 URI.


Response fields


status_code int

The HTTP status code of the response. Stytch follows standard HTTP response status code patterns, e.g. 2XX values equate to success, 3XX values are redirects, 4XX are client errors, and 5XX are server errors.


request_id string

Globally unique UUID that is returned with every API call. This value is important to log for debugging purposes; we may ask for this value to help identify a specific API call when helping you debug an issue.


user_id string

The unique ID of the affected User.


challenge string

A challenge string to be signed by the wallet in order to prove ownership.


user_created boolean

In login_or_create endpoints, this field indicates whether or not a User was just created.

const stytch = require('stytch');

const client = new stytch.Client({
  project_id: 'PROJECT_ID',
  secret: 'SECRET',
});

const params = {
  crypto_wallet_type: "ethereum",
  crypto_wallet_address: "0x6df2dB4Fb3DA35d241901Bd53367770BF03123f1",
};

client.cryptoWallets.authenticateStart(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
RESPONSE 200
200
​
{
  "status_code": 200,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "user_id": "user-test-16d9ba61-97a1-4ba4-9720-b03761dc50c6",
  "challenge": "Signing in with Project: 7_EPetPqfdEiDCJtgad6-xsXytN3Ee9tx6mdRTQK3fC7-J2PDxpP1GAvYB9Ic4E09h-K88STiRIzKSGP",
  "user_created": true
}
RESPONSE 400
200
​
{
  "status_code": 400,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "invalid_user_id",
  "error_message": "user_id format is invalid.",
  "error_url": "https://stytch.com/docs/api/errors/400"
}
RESPONSE 404
200
​
{
  "status_code": 404,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "user_not_found",
  "error_message": "User could not be found.",
  "error_url": "https://stytch.com/docs/api/errors/404"
}
RESPONSE 429
200
​
{
  "status_code": 429,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "too_many_requests",
  "error_message": "Too many requests have been made.",
  "error_url": "https://stytch.com/docs/api/errors/429"
}
RESPONSE 500
200
​
{
  "status_code": 500,
  "request_id": "request-id-test-b05c992f-ebdc-489d-a754-c7e70ba13141",
  "error_type": "internal_server_error",
  "error_message": "Oops, something seems to have gone wrong, please reach out to support@stytch.com to let us know what went wrong.",
  "error_url": "https://stytch.com/docs/api/errors/500"
}

Common Error Types

  • invalid_ethereum_address
  • invalid_solana_address
  • invalid_wallet_address_user
  • invalid_wallet_type