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

# Verify a signed message

> Verifies a BIP-340 Schnorr signature over a prefixed hash (`SHA256("bark/message" || message)`) of the UTF-8 message bytes, as created by the `/message/sign` endpoint. The signature is checked against a public key (`pubkey`) or against the user public key of an Ark address (`address`); exactly one of the two must be set. Verification is stateless and works for signatures made by any wallet, not just this one.



## OpenAPI

````yaml https://gitlab.com/ark-bitcoin/bark/-/raw/master/bark-rest/openapi.json post /api/v1/message/verify
openapi: 3.1.0
info:
  title: barkd REST API
  description: >-
    A simple REST API for barkd, a wallet daemon for integrating bitcoin
    payments into your app over HTTP. Supports self-custodial Lightning, Ark,
    and on-chain out of the box.


    barkd is a long-running daemon best suited for always-on or
    high-connectivity environments like nodes, servers, desktops, and
    point-of-sale terminals.


    All endpoints return JSON. Amounts are denominated in satoshis.
  contact:
    name: Second Team
    email: hello@second.tech
  license:
    name: MIT
    identifier: MIT
  version: 0.6.0
servers: []
security:
  - bearer: []
tags:
  - name: boards
    description: Move on-chain bitcoin onto the Ark protocol.
  - name: exits
    description: Move bitcoin back on-chain without server cooperation.
  - name: fees
    description: Estimate fees for wallet operations before executing them.
  - name: history
    description: Inspect and annotate wallet movement history.
  - name: lightning
    description: Create Lightning invoices and track receives.
  - name: message
    description: Sign arbitrary messages with the wallet's keys and verify signed messages.
  - name: onchain
    description: Manage barkd's on-chain bitcoin wallet.
  - name: wallet
    description: Manage Ark balances and VTXOs, send payments via Ark, LN, and on-chain.
  - name: bitcoin
    description: Query bitcoin network data.
  - name: notifications
    description: Receive real-time notifications from barkd.
paths:
  /api/v1/message/verify:
    post:
      tags:
        - message
      summary: Verify a signed message
      description: >-
        Verifies a BIP-340 Schnorr signature over a prefixed hash
        (`SHA256("bark/message" || message)`) of the UTF-8 message bytes, as
        created by the `/message/sign` endpoint. The signature is checked
        against a public key (`pubkey`) or against the user public key of an Ark
        address (`address`); exactly one of the two must be set. Verification is
        stateless and works for signatures made by any wallet, not just this
        one.
      operationId: verify_message
      requestBody:
        content:
          application/json:
            schema:
              $ref: '#/components/schemas/VerifyMessageRequest'
        required: true
      responses:
        '200':
          description: Returns whether the signature is valid
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/MessageVerification'
        '400':
          description: >-
            Invalid signature, pubkey or address encoding, or not exactly one of
            pubkey and address set
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/BadRequestError'
        '500':
          description: Internal server error
          content:
            application/json:
              schema:
                $ref: '#/components/schemas/InternalServerError'
components:
  schemas:
    VerifyMessageRequest:
      type: object
      description: |-
        Request to verify a signed message

        Exactly one of `pubkey` and `address` must be set.
      required:
        - message
        - signature
      properties:
        address:
          type:
            - string
            - 'null'
          description: >-
            The Ark address whose user public key to verify the signature
            against
        message:
          type: string
          description: The message that was signed
        pubkey:
          type:
            - string
            - 'null'
          description: The public key to verify the signature against
        signature:
          type: string
          description: |-
            The BIP-340 Schnorr signature over the message digest
            `SHA256("bark/message" || message)`, in hex
    MessageVerification:
      type: object
      description: The result of verifying a signed message
      required:
        - valid
      properties:
        valid:
          type: boolean
          description: Whether the signature is valid for the given message and key
    BadRequestError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
    InternalServerError:
      type: object
      required:
        - message
      properties:
        message:
          type: string
  securitySchemes:
    bearer:
      type: http
      scheme: bearer
      bearerFormat: AuthToken
      description: Base64url-encoded auth token

````