checkSignature this method why need >= 4
This should only be used in very rare cases e.g. if you are not 100% sure if something is a bug or asking a question that leads to improving the documentation. For general questions please use discord or the Ethereum stack exchange at https://ethereum.stackexchange.com.
when secp256 checkSignature method, why signature[64]>=4, v is 27 or 28 right?
could anyone tell me, please
sig[64] implies the recovery ID, which only has possible values of 0, 1, 2 or 3. Hence, if the recovery ID is greater than or equal to 4, then it's not a valid recovery id.
This link could be helpful.
thanks @weiihann for answering
why i always get 27 or 28 by signMessage of metamask?how to handle this
i just used eth_sign, i always get 27
i have totally knew what happen, first one it is be eth_sign method by metamask that can't be recover by go-ethereum, because eth_sign is deprecated, so we need to use personal_sign method to solve it. second we need to sub 27 if v == 27 or 28, and we need to sub 35 and sub chainID * 2 if v is over 30 @weiihann that's right?