Verify Siwe Wallet Registration

POST /v1/auth/wallets/siwe/verify

Verifies the signature created by the wallet's private key signing a SIWE challenge using the SIWE EIP-4361 (Sign in with Ethereum) spec using the nonce returned by GetWalletRegistrationNonce and the wallet address used during registration. If successful, a wallet will be created and associated with the user. Wallet imported will be marked as is_imported and is_read_only true. If it is an existing associated wallet for the specified user, we allow you to create a Streambird managed session.

HTTP Request

POST /v1/auth/wallets/siwe/verify

Returns

A successful response returns a Wallet object.

application/json

Body

  • wallet_type string Required

    Determines the type of wallet to register. Possible values: ETH, SOL (more coming soon!).

    Minimum length is 1.

  • signature string Required

    Signed message using the associated private key of the wallet address. We ETH signed message to be base64 encoded (e.g. 0x...) and SOL signed message will be bs58 encoded or base64 encoded.

    Minimum length is 1.

  • public_address string Required

    Public wallet address of the wallet.

    Minimum length is 1.

  • siwe_challenge string Required

    Required SIWE challenge using the SIWE EIP-4361 (Sign in with Ethereum) spec using the nonce returned by GetWalletRegistrationNonce and the wallet address used during registration.

  • session_expires_in number

    Optional Extend the session expiration time to N minutes from now, must be between 5 to 525600 minutes (365 days). This parameter will create a new session if there is no existing session along with a session_token and session_jwt. However, if a valid session_token or session_jwt is sent in, it will extend that session by the minutes specified. If not sent in, no session will be created by default.

  • session_token string

    Optional Unique session token to verify.

  • session_jwt string

    Optional Unique Session JWT to verify.

Responses

  • 200 application/json
    Hide response attributes Show response attributes object
    • id string Required

      Minimum length is 1.

    • app_id string Required

      Minimum length is 1.

    • user_id string Required

      Minimum length is 1.

    • public_address string Required

      Minimum length is 1.

    • wallet_type string Required

      Minimum length is 1.

    • is_default boolean Required
    • is_ready_only boolean Required
    • is_imported boolean Required
    • updated_at number Required
    • created_at number Required
    • session_token string
    • session_jwt string
    • session object
      Hide session attributes Show session attributes object
      • id string Required

        Minimum length is 1.

      • user_id string Required

        Minimum length is 1.

      • session_token string Required

        Minimum length is 1.

      • started_at number Required
      • expires_at number Required
      • last_active_at number Required
      • factors array[object] Required

        At least 1 element.

        Hide factors attributes Show factors attributes object
        • delivery_channel string Required

          Delivery channel for this factor. Possible values: sms, email, totp_authenticator, totp_recovery_code, google_oauth, apple_oauth, microsoft_oauth, discord_oauth, okta_oauth, github_oauth, slack_oauth, facebook_oauth, webauthn_credential, eth_wallet, sol_wallet.

          Minimum length is 1.

        • type string Required

          Authentication type of factor. Possible values: otp, oauth, wallet, totp, webauthn.

          Minimum length is 1.

        • method object Required
          Hide method attributes Show method attributes object
          • id string
          • method_id string Required

            Minimum length is 1.

          • method_type string Required

            Identifier method type. Possible values: email, wallet, phone_number, webauthn.

            Minimum length is 1.

          • last_verified_at number Required
          • phone_number_id string

            Minimum length is 1.

          • phone_number string

            Minimum length is 1.

          • email_id string
          • email string
          • wallet_type string
          • wallet_id string
          • wallet_public_address string
          • totp_id string
          • webauthn_credential_id string
          • provider_subject string
      • device_fingerprint object Required
        Hide device_fingerprint attributes Show device_fingerprint attributes object
        • user_agent string Required
        • ip string Required

          Minimum length is 1.

      • updated_at number Required
      • created_at number Required
