If you want to know more about blockchain technology and Bitcoin, you have to climb over the technical wall and "open your eyes" from a technical perspective to see the first killer successful application of Bitcoin in the blockchain world. , look at why Satoshi Nakamoto can be called an alien, and when it comes to blockchain technology, we have to mention, Learn a piece of knowledge that is often used in blockchain technology - the hash function .
A hash function is a way to create a small digital fingerprint from any kind of data. The hash function compresses the message or data into a digest, making the amount of data smaller and fixing the format of the data. This function shuffles the data and recreates a fingerprint called a hash value.
If Baidu Encyclopedia and Wikipedia really have another name, it should be called (so professional that people can’t understand it) Encyclopedia. Give a concise vernacular definition of hash function: Hash function is a series of complex mathematical transformations with a fixed number of output values.
Transformation cannot be done randomly, and must be done according to the following process:
1. Content (data) of any length
2. After this series of complex but fixed mathematical transformations After
3, a fixed length and format of data (numeric value) will be output
Footnote: In the field of mathematics, H() will be used to represent the changed output value, which is called message summary in Chinese Or digital fingerprint.
For example, in Bitcoin, the hash function SHA256 is used when the public key generates an address. The "256" behind it means that the output is data with a fixed 256-bit length.

Not any mathematical transformation can be called a hash function. To upgrade a mathematical transformation to a hash function, it must Meets three conditions: uniqueness, one-wayness, violent solution:
1. Uniqueness of hash function
The intuitive understanding is: only input X, To get H(X). When understanding this feature, you can think of the hash function as you and your fingerprint. You are the input and your fingerprint is the output. Uniqueness means that only you can have your fingerprint. In Bitcoin, it means that you use it to transfer money. A Bitcoin address can only be generated with your public key. Just like your fingerprint is unique, no one else in the world can generate the same transfer address as you.
2. The one-way nature of the hash function
The one-way nature of the hash function means that H(X) cannot derive X in reverse. If you are given a fingerprint, and you have only one fingerprint, you will never be able to imagine whether the owner of the fingerprint is a male or a female, or what he looks like. You can only know that it is a fingerprint.
The one-way nature of the hash function can be intuitively understood with an inaccurate but very vivid analogy - guess who the owner of the chin is?

Is the owner of this manly and charming chin Bai Yu? Is it Zhang Zhen? Or Zhao Youting? The answer to the mystery is revealed: it’s our favorite Kunkun, not Cai Xukun, but Countryside F4 Xie Guangkun↓

Because of the one-way nature of the hash function, in Bitcoin, even if our payment address is public, no one can We don’t know what the public key we use to generate the payment address is, let alone what the private key is to generate the public key.
There is a saying in the market that the emergence of quantum computers will make Bitcoin worthless, but now you should know that even if quantum computers appear, it will still be difficult to break the hash function. The hash function is Satoshi set a security lock for Bitcoin, hoping that Bitcoin would have enough time to upgrade to a quantum-resistant encryption algorithm.
3. Violent solution of hash function
If you know the hash value H(X) and really want to find the input value X, you can only start from the source, a number Try a number, fit each number into a hash function, and then see if the output hash value is equal to H(X).
Just like if you really want to know whose fingerprint a certain fingerprint belongs to, you can only find one person all over the world to compare the fingerprints in each hand with this fingerprint to see if they are exactly the same, without any trace. deviation. 02
Because of these three characteristics, the hash function became a weapon in the hands of Satoshi Nakamoto, helping him solve many problems on the way to designing Bitcoin. In In the Bitcoin white paper, except for the 10 chapters of introduction and conclusion, the use of hash functions can be seen in almost every chapter.
· Use the uniqueness of the hash function to prevent fraud - digital signature
· Use the uniqueness of the hash function to improve efficiency - Merkle tree retrieval of transaction records
·Using the one-way nature of the hash function for confidentiality - the public key generates the Bitcoin address
Using the brute force solution of the hash function to design Bitcoin's proof of work - when the range When the fingerprint is large enough, it is impossible to find the fingerprint owner with a fingerprint. But if the scope is narrowed, for example, in a city with only a few million people, the difficulty will be much smaller. This is the purpose of Bitcoin. Mining difficulty adjustment mechanism. If you want the difficulty to be higher, expand the range. If you want the difficulty to be lower, narrow the range.
The hash function appeared in 1953, the hash function flourished in 1970, and SHA-256 appeared in 2001. In 2008, the hash function was played out by Satoshi Nakamoto and became It is the unshakable cornerstone of blockchain technology.
From this perspective, it is somewhat understandable why experts and experts can’t help praising Satoshi Nakamoto’s genius, and even doubt whether Satoshi Nakamoto is an alien.
At this point, although you only understand a basic knowledge of the hash function in the technical principles of the Bitcoin white paper, this does not prevent you from understanding 50% of what the Bitcoin white paper wants to express.
The above is the detailed content of High-frequency concepts in the process of learning blockchain: Hash function. For more information, please follow other related articles on the PHP Chinese website!

