Chapter 2. Cryptographic hash functions and digital signatures

 

This chapter covers

  • Creating a simple money system: cookie tokens
  • Understanding cryptographic hash functions
  • Authenticating payments using digital signatures
  • Keeping your secrets secret

I’ll start this chapter by setting the stage for the rest of this book. We’ll look at a simple payment system that we can improve on using Bitcoin technologies. By the time we get to chapter 8, this simple system will have evolved into what we call Bitcoin.

The second part of this chapter will teach you what you need to know about cryptographic hash functions. These are so important to Bitcoin that you really need to understand them before learning anything else. You’ll see how a cryptographic hash function can be used to verify that a file hasn’t changed since a previous point in time.

The rest of the chapter will solve the problem of the imposter: a bad guy claiming to be someone else to pay money from that someone’s account. We solve this problem by introducing digital signatures (figure 2.1) into the simple system.

Figure 2.1. Digital signatures in Bitcoin

The cookie token spreadsheet

Suppose there’s a cafe in the office where you work. You and your coworkers use a spreadsheet to keep track of cookie tokens (figure 2.2), which use the symbol CT. You can exchange cookie tokens for cookies in the cafe.

Cryptographic hashes

Exercises

Digital signatures

Recap

Exercises

Summary

sitemap