# Sign message

Messages can be signed by the user by utilising the following method.&#x20;

```
// address: string user address to sign message
// message: string user message for them to sign against
await negotiator.web3WalletProvider.signMessage(
    address, 
    message
)
```

**Tip** 💡

When working with web3 wallets such as AlphaWallet or MetaMask, developers can utilise signatures as a means to identify the true owner of a wallet address. This process is crucial for building secure web3 applications that require user authentication and authorisation on the blockchain.&#x20;

The method shown in this example demonstrates how to request a signature from the user via Token Negotiator. The response (e.g. "0x4c8be3f2039b....) from this method can be used to verify the token holder by uncovering the signers public address using a method such as this (most securely and commonly utilised server-side).

```
// return the signers public address 
getSignatureAddress(signature: string, message:string): string {
    const verifySigner = ethers.utils.recoverAddress(ethers.utils.hashMessage(message), signature)
    return verifySigner
}
```


---

# 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://tokenscript.gitbook.io/token-negotiator/learn/smart-contract-and-wallet-interaction/sign-message.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.
