how to get r, s, v out of signature? #544

issue BernardoDeLaPlaz openend this issue on July 31, 2018
  1. BernardoDeLaPlaz commented at 10:07 pm on July 31, 2018: none

    I see in secp256k1/include/secp256k1.h

    • The signature must consist of a 32-byte big endian R value, followed by a
    • 32-byte big endian S value. If R or S fall outside of [0..order-1], the
    • encoding is invalid. R and S with value 0 are allowed in the encoding.

    I take it this means that if I generate a signature in a secp256k1_pubkey I can look in the first 32 bytes to find R and the next 32 bytes to find S.

    …but how can I find ‘v’ ?

    Thanks.

  2. BernardoDeLaPlaz commented at 10:11 pm on July 31, 2018: none
    Ah…I need to use secp256k1_ecdsa_sign_recoverable() instead of secp256k1_ecdsa_sign() ?
  3. sipa commented at 10:13 pm on July 31, 2018: contributor
    You can’t convert a normal signature to a recoverable signature. You can try recid=0, recid=1, recid=2, recid=3 though, and see which one recovers your expected public key.
  4. sipa closed this on Jul 31, 2018


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin-core/secp256k1. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2024-11-21 16:15 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me