> For the complete documentation index, see [llms.txt](https://support.marscat.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://support.marscat.io/development-guide/frontend-development/api-interface/api-interface-details/level-0/generatesignature.md).

# generateSignature

Used to generate an ECDSA digital signature for the specified text message. The signing process is based on the `secp256k1` elliptic curve and uses the MarsApp account address (BTC address) obtained from the `getAccount` method.

## Request Parameters

| Parameter Name | Type   | Required | Description                    |
| -------------- | ------ | -------- | ------------------------------ |
| message        | String | Yes      | Original message to be signed. |

## Response Parameters

| Parameter Name | Type   | Description                        |
| -------------- | ------ | ---------------------------------- |
| result         | String | Signature result (Base64 encoded). |

## Call Example

{% code title="example.js" %}

```javascript
let payload = {
  message: "Hello RelayApp"
};

const response = await relayx.generateSignature(payload);
if (response.code === 200) {
  console.log("Signature:", response.result);
}
```

{% endcode %}
