签名认证

  • 描述: 签名认证服务对传入的签名进行验签,验签通过后返回 addressAuthToken,有效期为7天。

  • 该方法已经封装到JS-SDK中,建议通过JS-SDK获取 addressAuthToken

  • Request Parameters

Field
Type
Remarks

pk

text

公钥,去掉开头的0x

algorithm

variant

签名使用的算法: secp256k1;

message

text

签名原文,备注:签名原文结尾必须带上Timestamp:${value}, value为当前时间戳,单位是毫秒

wallet_name

text

当前签名的钱包名称

decoded_signature

text

签名的hexString,去掉0x开头

chain_name

text

链的名称

  • Request Example

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

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

Last updated