Change Logs

@May 10, 2022

Who needs to check it?

All who uses Ethereum Signature Validator API when this update is released.

Release plan

Staging Environment: 23 of May

Production Environment: 30 of May

What is updated?

  • A new property signMethod?: 'eth_sign' | 'personal_sign' is added in request.

  • A new property triedSignMethods?: string[] is added in response.

User can now specify either eth_sign or personal_sign in request body for EOA recovery logic. If not specified, both methods are used for validation.

Before

**Request Body Type**

`{message: string, signature: string, address: string }`

**Response Type**

`{ isValid: boolean, invalidReason: string | null }`

After

**Request Body Type**

`{message: string, signature: string, address: string, signMethod?: 'eth_sign' | 'personal_sign' }`

**Response Type**

`{ isValid: boolean, invalidReason: string | null, triedSignMethods?: string[] }`

Example of request

"signMethod": "eth_sign" / Adding "signMethod": "eth_sign"


curl -X PUT -H "Content-type: application/json" --data '{"message": "test-message", "signature": "0x633bc7c201cf45fff0c1724b77c90c825a04c1b818f043915e2fedd55b4cfe681b425fe844ea3684a3860dc250527e318d3225b2d21ad0f75e419db4f0939a1b1c", "address": "0xBFC1331F8111102A51588b3b4A3E2F317B3a0363", "signMethod": "eth_sign"}' http://localhost:8080/

"signMethod": "personal_sign" / Adding "personal_sign": "eth_sign"

curl -X PUT -H "Content-type: application/json" --data '{"message": "test-message", "signature": "0x7cdf2aa9dfb2da8c6f8fe63269b4dbfb923451f0e36087479e7f2897718a6d0b6438bd44e367907e30c65a4b950c9e11f94049d38a0ca1dd4d419e107a3dade31c", "address": "0xBFC1331F8111102A51588b3b4A3E2F317B3a0363", "signMethod": "personal_sign"}' http://localhost:8080/

No signMethod: Validation result is the same as before.

curl -X PUT -H "Content-type: application/json" --data '{"message": "test-message", "signature": "0x633bc7c201cf45fff0c1724b77c90c825a04c1b818f043915e2fedd55b4cfe681b425fe844ea3684a3860dc250527e318d3225b2d21ad0f75e419db4f0939a1b1c", "addres
s": "0xBFC1331F8111102A51588b3b4A3E2F317B3a0363"}' http://localhost:8080/

Example of response

{ isValid: true, invalidReason: null, triedSignMethods: ['eth_sign'] }
{ isValid: true, invalidReason: null, triedSignMethods: ['personal_sign'] }
{ isValid: false, invalidReason: 'Signature is invalid', triedSignMethods: ['eth_sign', 'personal_sign'] }
{ isValid: false, invalidReason: 'Signature format is invalid' }

triedSignMethods property is not included the response if the validation process does not reach to signature validation part such as format issue as such.

Last updated

©2023 Startbahn, Inc.