authenticate function will return the user’s wallet address and a signed message that verifies wallet ownership. This should be the primary authentication method for your Mini App.
Uses Sign In With Ethereum (SIWE) to sign a message that contains a nonce that should be generated in your backend.
Usage
Parameters
If present, it must be at least 8 alphanumeric characters in length.
A unique nonce for the authentication request. This should be generated in your backend and be different for each authentication attempt.
The chain id to use for the authentication request. This parameter is required.
Optional requirements for the authentication request.
An array of claim keys that you want to request from the user. The available claim keys are defined in the
ClaimKey enum. See the Types documentation for the complete list of available claim keys.Returns
The result of the authentication attempt.
SUCCESS: The authentication was successful.FAILED: The authentication failed.CANCELLED: The authentication was cancelled by the user.
Contains the wallet address, granted claims, signature and message. Only present when the result is
SUCCESS.wallet: The wallet address of the authenticated user.grantedClaims: An array ofMiniAppGrantedClaimobjects containing the claims granted by the user. Each object has akey(theClaimKey) and avalue(the claim’s value). This will contain the claims that were requested in therequirements.claimsparameter, if provided.signature: The cryptographic signature proving the user’s authentication.message: The message that was signed by the user’s wallet.
Contains the error details when the authentication fails. Only present when the result is
FAILED.message: A human-readable error message describing what went wrong.code: A machine-readable error code for programmatic error handling.
Complete Authentication Flow
Backend endpoints The backend is responsible for generating a nonce and verifying the signature.ERC-6492 Support
The smart contract wallet is deployed on the first user’s transaction. Theauthenticate method supports ERC-6492 for contract wallets that are not yet deployed. This means users can authenticate even before their wallet contract is deployed.