> For the complete documentation index, see [llms.txt](https://docs.aurowallet.com/general/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.aurowallet.com/general/howto/verifymessage-in-server-side.md).

# VerifyMessage in server-side

This scenario mainly explains how the server-side verify the result of the signMessage. Fields verification can also be implemented using mina-signer. Only signMessage examples are provided here.

{% hint style="info" %}
The features is implemented through [mina-signer](https://www.npmjs.com/package/mina-signer).

**mina-signer** is the NodeJS SDK provided by Mina Protocol for sign, verify signatures, etc.
{% endhint %}

## Verify Message

1. Add **mina-signer** to `package.json`.

```json
"dependencies": {
    "mina-signer": "2.1.1"
}
```

2. Import and init **mina-signer**.

```typescript
var Client = require("mina-signer");

// type Network = 'mainnet' | 'testnet'
var signerClient = new Client({ network: "mainnet" });
```

{% hint style="info" %}
There are two types of initialization supported here. The main network type is **mainnet**, and the type of other network are **testnet**. [See original definition.](https://github.com/o1-labs/o1js/blob/main/src/mina-signer/src/TSTypes.ts#L12)
{% endhint %}

3. Implement code.

```javascript
const publicKey = 'B62qj6z7oseWTr37SQTn53mF8ebHn45cmSfRC58Sy52wG6KcaPZNWjw'

const verifyMessage = `Click "Sign" to sign in. No password needed!

  This request will not trigger a blockchain transaction or cost any gas fees.
  
  I accept the Auro Test zkApp Terms of Service: https://test-zkapp.aurowallet.com
  
  address: B62qj6z7oseWTr37SQTn53mF8ebHn45cmSfRC58Sy52wG6KcaPZNWjw
  iat: 1701069403643`;

const signature = {
    field: '25087624681052481871246375076085075176624243458008290192358519021588472251513',
    scalar: '17285357755862735391605884635523872951699156489623612197745807470058903167470'
}

const verifyBody = {
    data: verifyMessage, // Signature content that needs to be verified.
    publicKey: publicKey, // Public key that needs to be verified.
    signature: signature, // Signature results that need to be verified.
};

// When verifyResult is true, the verification is successful.
const verifyResult = signerClient.verifyMessage(verifyBody);
```

{% hint style="success" %}
This is an [example of server-side](https://github.com/aurowallet/mina-signer-verify-example) verification of signature. You can refer to the implementation or run it locally.
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.aurowallet.com/general/howto/verifymessage-in-server-side.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
