<p>They are very different. If you look at their byte values, you will notice that they are different lengths and have different formats.</p>

<p>In essence, public keys are identifiers and signatures are cryptographic proofs.</p>

<p>A signature is produced by taking a private key and a message and performing a signature algorithm with those two pieces of data as inputs. For Bitcoin, we use the <a href="https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm" rel="nofollow noreferrer">Elliptic Curve Digital Signature Algorithm (ECDSA)</a>. In Bitcoin, the message is a modified version of the spending transaction.</p>

<p>A public key is derived from a private key and can be broadcast publicly. It is used in the verification algorithm for ECDSA to verify that the private key for that public key was the one that produced a signature for a given message.</p>

<p>So the signature is a proof that the private key for the specified public key endorses are particular message. In Bitcoin, it means that the owner of the private key approves that spending transaction.</p>

<p>Additionally, signatures are generally one time things. They change with the message. You can also get two different signatures for the same message and private key combination. Those two signatures will still be valid and are valid independently. Conversely, public keys (and private keys) are permanent. They don't change unless you replace them.</p>

CC BY-SA 4.0
2019-07-31T01:37:52.723Z
2019-07-31T01:37:52.723Z
Ava Chow
<p>So, I can see this is in the unlocking script:</p>

<pre><code>&lt;Cafe Signature&gt; &lt;Cafe Public Key&gt;
</code></pre>

<p>Taken from mastering bitcoin. What is the difference between the two? I don`t find it easy to google. </p>

<public-key><signature>
What is the relationship between the Digital Signature and the Public Key
Alejandro Veintimilla
# What is the relationship between the Digital Signature and the Public Key

(Asked by: username_0 on 2019-07-30)

So, I can see this is in the unlocking script:

```
<Cafe Signature> <Cafe Public Key>

```

Taken from mastering bitcoin. What is the difference between the two? I don`t find it easy to google.

**Tags:** public-key, signature


---

## 1 answers

### Answer by username_1 on 2019-07-31. Score: 2 | Accepted answer

They are very different. If you look at their byte values, you will notice that they are different lengths and have different formats.

In essence, public keys are identifiers and signatures are cryptographic proofs.

A signature is produced by taking a private key and a message and performing a signature algorithm with those two pieces of data as inputs. For Bitcoin, we use the [Elliptic Curve Digital Signature Algorithm (ECDSA)](https://en.wikipedia.org/wiki/Elliptic_Curve_Digital_Signature_Algorithm). In Bitcoin, the message is a modified version of the spending transaction.

A public key is derived from a private key and can be broadcast publicly. It is used in the verification algorithm for ECDSA to verify that the private key for that public key was the one that produced a signature for a given message.

So the signature is a proof that the private key for the specified public key endorses are particular message. In Bitcoin, it means that the owner of the private key approves that spending transaction.

Additionally, signatures are generally one time things. They change with the message. You can also get two different signatures for the same message and private key combination. Those two signatures will still be valid and are valid independently. Conversely, public keys (and private keys) are permanent. They don't change unless you replace them.


---