最近大热的BRC-20 Token是基于比特币,但比特币区块链无法对其进行规则约束。制造BRC-20 Token的成本在于将文件添加到区块链中,以及未来与Token关联的UTXO的移动。 既然UTXO这么重要,今天我们就来简单介绍一下U…

目前,一枚比特币价值近 22 万人民币。对于刚入圈的新人来说,肯定很关心比特币的安全问题。 那么,比特币安全吗?换句话说, 钱包里的比特币,容易被黑客盗走吗? 01. 私钥、公钥、地址就像银行取款、网银转账需…

在加密世界里,钱包地址就像 “银行卡账号”、“收件地址”一样重要,任何操作都离不开它,随着Ordinals 协议的诞生,推动了比特币基于隔离见证、Taproot升级的采用,这让很多人第一次使用“bc1p”等特殊抬头的地…

去中心化网络或 Web 3.0 加密货币是推动互联网下一次迭代的数字资产。它们基于区块链技术。与 Web 2.0 的集中式平台和服务相比,Web 3.0 旨在构建一个不太集中、更加透明且以用户为中心的互联网。Web 3.0 加密货币…

区块链显著特征就是其透明度和可追溯性超过了世界上的绝大多数系统,但是在这背后仍然存在着看不见的博弈!MEV (矿工可提取价值 / 最大可提取价值)就是隐藏的黑暗森林,在每一笔交易背后都可能有它的身影。 自 2…

持续的加密货币上涨主要是由比特币减半带来的兴奋推动的,比特币已经飙升至 65,000 美元以上并达到历史新高,加密货币市场的传统通配符——模因币——也几乎没有被排除在外。 事实上,过去 7 天内,多个著名的 mem…

通过钱包转账 ETH 或是ERC一20 Token时,我们知道这个转账需要付手续费。那么,转账的手续费是怎么算的呢? 如果转账的同时还去“刻字”,是不是需要收取更高的手续费呢?今天,大白就给大家聊聊 以太坊的 Gas 机…

去年下半年,整个加密市场处在深熊困境当中,但Arbitrum生态代表项目GMX和Treasure DAO依然逆势增长, 进入2023年以来,随着市场整体回暖,Arbitrum生态更是全面开花。 尤其是在Arbitrum 宣布发放治理Token ARB,…

Hot AI Tools

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Undress AI Tool
Undress images for free

Clothoff.io
AI clothes remover

AI Hentai Generator
Generate AI Hentai for free.

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

MantisBT
Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

DVWA
Damn Vulnerable Web App (DVWA) is a PHP/MySQL web application that is very vulnerable. Its main goals are to be an aid for security professionals to test their skills and tools in a legal environment, to help web developers better understand the process of securing web applications, and to help teachers/students teach/learn in a classroom environment Web application security. The goal of DVWA is to practice some of the most common web vulnerabilities through a simple and straightforward interface, with varying degrees of difficulty. Please note that this software

EditPlus Chinese cracked version
Small size, syntax highlighting, does not support code prompt function

SublimeText3 Linux new version
SublimeText3 Linux latest version
