About Digital Signatures in Bitcoin and How They Work
One of the main keys behind the Bitcoin protocol are digital signatures and their verification. The bitcoin platform requires people that transact using the cryptocurrency to prove the ownership of the private key for the coins they are sending. Digital signatures allow you to prove that you own the key without disclosing it.
What exactly are digital signatures?
A digital signature is the hash of a transaction that has been encrypted with a secret key. This secret key is also known as a private key. The verification of a transaction’s signature requires an associated public key. The digital signature has the role of proving that the transaction has not been altered, and the transaction has been issued by the legitimate owner of the private key.
How do they work?
As we mentioned above, the private key generates a public key, which by using algorithms based on elliptic curves and modular arithmetic generates the address.
So the sender generates a private key and a public key. Then the message is signed with the signature, the message and signature are sent along with the public key to the network. The node or receiver then check their validity by using the verification algorithm that has been used by the sender to sign the message, which can only be done by the owner of the private key that created the sent public key.
How does a private key look like?
The private key is a 256-bit number that is randomly generated from anywhere in between 0 and 1077. Because of this private keys contain many digits when converted into decimal numbers, resulting in the creation of an alternative called Wallet Import Format. This format starts with the number “5” which is followed by a sequence made up from letter and numbers.
What are public keys?
A bitcoin public key is obtained by using a set of mathematical operations known as Elliptic Curve Cryptography on a private key. While a private key is an integer (a number between 0 and 1077), the public key is a coordinate made out of two integers. For easier processing, the public key is transformed into a single value.
The generating process between private and public keys relies on a mathematical trapdoor, a function that is easy to perform in one direction, but almost impossible to perform in the opposite direction.
Digital signatures and transactions
Bitcoin requires all transactions to have a digital signature to prevent any forgery. This signature, like a private key, is also a number that has been selected from a very large range. A wallet’s software generates a signature by using algorithms to process a transaction together with the correct private key.
This means that anyone that has a transaction and its signature can check the authenticity of a message. A transaction signature is almost impossible to fake. The only way you can validate a signature for a specific transaction is by using the appropriate private key.
Unlike signatures that you would write for a check, a transaction signature changes if even the slightest change occurs in the transaction. There is no way in predicting how the signature will change, making it next to impossible to forge.
Don’t lose your key
Digital signatures make Bitcoin transactions non- repudiable. This means that once you sign something, you can say that you didn’t since you are the only owner of the key. But if your key gets stolen or lost, you will lose possession of all your bitcoins.
Bitcoin can be regarded as an open network through which transactions are made by using digital signatures to mediate and validate said transactions. These signatures also protect buyers, sellers and the Bitcoin community as a whole against forgery.