What's the magic numbers meaning of 27 or 28 in VRS ( use to ecrover the sender) ? why not 0 or 1? Ecrecover need 0 or 1, but transaction RLP is 27 or 28. Before ecrecover, sub 27 to get 0 or 1. Why not encode the transaction use 0 or 1 directly? What's the magic number 27 and 28 mean?
This issue is reported at package 'ethereumjs-util' / function 'fromRpcSig'.
As you can see, the documentation of this function states:
- NOTE: all because of a bug in geth: https://github.com/ethereum/go-ethereum/issues/2053
And as you can see, the values 0 and 1 are supported, while the function adds 27 to the last byte in the 65-byte buffer (the last two characters in the 130-character string) in order to support the values 27 and 28 as well.
A similar question has been answered here.