Bitcoin what is a hash
Develop and improve products. List of Partners vendors. Your Money. Personal Finance. Your Practice. Popular Courses. Investing Cryptocurrency.
What Is a Target Hash? Key Takeaways In cryptocurrency mining, a target hash is a numeric value that a hashed block header which is used to identify individual blocks in a blockchain must be less than or equal to in order for a new block to be awarded to a miner. Target hashes are used in cryptocurrencies that use a proof-of-work PoW system to set the current mining difficulty including Bitcoin ; if a cryptocurrency uses a different system for mining, it may not require a target hash. The Bitcoin network adjusts the difficulty of mining by raising or lowering the target hash in order to preserve an average minute interval between new blocks.
Compare Accounts. The offers that appear in this table are from partnerships from which Investopedia receives compensation. This compensation may impact how and where listings appear. Investopedia does not include all offers available in the marketplace. Related Terms Understanding Hash A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed length.
Proof of Work PoW Proof of work describes the process that allows the bitcoin network to remain robust by making the process of mining, or recording transactions, difficult. Nonce In blockchain technology, nonce means a number added to a hashed, or encrypted block, that, when rehashed, meets the difficulty level restrictions. The values returned by a hash function are called hash values, hash codes, hash sums, checksums or simply hashes. Recent development of internet payment networks and digital money , such as Bitcoin , also uses a form of 'hashing' for checksums, and has brought additional attention to the term.
Hash functions are primarily used to generate fixed-length output data that acts as a shortened reference to the original data. This is useful when the original data is too cumbersome to use in its entirety. One practical use is a data structure called a hash table where the data is stored associatively. A cryptographic hash function combines the message-passing capabilities of hash functions with security properties. Hash functions are commonly used data structures in computing systems for tasks, such as checking the integrity of messages and authenticating information.
While they are considered cryptographically "weak" because they can be solved in polynomial time, they are not easily decipherable. Cryptographic hash functions add security features to typical hash functions, making it more difficult to detect the contents of a message or information about recipients and senders.
In particular, cryptographic hash functions exhibit these three properties:. Because of the features of a hash, they are used extensively in online security—from protecting passwords to detecting data breaches to checking the integrity of a downloaded file.
The backbone of a cryptocurrency is the blockchain, which is a global ledger formed by linking together individual blocks of transaction data. The blockchain only contains validated transactions, which prevents fraudulent transactions and double spending of the currency. The resulting encrypted value is a series of numbers and letters that do not resemble the original data and is called a hash.
Cryptocurrency mining involves working with this hash. Hashing requires processing the data from a block through a mathematical function, which results in an output of a fixed length. Solving the hash starts with the data available in the block header and is essentially solving a complex mathematical problem.
Each block header contains a version number, a timestamp, the hash used in the previous block, the hash of the Merkle root , the nonce , and the target hash. The miner focuses on the nonce, a string of numbers. This number is appended to the hashed contents of the previous block, which is then hashed. If this new hash is less than or equal to the target hash , then it is accepted as the solution, the miner is given the reward, and the block is added to the blockchain.
The validation process for blockchain transactions relies on data being encrypted using algorithmic hashing. Solving the hash requires the miner to determine which string to use as the nonce, which itself requires a significant amount of trial-and-error. This is because the nonce is a random string.
It is highly unlikely that a miner will successfully come up with the correct nonce on the first try, meaning that the miner may potentially test a large number of nonce options before getting it right.
The greater the difficulty—a measure of how hard it is to create a hash that meets the requirement of the target hash—the longer it is likely to take to generate a solution. It can be as long as you want, or as short as you want, but the output, the size of the digest or the size of the tag, is going to be fixed in length, and for example, in the context of a hash function like, let's say, SHA, the digest will actually be exactly bits in length.
It's going to have a fixed-length output, but an arbitrary-length input. The other thing I want to point out about these cryptographic hash functions is that the function here is a deterministic function, and by that, I mean that the output will always be the same for a given input, so if you have a given input, you're going to see the exact same output. You won't have a situation in which, maybe, a given input will have two different possible outputs.
It's going to be consistent. Now, traditional hash functions have been used in computer science for quite some time, and they are used in many computing applications, so, for example, you may have heard of something like a hash function used in something called a hash table, but the kinds of hash functions that are used in hash tables, and I want to stress this, they aren't necessarily the same as cryptographic hash functions.
The qualifier "cryptographic" here is very important, and it usually means or implies that that hash function has to have a certain set of critical design goals and maybe some particular properties in mind that make it suitable for use in applications that use cryptography or cryptographic applications, areas where perhaps security or privacy or confidentiality or authentications are a serious concern. First and foremost, maybe in describing some of these properties is that, and maybe this almost goes without saying, one of the first properties you want of a cryptographic hash function is that it should be computationally efficient, and by that, I mean that it shouldn't take a lot of time to compute the output from a given input.
If you're given a message and you want to apply this set of transformations to that message to get a digest, that set of transformation should not take a long time to implement on a computer. It should be very fast, or relatively fast. It almost goes without saying, but I think it's important to stress and point it out because I've seen people come up with grossly inefficient hash functions sometimes, and those would not be considered suitable in the context of when typical cryptographic hash functions are used for cryptographic applications.
The second property you typically need in the context, and this is especially in the context of digital signing, is that you want it to be the case that it's hard to find two inputs that actually map to the same output, and I mean two distinct inputs whose corresponding digest is identical. This property is typically referred to as collision resistance. That means it's hard to find a colliding pair of input, so in other words, if you have two inputs and let's say you have a message M1, and you have a message M2, their output under the application of the hash function should not be the same.
You won't ever have it be the same that the, you won't even have it be the case, rather, that the output of M1 and M2 under an application of the hash function is the same.
They should never be the same.
0コメント