POST /v1/auth/wallets/siwe/verify
curl \
 --request POST 'https://api.streambird.io/v1/auth/wallets/siwe/verify' \
 --header "Authorization: Bearer $ACCESS_TOKEN" \
 --header "Content-Type: application/json" \
 --data '{"signature":"0xa6575d640856f2a0cffec992a868cb2ba52924705639d3ddc10bd454688d229d62e59024a9ad484b4f5215bbf081b4e40c83d24ea2908e82a9a5fc9ff804de1d1c","session_jwt":"eyJhbGciOiJSUzI1NiIsImtpZCI6Imp3a18yN0Q1dU9UaFIyZHNncmFYN1dWb0VMRzRxRVgiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE2NDkwODM0NjQsImlhdCI6MTY0OTAyMzQ2NCwiaXNzIjoiYXBpLnN0cmVhbWJpcmQuaW8vNmU3YzlmMWItNWU2Ni00MDBjLTk5YTctNzgzNDExZTAzYWFjIiwianRpIjoic2Vzc18yN0oxZG1OdWt5WFFtRlk4MjY3V1lJY1Z5QXciLCJuYmYiOjE2NDkwMjM0NjQsInNlc3Npb24iOnsiaW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7epBhmy_F0otObanJeiz3B0yjaAgjS9hGothupHuVdlmlpksTi118AMXXSgwHRUc6ythWC2Dbvbe4sVnkN1uq_liJ20KemOZgxkQ_O8l6Bx7Ri3Q","wallet_type":"ETH","public_address":"0xf082baC1eFbEF5156c788E4C6f586447c14eCF96","siwe_challenge":"api.streambird.io wants you to sign in with your Ethereum account:\n0xf082baC1eFbEF5156c788E4C6f586447c14eCF96\n\nBy signing in you accept the Terms of Service\n\nURI: https://api.streambird.io/\nVersion: 1\nChain ID: 1\nNonce: 2Dht-Du_BK3wgFrjFWXp1nbCkmzHTfmFGEniTD7NiuY\nIssued At: 2022-07-04T02:07:27.184Z\nExpiration Time: 2022-07-04T03:07:27.184Z","session_expires_in":1000}'
