0.4 Cryptographic Signatures
Now that we understand how elliptic curve cryptography works, we can see how cryptographic signatures allow users to securely authenticate transactions on a decentralized ledger.
A cryptographic signature is a mathematical proof that a specific message was signed by the owner of a private key. Unlike a traditional signature, a cryptographic signature cannot be forged, and anyone can verify its authenticity.
Let’s revisit our transaction example:
A sends 3 coins to B
Instead of sending a password or relying on a central authority, A generates a digital signature using their private key. The signed transaction might look like this:
m = "A sends 3 coins to B"; Signature of m by A
Anyone can verify this signature using A’s public key. If the signature is valid, it proves that A authorized the transaction. If the signature is invalid, the transaction is rejected.
Schnorr Signature
One of the most widely used applications of ECC in cryptocurrency is Schnorr Signature, which allows users to sign transactions securely. Here’s how it works:
user generates a private key and computes the corresponding public key .
When signing a message (such as a transaction), the user creates a unique digital signature using his private key .
generates a random scalar . It should be new and never be used again.
computes .
gets , with the concatenation of bit representation of those elements.
can then compute .
The final signature is .
Anyone can verify the signature of message using the public key :
The verifier computes ,
This enables the verifier to check the message by comparing and . If they are equal, the signature is valid, else it's invalid. Because if chosed at step 2.d, then:
This enforces that only the owner of the private key could have authorized the transaction, making Schnorr signature the key component of decentralized authentication. Of course a lot of extra security consideration are to be taken care of, but this gives a good general idea of how signing works.
In next chapter, we'll explain how to compute a field element from the message in a secured manner, by explaining how hash functions work.
Last updated