In this section of the lesson, we will deal with the three main cryptographic primitives on which Bitcoin is based: the hash algorithms, the digital signature algorithm, the Merkle trees, and the hashcash algorithm. Cryptographic hash function A cryptographic hash function (or summary function) is an algorithm that takes as input any data of any length (the message ) and returns a string of fixed-length bits (the hash ). The main characteristics of an ideal cryptographic hash function are the following: Efficiency in computing. You must provide a quick calculation of the hash from an input message. Preimage resistance. It must be computationally very difficult to generate the message from which the summary has been derived. Resistance to the second preimagen . It must be computationally very difficult, given a message, to get a second message that generates the same hash. Resistance to the collision . It must be computationally very difficult to generate two dif...