Request example
{
  "signature": "0xa6575d640856f2a0cffec992a868cb2ba52924705639d3ddc10bd454688d229d62e59024a9ad484b4f5215bbf081b4e40c83d24ea2908e82a9a5fc9ff804de1d1c",
  "session_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imp3a18yN0Q1dU9UaFIyZHNncmFYN1dWb0VMRzRxRVgiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE2NDkwODM0NjQsImlhdCI6MTY0OTAyMzQ2NCwiaXNzIjoiYXBpLnN0cmVhbWJpcmQuaW8vNmU3YzlmMWItNWU2Ni00MDBjLTk5YTctNzgzNDExZTAzYWFjIiwianRpIjoic2Vzc18yN0oxZG1OdWt5WFFtRlk4MjY3V1lJY1Z5QXciLCJuYmYiOjE2NDkwMjM0NjQsInNlc3Npb24iOnsiaWQiOiJzZXNzXzI3SjFkbU51a3lYUW1GWTgyNjdXWUljVnlBdyIsInVzZXJfaWQiOiJ1c2VyXzI2a2tha3RybDNabmhRNk1qMmg5bUM3QTlwcyIsInN0YXJ0ZWRfYXQiOjE2NDkwMjM0NjQsImV4cGlyZXNfYXQiOjE2NDkwODM0NjQsImxhc3RfYWN0aXZlX2F0IjoxNjQ5MDIzNDY0LCJmYWN0b3JzIjpbeyJkZWxpdmVyeV9jaGFubmVsIjoiZXRoX3dhbGxldCIsInR5cGUiOiJ3YWxsZXQiLCJtZXRob2QiOnsibWV0aG9kX2lkIjoid2FsbGV0XzI2a2tha2FSTHY1QmlTZFQxQVhGaVhybHpJaCIsIm1ldGhvZF90eXBlIjoid2FsbGV0Iiwid2FsbGV0X3B1YmxpY19hZGRyZXNzIjoiMHhmN2U5ZDYzMWJmYmQ5MGMxOTY5MTU2NmRiNGFiOTY2OTdhMjY2M2M2Iiwid2FsbGV0X3R5cGUiOiJFVEgiLCJ3YWxsZXRfaWQiOiJ3YWxsZXRfMjZra2FrYVJMdjVCaVNkVDFBWEZpWHJsekloIiwibGFzdF92ZXJpZmllZF9hdCI6MTY0OTAyMzQ2NH19XSwiZGV2aWNlX2ZpbmdlcnByaW50Ijp7InVzZXJfYWdlbnQiOiIiLCJpcCI6IiJ9LCJ1cGRhdGVkX2F0IjoxNjQ5MDIzNDY0LCJjcmVhdGVkX2F0IjoxNjQ5MDIzNDY0fSwic3ViIjoidXNlcl8yNmtrYWt0cmwzWm5oUTZNajJoOW1DN0E5cHMifQ.AE4JinNKZ6h9ywoHkF39m6zzzb7XexTJJOZMKLwAUJ26n9v04H8aftbbhBypah6iL6Nq0ni1dBkDyoCqgGuYsjK5Zr9XvJijlgKy1j2PUjCBAzc6CmvRlUqh9Ek2PZNyKdtzjDaWUr0e-Gw8WV_1c0G8zF1pylkr0Rk3aysTuXlRh7NWOt8-s7_tZ9Ip9FF2LnzSzz4nDF_EiJ_lI_hbKUDHiizlZQQX3vOXxe7epBhmy_F0otObanJeiz3B0yjaAgjS9hGothupHuVdlmlpksTi118AMXXSgwHRUc6ythWC2Dbvbe4sVnkN1uq_liJ20KemOZgxkQ_O8l6Bx7Ri3Q",
  "wallet_type": "ETH",
  "public_address": "0xf082baC1eFbEF5156c788E4C6f586447c14eCF96",
  "siwe_challenge": "api.streambird.io wants you to sign in with your Ethereum account:\n0xf082baC1eFbEF5156c788E4C6f586447c14eCF96\n\nBy signing in you accept the Terms of Service\n\nURI: https://api.streambird.io/\nVersion: 1\nChain ID: 1\nNonce: 2Dht-Du_BK3wgFrjFWXp1nbCkmzHTfmFGEniTD7NiuY\nIssued At: 2022-07-04T02:07:27.184Z\nExpiration Time: 2022-07-04T03:07:27.184Z",
  "session_expires_in": 1000
}
Response examples (200)
{
  "id": "wallet_2BpCqurnVmDESIkexSQ1iIj8CQr",
  "app_id": "app_24ydphdixx2ydhF0E5WUFUKWNqi",
  "session": {
    "id": "sess_2BpH3x6gbCs3XC5uSKdh3TuLU3H",
    "factors": [
      {
        "type": "wallet",
        "method": {
          "method_id": "wallet_2BpCqurnVmDESIkexSQ1iIj8CQr",
          "wallet_id": "wallet_2BpCqurnVmDESIkexSQ1iIj8CQr",
          "method_type": "wallet",
          "wallet_type": "ETH",
          "last_verified_at": 1657595910,
          "wallet_public_address": "0xf082bac1efbef5156c788e4c6f586447c14ecf96"
        },
        "delivery_channel": "eth_wallet"
      }
    ],
    "user_id": "user_2BpCqz8xdXrNllJ8CxXmyzMoZYb",
    "created_at": 1657595910,
    "expires_at": 1657655910,
    "started_at": 1657595910,
    "updated_at": 1657595910,
    "permissions": null,
    "last_active_at": 1657595910,
    "device_fingerprint": {
      "ip": "",
      "user_agent": ""
    }
  },
  "user_id": "user_2BpCqz8xdXrNllJ8CxXmyzMoZYb",
  "verified": true,
  "created_at": 1657593833,
  "is_default": false,
  "updated_at": 1657595025,
  "is_imported": true,
  "session_jwt": "eyJhbGciOiJSUzI1NiIsImtpZCI6Imp3a18yN0Q1dU9UaFIyZHNncmFYN1dWb0VMRzRxRVgiLCJ0eXAiOiJKV1QifQ.eyJleHAiOjE2NTc2NTU5MTAsImh0dHBzOi8vc3RyZWFtYmlyZC5pby9qd3Qvc2Vzc2lvbiI6eyJpZCI6InNlc3NfMkJwSDN4NmdiQ3MzWEM1dVNLZGgzVHVMVTNIIiwidXNlcl9pZCI6InVzZXJfMkJwQ3F6OHhkWHJObGxKOEN4WG15ek1vWlliIiw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