Welcome to Blockchain Demo!


Lab 1: HASHES

Before we begin, let's re-reference what a hash is. The hash (in regard to Ethereum) is an output of a SHA-256 function. Hashed outputs are a fixed length, even though they take data input of any arbitrary length. We also call this output our “fingerprint” for the data.

Let’s see how a minor change in the data changes not only the meaning of the sentence, but It also changes our hash:

Example 1

Step 1: TYPE THE FOLLOWING INTO THE DATA FIELD, VERBATIM:

Most of the time, travelers worry about their luggage.

Your hash output should be the following 64 characters:

474025798cf143c31a69546d109d9fb10f463915d333865c4497b89f1fcb72e3

Step 2: Delete the comma after the word “time”

Not only does the meaning of the sentence change but the Hash output also changes. Your hash output should now be 64 characters (same length) but the following different characters:

2257b30426ae49e8e6c34bd9044531e73afd9733e9593df1bd5769d24d233d92

Example 2

In the first example we saw how a minor change to the data has a subsequent change in the hash. Now, let's see how the amount of data we input does NOT change the number of characters in the hash.

Step 1: COPY AND PASTE THE FOLLOWING STORY INTO THE DATA FIELD:

As a man was passing the elephants, he suddenly stopped, confused by the fact that these huge creatures were being held by only a small rope tied to their front leg. No chains, no cages. It was obvious that the elephants could, at anytime, break away from their bonds but for some reason, they did not. He saw a trainer nearby and asked why these animals just stood there and made no attempt to get away. “Well,” trainer said, “when they are very young and much smaller we use the same size rope to tie them and, at that age, it’s enough to hold them. As they grow up, they are conditioned to believe they cannot break away. They believe the rope can still hold them, so they never try to break free.” The man was amazed. These animals could at any time break free from their bonds but because they believed they couldn’t, they were stuck right where they were.

Your hash should be the following:

8f9b4835ee6eb3b83ce099f0886024d7ab793c142b6eb3a49ad0ddb1f9dd2992

*Note: It must be copied exactly like the passage above, no extra lines or characters.

Your hash length once again should be 64 characters long.

 


Please return back to EdX