# 添加 Ed25519 非对称签名的商户公钥及使用 Ed25519 非对称签名传入 CoinsDo API

1. 主账户后台“API接入”页面，点击“添加商户公钥”。\
   在“添加商户公钥”界面，输入商户公钥（请输入 PEM格式的 Ed25519 公钥）、公钥别名和<mark style="background-color:green;">**主账户谷歌码**</mark>，随后点击「提交」即可完成添加。

   <figure><img src="https://254105150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1sJpsLJyJ12eTG1bUgP%2Fuploads%2FSAECzLlhv6XfxALqs5Ai%2FPresentation1.png?alt=media&#x26;token=6df1fdcd-a5db-4d0f-99eb-e33d76e4aece" alt=""><figcaption></figcaption></figure>

2. 主账户后台“API接入”页面，可以切换已添加过的商户公钥状态。\
   切换状态时必须提供<mark style="background-color:green;">**主账户谷歌码。**</mark>

   <figure><img src="https://254105150-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fx1sJpsLJyJ12eTG1bUgP%2Fuploads%2FUfGPw2anChn9NJ4zExtR%2FScreenshot%202026-04-27%20at%2011.11.08%E2%80%AFAM.png?alt=media&#x26;token=055279e3-6fe6-4f30-8906-839690a5c1c7" alt=""><figcaption></figcaption></figure>

3. 在接入 CoinsDo API 时，除原有的 data 和 sign（HmacSHA256 对称签名） 参数外，请同时传入 ed25519Sign（Ed25519 非对称签名）以及 kid（商户公钥别名）。\
   \
   **同时传入 sign 和 ed25519Sign 的请求示例**

   ```json
   {
       "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"submitAccount\":\"coinsdoTest\",\"address\":\"TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR\",\"amount\":\"616.616\",\"coinsDoId\":\"3\",\"businessId\":\"TRX_999\",\"approveExpireTime\":\"1622775712\",\"businessScene\":\"1\",\"timestamp\":\"1622775712229\",\"txMemo\":\"COINSDOTESTTRX\",\"reviewUuid\":\"A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B\",\"reviewSign\":\"3pIsqtrXPG/I4o/YGLOvtIvBUUrBrRyFehlt0wkezWU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=\",\"reviewRemark\":\"trxreview\",\"targetDeviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\",\"approveUuid\":\"BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30\",\"approveSign\":\"vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=\",\"approveRemark\":\"trxapprove\",\"keepApproveSign\":True}",
       "sign": "d32bfb9905f0b6713be45fea2bce001449146a43b3319479076a6d8c2bf22055",
       "ed25519Sign": "7cIUp9y1iAblu9ihkAWLT+L9WA8lsGMTwzfwK951WqLY0Xeo9rRyRFHG75XCxofUHbAx9Kbk2vwqJSAYqZo3CA==",
       "kid": "test0000001"
   }
   ```

   \
   **传入 ed25519Sign 时不传入 sign 的请求示例**

   ```json
   {
       "data": "{\"apiKey\":\"cd384rt80f5575dc\",\"submitAccount\":\"coinsdoTest\",\"address\":\"TKU69qcQPoR5jDEE7ertPpdaxoLGCTX4xR\",\"amount\":\"616.616\",\"coinsDoId\":\"3\",\"businessId\":\"TRX_999\",\"approveExpireTime\":\"1622775712\",\"businessScene\":\"1\",\"timestamp\":\"1622775712229\",\"txMemo\":\"COINSDOTESTTRX\",\"reviewUuid\":\"A65F7B1C-8FF8-4E0D-ADF2-AE0BCB0F378B\",\"reviewSign\":\"3pIsqtrXPG/I4o/YGLOvtIvBUUrBrRyFehlt0wkezWU4u0dj5xXEoZ9E4EXSes9WawqfpxrRfOIHgXV1BnPNM2tt0DLloCnJkzR7smC26+z6kuZb87s3hitZWgM3UaWWghB8/qNMQImvCZ6MREqChoNmEVyaqCnTbjorKsrU/V0=\",\"reviewRemark\":\"trxreview\",\"targetDeviceUuid\":\"2DEA1BEB-CFE9-4E1D-9D88-F983D84D2E4D\",\"approveUuid\":\"BD9D4D2C-6689-4FE1-88BB-C9DA5A251A30\",\"approveSign\":\"vPuFWmtV/KbemdN/5IqRhyfY63kp55HSZEErFa0rtJco861WkUsesaJ1U5kV0oX3bn5U8iVEKGeAzA37s/jMBy8hq62r1fstvhZ6vcgX5FuqtvvL8fTOeRuK9v85e7FR/89U2Jm/KbVt0US2Xe1oQz2D7lDvFW15ZtSQdp8JoVA=\",\"approveRemark\":\"trxapprove\",\"keepApproveSign\":True}",
       "ed25519Sign": "7cIUp9y1iAblu9ihkAWLT+L9WA8lsGMTwzfwK951WqLY0Xeo9rRyRFHG75XCxofUHbAx9Kbk2vwqJSAYqZo3CA==",
       "kid": "test0000001"
   }
   ```


---

# 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://coinsdo.gitbook.io/docs/cn/coinsdo-api-integration/coinsdo-api-jie-ru-wen-dang/tong-ze/tian-jia-ed25519-fei-dui-chen-qian-ming-de-shang-hu-gong-yao-ji-shi-yong-ed25519-fei-dui-chen-qian-m.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.
