leapdao / leap-core

library for tx and block signing
GNU Affero General Public License v3.0
15 stars 5 forks source link

Unclear type of v in signature #157

Open TheReturnOfJan opened 4 years ago

TheReturnOfJan commented 4 years ago

The v in signatures assigned to inputs has 2 conflicting types.

1.) 8-bit unsigned https://github.com/leapdao/leap-core/blob/c2c30fb2fe89da6a1d02744c6afd828a1acbc7c5/lib/input.js#L92

2.) 8-bit signed https://github.com/leapdao/leap-core/blob/c2c30fb2fe89da6a1d02744c6afd828a1acbc7c5/lib/input.js#L201

So the only possible values one can assign of v without throwing an exception are (0, 127), which is neither a byte (0, 255) or an unsigned byte (-128, 127).

But this is not critical at all since valid v's will always be in the range (0, 127) - read