Transaction signature algorithm

4

As I know, standard ECDSA digital signature algorithm returns two values (according to this article or Wikipedia), but transaction push services or APIs, like this one, require one string as a signature. Can anyone explain, what is that string, and how can I get it with those values? Is it possible with OpenSSL? Thank you very much!

Guest_User

Posted 2016-06-29T07:40:36.840

Reputation: 53

Answers

3

The ECDSA digital signature scheme returns two values. To be specific, the X and Y values computed on the elliptic curve are returned.

In Bitcoin the signture is DER encoded, which is represented as a string containing the X and Y values and also some header data. But both X and Y can easily be extracted from it when reading the string from left to right.

In fact the Bitcoin protocol uses more information than only those concerning the X and Y values. For example, the size of the DER encoded signature is specified, but also a so called signature type is used to define which part of the transaction the signature was computed for.

Take a look here under the section "Signing the transaction" to see exactly how it works. In the table you will see how a computed signature is used in a scriptSig.

The details regarding the DER encoding was discussed here.

Bjarne

Posted 2016-06-29T07:40:36.840

Reputation: 752