{"id":209391,"date":"2017-02-20T01:05:19","date_gmt":"2017-02-20T06:05:19","guid":{"rendered":"http:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/uncategorized\/bitcoin-hash-functions-explained-coindesk.php"},"modified":"2017-02-20T01:05:19","modified_gmt":"2017-02-20T06:05:19","slug":"bitcoin-hash-functions-explained-coindesk","status":"publish","type":"post","link":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/bitcoin-2\/bitcoin-hash-functions-explained-coindesk.php","title":{"rendered":"Bitcoin Hash Functions Explained &#8211; CoinDesk"},"content":{"rendered":"<p><p>    Anyone with an interest in bitcoin will have heard the phrase    'cryptographic hash function' at some time or other. But what    exactly does it mean, and how is it connected to    cryptocurrency?  <\/p>\n<p>    Hash functions are an essential part of, not only of the    bitcoin protocol, but of information security as a whole.  <\/p>\n<p>    In the following article we'll take a look at some simple    examples of how they work, with a simple demonstration, too.  <\/p>\n<p>    In the abstract, a hash function is a mathematical    processthat takes input data of any size, performs an    operation on it, and returns output data of a fixed size.  <\/p>\n<p>    In a more concrete example, this can be used to take a sequence    of letters of any length as input  what we    call a string  and return a sequence of letters of a    fixed length. Whether the input string is a    single letter, a word, a sentence, or an entire novel, the    output  called the digest  will always be the same    length.  <\/p>\n<p>    Acommon use of this kind of hash function is to store    passwords.  <\/p>\n<p>    When you create a user account with any web service which    requires a password, the password isrun through a hash    function, and the hash digest of the message is stored. When    you type in your password to log in, the same hash function is    run on the word you've entered, and the server checks whether    the result matches the stored digest.  <\/p>\n<p>    This means that if a hacker is able to access the database    containing the stored hashes, they will not be able to    immediately compromise all user accounts because there is no    easy way to find the password which producedany given    hash.  <\/p>\n<p>    You can experiment with hash values using Python, a programming    language installed on Mac and Linux operating systems by    default. (This tutorial will assume you're using some version    of either OS X or Linux, as using Python on Windows is more    complicated.)  <\/p>\n<p>    First, open a terminal, type python and hit ENTER.  <\/p>\n<p>    This will put you into the Python REPL, an environment where    you can try out Python commands directly as opposed to writing    a programme in a separate file.  <\/p>\n<p>    Then, type the following, pressing ENTER after each line, and    TAB where marked:  <\/p>\n<p>    You have now created a function, hash(), which    will calculate and print out the hash value for a given string    using the MD5 hashing algorithm. To run it, put a string in    between the parentheses in quotation marks, eg:  <\/p>\n<p>    And press ENTER to see the hash digest of that string.  <\/p>\n<p>    You will see that calling the hash function on the same string    will always generate the same hash, but adding or changing one    character will generate a completely different hash value:  <\/p>\n<\/p>\n<p>    In the bitcoin protocol, hash functions are part of the    block    hashing algorithm which is used to write new transactions    into the blockchain through the mining process.  <\/p>\n<p>    In bitcoin mining, the inputs for the function are all of the    most recent, not-yet-confirmed transactions (along with some    additional inputs relating to the timestamp and a reference to    the previous block).  <\/p>\n<p>    In the code example above, we've already seen that changing a    small part of the input for a hash function results in a    completely different output. This property is crucial to the    'proof of work' algorithm involved in mining: to successfully    'solve' a block, miners try to combine all of the inputs with    their own arbitrary    piece of input data in such a way that the resulting hash    starts with a certain number of zeroes.  <\/p>\n<p>    As a basic demonstration, we could try 'mining' with our Python    hash function by manually adding exclamation points after    \"CoinDesk rocks!\" until we find a hash that starts with a    single zero.  <\/p>\n<\/p>\n<p>    Of course, solving the hash for a bitcoin block  which        at the time of writing must start with 18 zeros  requires    anextremely large amount of computation (and so    the combined processing power of all the computers in the    network still takes approximately 10 minutes to solve a    block).  <\/p>\n<p>    It's the need for this large amount of processing power that    means new bitcoins get mined over a long period of time, not    all at once.  <\/p>\n<p>    In order to earn bitcoins through mining, you need to put in    the huge amount of work necessary to solve a block  and by    earning that reward, you're locking in all of the new    transactions into a block, which is added to the permanent    record of all previous transactions: the blockchain.  <\/p>\n<p>    Any crypto basics you'd like explained next? Email:    <a href=\"mailto:editors@coindesk.com\">editors@coindesk.com<\/a>.  <\/p>\n<p>        Bitcoin on keyboard image via Shutterstock  <\/p>\n<p>    Bitcoin    ProtocolCryptographyhash    functions  <\/p>\n<p><!-- Auto Generated --><\/p>\n<p>See the original post here: <\/p>\n<p><a target=\"_blank\" rel=\"nofollow\" href=\"http:\/\/www.coindesk.com\/bitcoin-hash-functions-explained\/\" title=\"Bitcoin Hash Functions Explained - CoinDesk\">Bitcoin Hash Functions Explained - CoinDesk<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p> Anyone with an interest in bitcoin will have heard the phrase 'cryptographic hash function' at some time or other.  <a href=\"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/bitcoin-2\/bitcoin-hash-functions-explained-coindesk.php\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"limit_modified_date":"","last_modified_date":"","_lmt_disableupdate":"","_lmt_disable":"","footnotes":""},"categories":[261455],"tags":[],"class_list":["post-209391","post","type-post","status-publish","format-standard","hentry","category-bitcoin-2"],"modified_by":null,"_links":{"self":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/209391"}],"collection":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/comments?post=209391"}],"version-history":[{"count":0,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/posts\/209391\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/media?parent=209391"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/categories?post=209391"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.euvolution.com\/futurist-transhuman-news-blog\/wp-json\/wp\/v2\/tags?post=209391"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}