We use digital signature a lot nowaday. In order to understand the blockchain technology - it's more likely the design pattern, we have to understand the digital signature. How does it work? Which problems does it solve?
It helps to reduce the physical procedures. We can make a deal instantly, no need to have a car or plan to bring the physical document to both sides and collecting signatures.
This is the scenario which demonstrating how it works.
A creates a key pair including public key(P) and private key(S). P will be sent to B. Both A and B have the same original document.
- Make a hash of original document (one-way, can't get original document from this hash) (step#1)
- Encrypt above hash to be which I call signature.
- Receive the signature from A party.
- Using A's public key P to decrypt above signature => get a hash.
- Make a hash like step#1 of A from original document.
- Compare between B's hash and A's hash.
Above scenario help us to identify two things:
- Is A party the owner of encrypted message (A's signature)?
- Did A sign correct document?
That's enough for identification.