# verifyMessageV2

Returns whether the provided signature data matches the provided message and was signed by the account of the provided public key. **For the complete verification process, please go to** [**Testbed**](https://neoline.io/signMessageV2)**.**

## **Input Arguments**

<table><thead><tr><th width="316">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>message: string</code></td><td>Salt prefix + original message</td></tr><tr><td><code>data: string</code></td><td>Signed message</td></tr><tr><td><code>publicKey: string</code></td><td>Public key of account that signed message</td></tr></tbody></table>

## **Success Response**

<table><thead><tr><th width="322">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>result: boolean</code></td><td>Whether the provided signature matches the provided message and public key</td></tr></tbody></table>

## **Error Response**

<table><thead><tr><th width="328">Parameter</th><th>Description</th></tr></thead><tbody><tr><td><code>type: string</code></td><td>The type of error which has occured</td></tr><tr><td><code>description: string</code></td><td>A description of the error which has occured</td></tr><tr><td><code>data: string</code></td><td>Any raw data associated with the error</td></tr></tbody></table>

## Example

### Request

```js
neolineN3.verifyMessageV2({
  message: '543e66d70a56506f0a69aff35f25f794Hello world',
  data: '4fef4abd1ced91577c89eac7909b89ec2aa3d073178c51c3074b7bc5551093b00bf274f35f8166931dc90cbd88346729e86e0bf1c3014fa3587cc167f0cafd4c',
  publicKey: '023e72b8b5a20c00dac7ac01ecd72354a2d7d64620d6615524bb18b9f5a6ca8ef4'
})
.then(result => {
  console.log('Signature data matches provided message and public key: ' + JSON.stringify(result));
})
.catch((error) => {
  const {type, description, data} = error;
  switch(type) {
    case 'NO_PROVIDER':
        console.log('No provider available.');
        break;
    case 'CONNECTION_DENIED':
        console.log('The user rejected the request to connect with your dApp');
        break;
    default:
        // Not an expected error object.  Just write the error to the console.
        console.error(error);
        break;
  }
});
```

### Response

```js
{
  result: true
}
```


---

# Agent Instructions: Querying This Documentation

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

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://tutorial.neoline.io/reference/neo3-provider-api-legacy/read-methods/verifymessagev2.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
