There were two different message signing standards in Klaytn
EIP-191. Prepend "\x19Ethereum Signed Message:\n" + len(message) to the message before signing
KIP-97. Prepend "\x19Klaytn Signed Message:\n" + len(message) to the message before signing
In this PR,
Message signing RPCs (i.e. signature producers) are now EIP-191 compliant
Message verifying RPCs (i.e. signature consumers) accept both EIP and KIP if possible, only EIP otherwise.
RPC
Implementation
Before PR
After PR
personal_sign
PrivateAccountAPI.Sign
KIP-97
EIP-191
eth_sign
EthereumAPI.Sign
KIP-97
EIP-191
kaia_sign
PublicTransactionPoolAPI.Sign
KIP-97
EIP-191
personal_ecRecover
PrivateAccountAPI.EcRecover
KIP-97
EIP-191
kaia_recoverFromMessage
PublicTransactionPoolAPI.RecoverFromMessage
KIP-97 and EIP-191
KIP-97 and EIP-191 (unchanged)
Types of changes
Please put an x in the boxes related to your change.
[ ] Bugfix
[x] New feature or enhancement
[ ] Others
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
Proposed changes
"\x19Ethereum Signed Message:\n" + len(message)
to the message before signing"\x19Klaytn Signed Message:\n" + len(message)
to the message before signingTypes of changes
Please put an x in the boxes related to your change.
Checklist
Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.
I have read the CLA Document and I hereby sign the CLA
in first time contribute$ make test
)Related issues
Further comments