> 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/sign-message.md).

# Sign Message

## Sign Message

This method is used for sign message.

```typescript
interface SignedData {
    publicKey: string;
    data: string;
    signature: {
        field: string;
        scalar: string;
    };
}

interface ProviderError extends Error {
    message: string;
    code: number;
    data?: unknown;
}
type SignMessageArgs = {
    message:string
}

const content = `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: ${window.location.href}

address: ${currentAccount}
iat: ${new Date().getTime()}`;

const signContent:SignMessageArgs = {
    message:content
}

const signResult: SignedData|ProviderError = await window.mina?
     .signMessage(signContent)
     .catch((err: any) => err);

console.log(signResult)
```

## Sign Json Message

This method is used for sign JSON data , Auro Wallet will format message.

```typescript
type JsonMessageData  = {
    label:string
    value:string
}

type SignJsonMessageArgs = {
    readonly message: Array<JsonMessageData>
}

const msgParams = [
    { label: "Label:", value: "Sign Confirm" },
    {
      label: "Message:",
      value: "Click to sign in and accept the Terms of Service",
    },
    {
      label: "URI:",
      value: window.location.href,
    },
    {
      label: "networkID:",
      value: network.networkID,
    },
    {
      label: "Chain Name:",
      value: network.name,
    },
    {
      label: "Issued At:",
      value: new Date().getTime(),
    },
    {
      label: "Resources:",
      value: "https://docs.aurowallet.com/",
    },
    ];
  
const signResult:SignedData|ProviderError = await window.mina
    ?.signJsonMessage({
        message: msgParams
    })
    .catch((err: any) => err);

console.log(signResult);
```

## Verify Message

This methods is used for verify signed Message.

```typescript
let verifyResult:boolean|ProviderError = await window.mina
    ?.verifyMessage(verifyMessageBody)
    .catch((err: any) => err);
  
console.log(verifyResult); // If the result is successful, it will return true.
```


---

# 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 dynamically by asking a question.

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

```
GET https://docs.aurowallet.com/general/howto/sign-message.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
