このページは英語からの機械翻訳を使用しており、誤りや不明瞭な表現が含まれている可能性があります。最も正確な情報については、オリジナルの英語版をご覧ください。頻繁な更新のため、一部のコンテンツはオリジナルの英語になっている可能性があります。Crowdinでの取り組みに参加して、このページの翻訳改善にご協力ください。 (Crowdin translation page, Contributing guide)
personal_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: personal_sign
Request
- application/json
Body
Array [
]
params
undefined[]
required
Message Message (string)
A message to sign.
Account Account (string)
The account address.
Password Password (string)
The pass phrase used for signing.
Responses
- 200
Return the a signature.
- application/json
- Schema
- Example (from schema)
Schema
error
object
result string
A 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' \
-H 'accept: application/json' \
-H 'Content-Type: application/json' \
-d '{
"method": "personal_sign",
"id": 1,
"jsonrpc": "2.0",
"params": [
"0xdeadbeaf",
"0x413ba0e5f6f00664598b5c80042b1308f4ff1408",
"helloWorld"
]
}'
- CURL
curl -L 'https://public-en-kairos.node.kaia.io/' \
-H 'Content-Type: application/json' \
-H 'Accept: application/json' \
--data-raw '{
"method": "personal_sign",
"id": 1,
"jsonrpc": "2.0",
"params": [
"0xdead",
"0x9b2055d370f73ec7d8a03e965129118dc8f5bf83",
"gr8=B!0@uc$b"
]
}'
ResponseClear