hashgraph / hedera-sdk-cpp

C++ SDK for Hedera
Apache License 2.0
8 stars 15 forks source link

Add recovery id calculation when signing ethereum call transactions #684

Open Petyo-Lukanov opened 1 month ago

Petyo-Lukanov commented 1 month ago

Problem

Currently there is no way to calculate recovery id (v) when we sign ethereum transactions from go SDK.

Solution

The recovery ID is an index from 0 to 3, which indicates which of the 4 possible public keys is the correct one. Because the key recovery operation yields multiple potential public keys, the correct key must either be stored alongside the signature or you must be willing to try each recovery ID in turn until you find one that outputs the key you are expecting.

Recovery operation is described in SEC1v2, section 4.1.6.

Alternatives

No response