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

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

<p>In fact the Bitcoin protocol uses more information than only those concerning the <strong>X</strong> and <strong>Y</strong> 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.</p>

<p>Take a look <a href="http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html" rel="nofollow">here</a> 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.</p>

<p>The details regarding the DER encoding was discussed <a href="https://bitcoin.stackexchange.com/questions/12554/why-the-signature-is-always-65-13232-bytes-long">here</a>.</p>

CC BY-SA 3.0
2016-06-29T08:38:15.720Z
2016-06-29T08:38:15.720Z
Bjarne Magnussen
<p>As I know, standard ECDSA digital signature algorithm returns two values (according to <a href="http://davidederosa.com/basic-blockchain-programming/elliptic-curve-digital-signatures/" rel="noreferrer">this article</a> or Wikipedia), but transaction push services or APIs, like <a href="http://dev.blockcypher.com/#creating-transactions" rel="noreferrer">this one</a>, 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!</p>

<api><signature><algorithms><c++><openssl>
Transaction signature algorithm
Guest_User
# Transaction signature algorithm

(Asked by: username_0 on 2016-06-29)

As I know, standard ECDSA digital signature algorithm returns two values (according to [this article](http://davidederosa.com/basic-blockchain-programming/elliptic-curve-digital-signatures/) or Wikipedia), but transaction push services or APIs, like [this one](http://dev.blockcypher.com/#creating-transactions), 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!

**Tags:** api, signature, algorithms, c++, openssl


---

## 1 answers

### Answer by username_1 on 2016-06-29. Score: 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](http://www.righto.com/2014/02/bitcoins-hard-way-using-raw-bitcoin.html) 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](https://bitcoin.stackexchange.com/questions/12554/why-the-signature-is-always-65-13232-bytes-long).


---

