Common error and solutions
Let's take api/v3/transfer for example:
1. ecdsaSignature:Must satisfy 0x[0-9A-Fa-f]{132}
The signature needs to append type value(02 or 03):
02 means the signature is sign the message directly: ecdsaSign(message)
03 means the signature is personal_sign in ethereum, ecdsaSign(sha256($ethereum_header + message))
2. INVALID ECDSA SIGNATURE
2.1 check X-API-SIG
Check whether put ecdsaSignature to header is X-API-SIG
2.2 check ecdsaHash
Check whether the ecdsaHash is calculated correctly. Here is an example:
Above data ecdsaHash is '0x805e1c7add987c0578fb3f67f11b05a00166706605a52ce9842a49b51f1d4302', you can use the example data to generate one ecdsaHash to compare.
2.3 check ecdsaPrivateKey
if 2.1 and 2.2 both are OK, check whether payerAddr is generated from ecdsaPrivateKey. You can import the ecdsaPrivateKey to MetaMask to check whether the address is the same as payerAddr.
3 ERR_REST_EDDSA_INVALID_SIGNATURE
3.1 check eddsaSignature
Check the EdDSA signature name is the same as eddsaSignature
3.2 check eddsaHash
Check whether the eddsaHash is calculated correctly. Here is an example:
Above data ecdsaHash is '0x1fc4e6eedf283443892ded5e0379097dcbbbcbaefbc16a5fbbad4eaa43a4404a', you can use the example data to generate one eddsaHash to compare.
3.3 check eddsaPrivateKey format
if eddsaPrivateKey is a hex string and use java sdk to generat eddsaSignature, the eddsaKey should format be:
Last updated