Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

api: Message signing RPCs are EIP-191 compliant #33

Merged
merged 2 commits into from
Jul 3, 2024

Conversation

blukat29
Copy link
Contributor

@blukat29 blukat29 commented Jul 2, 2024

Proposed changes

  • 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
  • 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.

  • I have read the [ ] I have read the CONTRIBUTING GUIDELINES doc
  • I have read the CLA and signed by comment I have read the CLA Document and I hereby sign the CLA in first time contribute
  • Lint and unit tests pass locally with my changes ($ make test)
  • I have added tests that prove my fix is effective or that my feature works
  • I have added necessary documentation (if appropriate)
  • Any dependent changes have been merged and published in downstream modules

Related issues

Further comments

@blukat29 blukat29 changed the base branch from queue/v1.0.1 to dev July 2, 2024 16:22
@blukat29 blukat29 marked this pull request as ready for review July 2, 2024 16:22
@blukat29 blukat29 mentioned this pull request Jul 2, 2024
22 tasks
@blukat29 blukat29 added the do not merge Do not merge just yet label Jul 3, 2024
@blukat29 blukat29 removed the do not merge Do not merge just yet label Jul 3, 2024
@blukat29 blukat29 merged commit 08e6e9f into kaiachain:dev Jul 3, 2024
9 checks passed
@github-actions github-actions bot locked and limited conversation to collaborators Jul 3, 2024
@blukat29 blukat29 deleted the sign-rpc-eip191 branch July 8, 2024 00:40
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants