How Bitcoin authenticates users with digital signatures?

When you visit a bank for a financial transaction, you have to go through a process to prove yourself. Proof of identity can be through a driver’s license, social security card, or signature. In any case, this proof will allow only the parties to withdraw and transfer cash from their account. If someone else disguises himself as someone other than himself, that person should be arrested.

As we have already shared above, Bitcoin utilizes a public ledger, in which everyone records their transactions. So how can you prevent participants from secretly adding deals that benefit them? For example, if Cheol-su records in this public ledger that Young-hee transferred money to him, how can he prevent this false ledger?

To prevent this, the transaction must be announced to the network with a digital signature .

A digital signature guarantees two things:

  1. The message was sent by the selected sender.
  2. The message was not harmed in the center.

This digital sign is generated using a hashing algorithm and asymmetric encryption .

Hashing is the use of an algorithm that irreversibly transforms an input into a unique output of a fixed length. The hashing algorithm used by Bitcoin is SHA256, which means that the output, known as a hash or digest, is a number in 256 binary. (Ex. Consists of 0 and 1)

You can think of hashing as a mathematical technique that quickly transforms input values ​​into output values. However, it can be seen that it is virtually impossible to look at the output and determine which input was used to obtain the corresponding result.

Let’s try to use hashing in a more understandable analogy. Think of the input information as flour, sugar, and eggs, and the output information as a cake. The algorithm used acts as an oven, turning the raw material into a finished product. From the result alone, it is impossible to know which raw materials were used and how much each material was used.

To create a digital signature, the network published the message first be hashed it After that the hash must be encrypted .

As mentioned above, the cryptography used by Bitcoin is asymmetric cryptography. Asymmetric encryption is an encryption method using a public key and a private key.

This cryptography is possible when each person has a corresponding public and private key. Both public and private keys can be used to encrypt a message, but decryption requires a key opposite to the one used. This means that if you encrypt with the public key , you need the private key to decrypt. The opposite is also true.

Only one person can have a private key, and no one else can have it. Conversely, a public key can be shared by anyone. For example, suppose Young-hee wants to send a private message to Cheol-su. Young-hee encrypts this message using Cheol-su’s public key given by Cheol-soo. Since only the withdrawal has the private key, only the withdrawal can decrypt this message. If Cheol-su wants to send Young-hee a private message, Cheol-su encrypts the message using Young-hee’s public key, and only Young-hee can decrypt the message using her private key.

Bitcoin’s goal is not to send private messages. It should be remembered that the ledger was made public. Nevertheless, asymmetric encryption is still that the message is exactly the person by the transfer that ensures at the same time, the message is in the middle of damage or tampering that no guarantees

Suppose Younghee wants to send 1 bitcoin to Cheolsu. To do this, Younghee needs to announce two facts to the network.

  1. Messages with transaction history. This transaction is not encrypted and contains links to previous transactions. It also contains an input value and an output value for determining whether there is sufficient funds for the transaction, which should be used to determine whether the transaction is valid.
  2. Digital signature (e.g. a hash message encrypted by Younghee with her private key)

Afterwards, the withdrawal authenticates this transaction in the following way:

  1. A hash algorithm is applied to the message. With this, the withdrawal has hash A.
  2. The digital signature generated by Young-hee is decrypted with Young-hee’s public key. With this, the withdrawal has hash B.

Since both hashes are derived from the same message, they must be the same. If these two hashes are the same, the message has been proven not to have been tampered with. Since Cheol-su was able to decrypt the hash message using Young-hee’s public key, Young-hee is the only person with access to his private key, proving that the message came from Young-hee.

Leave a Reply

Your email address will not be published. Required fields are marked *