4

If I understand correctly when we send a transaction, we send an unsigned part m and a signature consisting of v, r, s. Each node verifies the signature by checking:

hash(m,r) * publicKey + r = s * generator

the generator is known, where as the public key cannot be restored from the address and has to be computed. This is where the v part of the signature comes in. Can someone explain how is v defined and how does it help us retrieve the public key? Thanks a lot.

2

Your r here is calculated as the X co-ord of some point R % the curve order n.

Due to the nature of the curve, there are however 4 valid points that could all have this X co-ord, and so the v is used to define which one of those it is. It saves us having to calculate (up to) all 4 possibilities in order to recover the correct signing key.

Further, w/r/t ethereum, that extra byte of data is used to encode a small measure of replay protection, as defined in EIP155, about which you can read more here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.