Skip to main content
POST
/
v1
/
auth
/
challenge
Challenge
curl --request POST \
  --url https://api.amm.flashnet.xyz/v1/auth/challenge \
  --header 'Content-Type: application/json' \
  --data '{
  "publicKey": "021eec911553028dded1ec644144cd3afee9d9bfe7846af3cf8e6d84f4b3102389"
}'
{
"challenge": "464c4153484e45545f415554485f4348414c4c454e47455f56313a19f51e5e9b50314318517a5e2bb19e5beb94d9c5d74b61068ff458c75a649712",
"challengeString": "FLASHNET_AUTH_CHALLENGE_V1:19f51e5e9b50314318517a5e2bb19e5beb94d9c5d74b61068ff458c75a649712",
"requestId": "01H8Z0HMVXJN6A8Q9GR1J6Z34E"
}

Body

application/json

Public key for which to generate an authentication challenge

Request body for initiating authentication challenge.

This request starts the authentication flow by requesting a challenge string that must be signed with the user's private key.

publicKey
string
required

The public key of the user requesting authentication. Must be a valid Bitcoin or Spark public key.

Example:

"021eec911553028dded1ec644144cd3afee9d9bfe7846af3cf8e6d84f4b3102389"

Response

Challenge generated successfully

Response containing the challenge string to be signed.

The challenge is a hex string composed of an ASCII magic prefix followed by 32 random bytes. The entire byte sequence is what should be signed using the private key corresponding to the provided public key.

challenge
string
required

The challenge string that must be signed. Hex string of: "FLASHNET_AUTH_CHALLENGE_V1:" || 32 random bytes.

Example:

"464c4153484e45545f415554485f4348414c4c454e47455f56313a19f51e5e9b50314318517a5e2bb19e5beb94d9c5d74b61068ff458c75a649712"

challengeString
string
required

A UTF-8 string version of the challenge suitable for wallets that sign strings. Format: "FLASHNET_AUTH_CHALLENGE_V1:" + hex(random 32 bytes)

Example:

"FLASHNET_AUTH_CHALLENGE_V1:19f51e5e9b50314318517a5e2bb19e5beb94d9c5d74b61068ff458c75a649712"

requestId
string<ulid>
required

Unique request identifier for tracking and debugging.

Example:

"01H8Z0HMVXJN6A8Q9GR1J6Z34E"

I