# Aptos

## Aptos Signature Guide

* We are using `tweetnacl` for this particular example

```tsx
import nacl from "tweetnacl"

const secretKey = ""
const publicKey = "" // without prefix 0x

const generatedMessage = await generateMessage()

const message = `APTOS\nmessage: {generatedMessage.message}\nnonce: {generatedMessage.nonce}`

const signature = nacl.sign.detached(Buffer.from(message), Buffer.from(message, 'hex'))
```

{% hint style="info" %}
APTOS has a standard for signing message, there will be `APTOS` before message and `nonce` after message, `nonce` is provided by the generateMessage, use that as a nonce
{% endhint %}


---

# 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://docs.fetcch.xyz/how-to-integrate/guides/utility/how-to-sign-messages/aptos.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.
