<p>A hash is like a unique identifier, perhaps like a barcode, usually written in hexadecimal as a string of numbers an letters. Bitcoin specifically uses the SHA-256 hash algorithm in most places (it also uses RIPEMD160 in some places). You can 'hash' any data you like, and get such a unique identifier. For example the hash of a transaction is called the TXID (transaction ID). If you change any small part of the transaction then the entire hash changes. Same with blocks, the hash of a block header is used to uniquely identify that block and make sure nothing has changed. Anyone can verify that the header hashes to the same hash, to test for integrity. And it is also used to make mining difficult - a special requirement is placed on each block hash that it has to be less than some target (or that it has to start with a certain number of 0s). One of the key aspects of a hash is that there is no way to reverse it, hashing is a one way function, you cannot take a hash and find out the data it came from.</p>

CC BY-SA 3.0
2017-12-07T10:10:20.313Z
2017-12-07T10:10:20.313Z
meshcollider
<p><a href="https://en.wikipedia.org/wiki/Hash_function" rel="nofollow noreferrer">A hash function</a> is a mathematical operation with some special properties, such as being deterministic (always get the same output if you use the same input), and being non-invertible (if you have the function output, you can't work backward to get the input). You can take any input data, "hash it" (use it as input for the hash function), and you'll receive some output data that looks completely random. If you change just one little thing about the input, your output will change entirely and unpredictably. </p>

<p>So in layman's terms.. its like a magical piece of math that lets you turn any input data into some random looking output data. If you give someone the output, there is no way they can figure out your input, even if you show them how the hash function works. </p>

<p>These properties allow for some neat cryptographic tricks, such as <a href="https://en.wikipedia.org/wiki/Public-key_cryptography" rel="nofollow noreferrer">public key cryptography</a>, or the <a href="https://en.bitcoin.it/wiki/Proof_of_work" rel="nofollow noreferrer">'Proof of Work'</a></p>

CC BY-SA 3.0
2017-12-07T12:16:18.927Z
2017-12-07T12:16:18.927Z
chytrik
<p>I am currently reading through the paper on bitcoin and being from a non IT background, I am unable to understand the use/function of hash</p>

<hash>
What is #Hash in bitcoin from a layman's perspective?
Shiji John
# What is #Hash in bitcoin from a layman's perspective?

(Asked by: username_0 on 2017-12-07)

I am currently reading through the paper on bitcoin and being from a non IT background, I am unable to understand the use/function of hash

**Tags:** hash


---

## 2 answers

### Answer by username_1 on 2017-12-07. Score: 1

A hash is like a unique identifier, perhaps like a barcode, usually written in hexadecimal as a string of numbers an letters. Bitcoin specifically uses the SHA-256 hash algorithm in most places (it also uses RIPEMD160 in some places). You can 'hash' any data you like, and get such a unique identifier. For example the hash of a transaction is called the TXID (transaction ID). If you change any small part of the transaction then the entire hash changes. Same with blocks, the hash of a block header is used to uniquely identify that block and make sure nothing has changed. Anyone can verify that the header hashes to the same hash, to test for integrity. And it is also used to make mining difficult - a special requirement is placed on each block hash that it has to be less than some target (or that it has to start with a certain number of 0s). One of the key aspects of a hash is that there is no way to reverse it, hashing is a one way function, you cannot take a hash and find out the data it came from.


---

### Answer by username_2 on 2017-12-07. Score: 0

[A hash function](https://en.wikipedia.org/wiki/Hash_function) is a mathematical operation with some special properties, such as being deterministic (always get the same output if you use the same input), and being non-invertible (if you have the function output, you can't work backward to get the input). You can take any input data, "hash it" (use it as input for the hash function), and you'll receive some output data that looks completely random. If you change just one little thing about the input, your output will change entirely and unpredictably.

So in layman's terms.. its like a magical piece of math that lets you turn any input data into some random looking output data. If you give someone the output, there is no way they can figure out your input, even if you show them how the hash function works.

These properties allow for some neat cryptographic tricks, such as [public key cryptography](https://en.wikipedia.org/wiki/Public-key_cryptography), or the ['Proof of Work'](https://en.bitcoin.it/wiki/Proof_of_work)


---

