> ## Documentation Index
> Fetch the complete documentation index at: https://v3.docs.derive.xyz/llms.txt
> Use this file to discover all available pages before exploring further.

# Authenticate a WebSocket connection

> WebSocket-only method that authenticates the connection so subsequent private/* calls and private channel subscriptions act on your wallet without per-request headers. Pass the wallet address, a millisecond UTC timestamp, and an EIP-191 signature of that timestamp made by either the wallet itself or one of its registered session keys. Returns the subaccount ids the authenticated key can access.



## AsyncAPI

````yaml websocket.asyncapi.json publicLogin
id: publicLogin
title: Authenticate a WebSocket connection
description: >-
  WebSocket-only method that authenticates the connection so subsequent
  private/* calls and private channel subscriptions act on your wallet without
  per-request headers. Pass the wallet address, a millisecond UTC timestamp, and
  an EIP-191 signature of that timestamp made by either the wallet itself or one
  of its registered session keys. Returns the subaccount ids the authenticated
  key can access.
servers:
  - id: production
    protocol: wss
    host: api.derive.xyz
    bindings: []
    variables: []
  - id: testnet
    protocol: wss
    host: testnet.api.derive.xyz
    bindings: []
    variables: []
address: /v3/ws
parameters: []
bindings: []
operations:
  - &ref_5
    id: send_publicLogin
    title: Send_public login
    type: receive
    messages:
      - &ref_7
        id: publicLoginRequest
        payload:
          - name: publicLoginRequest
            type: object
            properties:
              - name: headers
                type: &ref_0
                  - object
                  - 'null'
                description: Non-standard; used by `auth/login`.
                required: false
              - name: id
                type: anyOf
                required: true
              - name: method
                type: string
                description: public/login
                required: true
              - name: params
                type: object
                description: >-
                  Login params. The wallet/timestamp/signature fields are
                  typically supplied via headers (`X-Derive*`) for REST and via
                  the JSON body for websocket; all are optional on the wire and
                  validated server-side.
                required: true
                properties:
                  - name: signature
                    type: &ref_1
                      - string
                      - 'null'
                    required: false
                  - name: description
                    type: string
                    description: >-
                      Milliseconds since Unix epoch. Accepted as either a JSON
                      number or a string-encoded integer.
                    required: false
                  - name: wallet
                    type: &ref_2
                      - string
                      - 'null'
                    required: false
        headers: []
        jsonPayloadSchema:
          type: object
          required:
            - id
            - method
            - params
          properties:
            headers:
              description: Non-standard; used by `auth/login`.
              type: *ref_0
              additionalProperties: true
              x-parser-schema-id: <anonymous-schema-2>
            id: &ref_3
              anyOf:
                - type: string
                  x-parser-schema-id: <anonymous-schema-3>
                - type: number
                  x-parser-schema-id: <anonymous-schema-4>
                - type: 'null'
                  x-parser-schema-id: <anonymous-schema-5>
              x-parser-schema-id: JsonRpcId
            method:
              type: string
              const: public/login
              x-parser-schema-id: <anonymous-schema-6>
            params:
              description: >-
                Login params. The wallet/timestamp/signature fields are
                typically supplied via headers (`X-Derive*`) for REST and via
                the JSON body for websocket; all are optional on the wire and
                validated server-side.
              type: object
              properties:
                signature:
                  default: null
                  type: *ref_1
                  x-parser-schema-id: <anonymous-schema-7>
                timestamp:
                  description: >-
                    Milliseconds since Unix epoch. Accepted as either a JSON
                    number or a string-encoded integer.
                  default: null
                  x-parser-schema-id: <anonymous-schema-8>
                wallet:
                  default: null
                  type: *ref_2
                  x-parser-schema-id: <anonymous-schema-9>
              x-parser-schema-id: LoginRequest
          x-parser-schema-id: <anonymous-schema-1>
        title: Public login request
        example: |-
          {
            "method": "<string>",
            "params": {
              "description": "<string>"
            }
          }
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: publicLoginRequest
    bindings: []
    extensions: &ref_4
      - id: x-parser-unique-object-id
        value: publicLogin
  - &ref_6
    id: receive_publicLogin
    title: Receive_public login
    type: send
    messages:
      - &ref_8
        id: publicLoginResponse
        payload:
          - name: publicLoginResponse
            type: object
            properties:
              - name: id
                type: anyOf
                required: true
        headers: []
        jsonPayloadSchema:
          type: object
          anyOf:
            - type: object
              required:
                - result
              properties:
                result:
                  type: array
                  items:
                    type: integer
                    format: uint64
                    minimum: 0
                    x-parser-schema-id: <anonymous-schema-13>
                  x-parser-schema-id: <anonymous-schema-12>
              x-parser-schema-id: <anonymous-schema-11>
            - type: object
              required:
                - error
              properties:
                error:
                  type: object
                  required:
                    - code
                    - message
                  properties:
                    code:
                      type: integer
                      format: int64
                      x-parser-schema-id: <anonymous-schema-15>
                    data:
                      type:
                        - string
                        - 'null'
                      x-parser-schema-id: <anonymous-schema-16>
                    message:
                      type: string
                      x-parser-schema-id: <anonymous-schema-17>
                  x-parser-schema-id: RPCError
              x-parser-schema-id: <anonymous-schema-14>
          required:
            - id
          properties:
            id: *ref_3
          x-parser-schema-id: <anonymous-schema-10>
        title: Public login response
        example: '{}'
        bindings: []
        extensions:
          - id: x-parser-unique-object-id
            value: publicLoginResponse
    bindings: []
    extensions: *ref_4
sendOperations:
  - *ref_5
receiveOperations:
  - *ref_6
sendMessages:
  - *ref_7
receiveMessages:
  - *ref_8
extensions:
  - id: x-parser-unique-object-id
    value: publicLogin
securitySchemes: []

````

## Related topics

- [Connecting over WebSocket](/connecting.md)
- [Get remaining rate limits for the connection](/api-reference/system/get-remaining-rate-limits-for-the-connection.md)
- [Subscriptions](/subscriptions.md)
