Skip to main content
POST
/
v1
/
crypto_wallets
/
authenticate
/
start
C#
// POST /v1/crypto_wallets/authenticate/start
const stytch = require('stytch');

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

const params = {
  crypto_wallet_type: "ethereum",
  crypto_wallet_address: "${exampleEthereumAddress}",
};

client.CryptoWallets.AuthenticateStart(params)
  .then(resp => { console.log(resp) })
  .catch(err => { console.log(err) });
{
  "request_id": "<string>",
  "user_id": "<string>",
  "challenge": "<string>",
  "user_created": true,
  "status_code": 123
}
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.

Authorizations

Authorization
string
header
required

Basic authentication header of the form Basic <encoded-value>, where <encoded-value> is the base64-encoded string username:password.

Body

application/json

Request type

crypto_wallet_type
string
required

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
required

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.

Response

Successful response

request_id
string
required

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
required

The unique ID of the affected User.

challenge
string
required

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

user_created
boolean
required

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

status_code
integer<int32>
required

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.