The book "Grokking Bitcoin technology"

imageHello, habrozhiteli! Want to understand Bitcoin technology at a deep conceptual level?

“We're rocking Bitcoin technology” on visual diagrams and striking examples teaches us to think in a new way. You will learn how mining actually occurs, bitcoins arise, how to enter the Bitcoin network and how a digital wallet functions.

Basics of Bitcoin technology; hash functions and digital signatures; cryptography and encryption algorithms; transaction anatomy; verification and bandwidth; hard and soft forks

You are not required to have advanced programming skills, but a basic understanding of the basics - databases, computer networks, web servers and (oh, horror!) mathematics - will not be out of place.

Excerpt. Addresses


In the spreadsheet of bun tokens, there will no longer be personal names - we will replace them with public key hashes. This is useful in terms of privacy. No one can easily understand who pays to whom, and it will be more difficult for others to extract information from the spreadsheet and see how many tokens one of your colleagues has spent. Lisa also finds this useful because she does not have to maintain a table of names and public keys.

When switching to using public key hashes in a spreadsheet, company employees will no longer indicate their names in letters to Lisa. Instead of names, they will use hexadecimal strings representing public key hashes. But this means that there is an increased risk of typos. If you make a typo, your tokens may burn!

One of the employees invented the addresses of the tokens (Bitcoin addresses), which protect against the loss of money due to input errors (Fig. 3.1). Token addresses are used by users to translate to each other, almost like email addresses, but they are not in the spreadsheet.

image


Biscuit eating habits revealed


You and many of your colleagues have health insurance from Acme Insurances. Acme convinced John to give them a copy of the spreadsheet. Acme employees noticed that they could adjust the insurance premium or the habits of employees to consume buns (Fig. 3.2) in the event of a possible insurance dispute.

Another unpleasant fact associated with the spreadsheet is that any employee can easily see the balance of other employees, as well as find out their habits in eating buns.

Employees asked Lisa to find a solution to these problems, otherwise they will stop using the spreadsheet.

ACME INSURANCES
This very unethical insurance company makes serious attempts to spy on your habits in order to “adjust” the insurance premium.

image

Fig. 3.2. Acme Insurances keeps track of Chloe's habit of eating a lot of buns

Replacing Names with Public Keys


Lisa has been constantly updating the table of names and public keys since employees began to use digital signatures. She was tired of doing this, so she came up with an idea that would benefit both her and everyone else: replace all the names in the spreadsheet with the corresponding public keys (Fig. 3.3).
image

image

Fig. 3.3. Replacing names with public keys. Now it’s much harder to understand the entries in the spreadsheet, which will have a good effect on privacy.
Now it’s hard to understand how many buns Chloe ate without knowing her public key. If Acme Insurances employees receive a copy of this new spreadsheet, they will not be able to determine who the senders and recipients are. They will only see the public keys of the sender and recipient of each payment.

Now Lisa can delete her bulky table with names and public keys. But after that, users should no longer use names when making payments. Instead, they will have to use the sender’s public key and the recipient’s public key (Fig. 3.4).
image

A letter to Lisa contains several important elements: A

imagemessage that includes:

  • amount;
  • sender's public key;
  • recipient’s public key.

imageA signature created by the sender's private key.

The main difference is that now payments are made using aliases: names replaced the corresponding public keys. Otherwise, the payment looks the same as before.

New payment procedure


Suppose a new employee came to work in the company. Her name is Faiza. The company wants to send her 100 CT as a welcome gift. How to do it?

For this, firstly, the recipient's public key, Faiza, is required. Faiza had not used a token system before, so she needed to create a key pair and transfer the public key to the sender - the company - as shown in Fig. 3.5.

image

Faiza creates the private and public keys following the procedure that was described in chapter 2 in the section “Improving the security of tokens on buns,” but does not yet transfer her public key to Lisa. Now that Lisa has no table of names and public keys, it makes no sense to pass her the public key. She doesn’t need it. Instead, Faiza passes the public key to a company that wants to transfer tokens to her buns.

The company creates a message in which it asks Lisa to transfer 100 CT from 037e944a ... 36de9496 to 029a726c ... ad8f436d. He then digitally signs the message and sends it to Lisa. Lisa uses

  • message,
  • sender public key
  • and signature

to verify that the message is signed by the sender’s private key, identified by the public key. It also checks the sender balance in the spreadsheet. This is done in exactly the same way as at the time when names were stored in the spreadsheet - she searches for records that correspond to the sender’s public key and calculates the balance.
LISA AT BITCOIN Lisa solves the same tasks regarding tokens as the Bitcoin miner regarding payments in bitcoins.

image

Lisa had not seen the recipient’s public key before, but she didn’t care. It only matters to her that the sender has money and the message is correctly signed. She will transfer to the recipient's balance the amount indicated in the message.

Faiza sees a new record with her public key in the “To” column, and this warms her soul. Now she can spend her tokens as she pleases. Faise did not need to bother Lisa by sending her public key and distract her from work.
So, to summarize the result:

  • names in the spreadsheet replaced the public keys;
  • Lisa got rid of the table with names and public keys;
  • payments are made using the public keys of the sender and recipient instead of names.

These changes improved privacy and made Lisa's work easier. At the end of this chapter, we will discuss in detail how to further improve privacy.

In this example, upon receiving the letter, Lisa will almost certainly know who the sender is (in this case, the company) by looking at the From field of the email. But for now, we will assume that Lisa does not disclose to anyone and does not use this personal information. In this example, we use email instead of the Bitcoin peer-to-peer network. The Bitcoin network, which is discussed in detail in Chapter 8, does not use personal information.

Think about what Acme Insuranceans will now be able to learn from the spreadsheet. What information can they get if they find out the name of the sender or recipient of one payment? They will be able to identify all payments made by a person.

»More information on the book can be found on the publisher’s website
» Table of Contents
» Excerpt

For Khabrozhiteley 25% off coupon - Bitcoin

All Articles