> For the complete documentation index, see [llms.txt](https://relationlabs.gitbook.io/relation-one-api/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://relationlabs.gitbook.io/relation-one-api/api/signature.md).

# Signature

* Description: The server for Signature Authentication would authenticate the incoming signature. If it is valid, then an **addressAuthToken** valid for 7 days will be returned.
* This method is packed in the JS-SDK. It is remmended to acquire the addressAuthToken through the [JS-SDK](/relation-one-api/js-sdk/relation-auth/quick-start.md).
* Request Parameters

| Field              | Type    | Remarks                                                                                                                                      |
| ------------------ | ------- | -------------------------------------------------------------------------------------------------------------------------------------------- |
| pk                 | text    | Public Key (without the "0x" prefix)                                                                                                         |
| algorithm          | variant | Signature Algorithm: secp256k1;                                                                                                              |
| message            | text    | Plaintext message to be signed.**Note**：It should end with **Timestamp:${value}**, in which "value" is the current timestamp in milliseconds |
| wallet\_name       | text    | use the wallet with this name to sign the message                                                                                            |
| decoded\_signature | text    | The hexString of the signature (without the "0x" prefix)                                                                                     |
| chain\_name        | text    | the name of the blockchain                                                                                                                   |

* Request Example

```shell
curl -X POST 'https://hq6y7-wyaaa-aaaak-qas6q-cai.raw.ic0.app/auth' \
--header 'Content-Type: application/json' \
--data-raw '{"pk":"04143eed07769827d515ecf988579d228e287e692abfb7709af8c08bf300273b99de46ec375e3e68b5474d7612c72632751908a4fd75c86de90c486d54c352e8bdd","algorithm":{"secp256k1":null},"message":"Welcome to relation. Pleaes Click to sign in.Timestamp:1660839628000","wallet_name":"metamask","decoded_signature":"22aabbfab4c44e296fe3f64bcec0f6496298083266c2167d2afc9442cea785b919c9a6ffc0ae494671c50e9a3b6fa9b6ec42cb6d0b0e3f759928aefcd6d4433d1c","chain_name":"eth"}'
```

* Response Example

```json
{
    "code": "success",
    "token": "eyJ0eXAiOiJKV1QiLCJhbGciOiJFUzI1NiJ9.eyJleHAiOjE2NzExNDE4MDcsImlhdCI6MTY2MTA2MTgwNywic3ViIjoie1wiYWNjb3VudFNvdXJjZVwiOlwiZXRoXCIsXCJhZGRyZXNzXCI6XCIweDJlOGU5MWQzZTMxNTA1ZWZhNTRiMzg4YzVlOWU0OGJhNzIxNzNhY2VcIixcInVzZXJQcmluY2lwYWxcIjpcIlwifSJ9.-6Rwv_xolDvnqZgmdih7RfkTcZ4myILvyBlMyTJQddDOJGplvqZm1N95q4K_MtwLdOKoZMYoZzfKlInt4Zqb0g"
}
```


---

# 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://relationlabs.gitbook.io/relation-one-api/api/signature.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.
