Consumer Authentication

/

API reference

/

Crypto wallets

/

Authenticate start

Start Crypto Wallet authentication

POSThttps://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

crypto_wallet_address*string

user_idstring

session_tokenstring

session_jwtstring

siwe_paramsobject

Response fields


status_codeint

request_idstring

user_idstring

challengestring

user_createdboolean
curl --request POST \
  --url https://test.stytch.com/v1/crypto_wallets/authenticate/start \
  -u 'PROJECT_ID:SECRET' \
  -H 'Content-Type: application/json' \
  -d '{
    "crypto_wallet_type": "ethereum",
    "crypto_wallet_address": "0x6df2dB4Fb3DA35d241901Bd53367770BF03123f1"
  }'

RESPONSE

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
}

Common Error Types