bitcoin-dev

Schnorr signatures BIP

Schnorr signatures BIP

Original Postby Артём Литвинович

Posted on: July 7, 2018 02:47 UTC

After spending an hour implementing and playing with the code, some minor notes were made by an outsider.

The reference code and the implementation both have discrepancies in several places. The "Let k = int(hash(bytes(d) || m)) mod n" line is found in several places but the reference code does not have a modulo. There was also confusion around the 'bytes(x(R)) || bytes(k + ex mod n)' signature as x is not defined, apparently being the private key. The jacobi function is said to be great at exposing bugs due to the full 256 bit exponent which might be worth mentioning. The "bytes" notation is not consistent for integers and points and could be confusing, so it might be helpful to name them differently. Lastly, it was suggested that having a larger set of test vectors in a JSON or CSV file covering all edge cases would be beneficial.