本頁面使用機器翻譯自英語,可能包含錯誤或不清楚的語言。如需最準確的信息,請參閱英文原文。由於更新頻繁,部分內容可能與英文原文有出入。請加入我們在 Crowdin 上的努力,幫助我們改進本頁面的翻譯。 (Crowdin translation page, Contributing guide)
[Account] kaia_sign
The method calculates an EIP-191 signature: sign(keccak256("\x19Ethereum Signed Message:\n" + len(message) + message)))
NOTE: In versions earlier than Kaia v1.0.1, the method calculates an KIP-97 signature: sign(keccak256("\x19Klaytn Signed Message:\n" + len(message) + message)))
The personal_ecRecover and kaia_recoverFromMessage methods can verify the signature.
JSONRPC: kaia_sign
Request
- application/json
Body
Array [
]
params
undefined[]
required
Account 20-byte DATA
Address
Message N-byte DATA
Message to sign
Responses
- 200
Return signature
- application/json
- Schema
- Example (from schema)
Schema
error
object
result DATA
Signature
{
"jsonrpc": "2.0",
"id": 0,
"error": {
"code": -32700,
"message": "Parse error",
"data": "string"
},
"result": "0xa3f20717a250c2b0b729b7e5becbff67fdaef7e0699da4de7ca5895b02a170a12d887fd3b17bfdce3481f10bea41f45ba9f709d39ce8325427b57afcfc994cee1b"
}
- curl
- python
- nodejs
- java
- Curl
curl -X 'POST' \
'https://public-en-kairos.node.kaia.io/kaia/sign' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"method": "kaia_sign",
"id": 1,
"jsonrpc": "2.0",
"params": [
"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
"0xdeadbeaf"
]
}'
- CURL
curl -L 'https://public-en-kairos.node.kaia.io/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
-d '{
"method": "kaia_sign",
"id": 1,
"jsonrpc": "2.0",
"params": [
"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
"0xdeadbeaf"
]
}'
ResponseClear