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.

1 Answer 1


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). 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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.