当前位置:网站首页>How does the NTP clock server (satellite clock system) coordinate the integrated system?
How does the NTP clock server (satellite clock system) coordinate the integrated system?
2022-06-11 03:51:00 【Anhui Jingzhun】
NTP Clock server ( Satellite clock system ) How to coordinate the integrated system ?
NTP Clock server ( Satellite clock system ) How to coordinate the integrated system ?
This article mainly explains the important functions of blockchain : Proof of work (Proof-of-Work). It mainly explains that the proof of work is an important feature for blockchain , And it's necessary ; Other features often mentioned in blockchain ( Such as security ) It's secondary , It's useful, but it's not necessary .
The explanation of this paper is mainly based on some interesting features of blockchain work proof , These characteristics can't be obvious , Sometimes it's even counter intuitive , For example, participants in the blockchain can solve problems together without communication .
After understanding these features , It should be easy for people to conclude : Work proof is mainly to complete distributed or decentralized time mechanism ( Like a clock ).
Please note that , This article is not about the proof of work itself , It just shows how blockchain uses it . If you don't know about proof of work , So this link might be a good start .
The time sequencing problem of decentralized ledger
Before further description and explanation , Let's focus on this first , That's the scheduling problem . A lot of the literature on proof of work is confusing , Because they always try to explain the result of the problem rather than first determine the problem itself .
Any ledger absolutely needs order . One cannot spend money that one has not received , You can't spend what you've already spent . Blockchain transactions ( Or blockchain transactions ) The order has to be clear , And there's no need for a trusted third party to coordinate the order .
Even if blockchain is not a ledger , It's just some sort of data like sequential logs , But for each node there is the same blockchain replica , Sequence is also necessary . Different order of blockchains means different blockchains .
however , If the transaction is generated by anonymous participants from all over the world , And there is no central organization responsible for the order of transactions , But the facts need to be sorted , So what to do ? Although a deal ( Or block ) It might include a timestamp , But how credible are these timestamps ?
Time is just a human concept , A time scale, such as an atomic clock, is a “ A trusted third party ”. however , Due to the influence of network delay and time relativity , It is impossible to determine the sequence of events by time stamp in distributed system .
We are interested in “ Time ” It's not like we're used to years 、 month 、 The concept of day and other time . What we need is a mechanism , Through this mechanism, we can verify that one event occurs before another or may occur at the same time .(banq notes : The sequence of events )
First , For the concepts of what is before and what is after , Need to establish a point in time . Establishing a point in time at first seemed theoretically impossible , Because there's no technology accurate enough to measure Planck time . But as you can see , Bitcoin solves this problem by creating its own concept of time , At this point in time , It's actually possible to determine the exact point in time .
Leslie Lamport stay 1978 Year paper “ Time in Distributed Systems , Clock and sequence of events ” This problem is well described in , except “ A physical clock that is properly synchronized ” outside , This article does not actually provide a comprehensive solution . stay 1982 year ,Lamport It also describes “ General Byzantine question ”, and Satoshi In his first email, he explained how proof of work solved the problem , Because the bitcoin file says “ To implement a distributed timestamp server on a peer-to-peer network , We will need to use the proof of work system “, This shows that working proof is mainly to solve the problem of time stamp .
Time is fundamental
It must be emphasized that , In a distributed system, it is impossible to associate events with points in time , This is an unsolved problem , Until Nakamoto Tsung invented the blockchain work to prove this solution , A decentralized ledger is possible . There are many other technical details of blockchain , But timing is fundamental and important . No time, no blockchain .
Blockchain
Proof of work
In short , The work of blockchain has proved to be a system that meets certain requirements SHA-2 Hash value , This value is very difficult to find . The difficulty is that the hash is less than a specific number , The smaller the number is. , The rarer the input value is and the more difficult it is to find it .
It is called “ Proof of work ”, Because it's very rare to know a value with this hash , This means that finding such a value requires a lot of trial and error , namely “ Work ”. In turn, , It means “ Time ”.
By changing demand , We can change the difficulty , Thus changing the possibility of finding such hashes . The difficulty of bitcoin is adjusted dynamically , In order to find a correct hash every ten minutes on average .
Nothing happens between blocks
The state of a blockchain is represented by its blocks , Each new block produces a new state . The blockchain state moves forward one block at a time , And a block costs an average of 10 minute , This time is the minimum measure of blockchain time .
SHA No memory Memoryless, No progress Progress-Free
Secure hashing algorithm is memoryless in statistics and probability Memoryless. It's a particularly counterintuitive concept for us humans .
The best example of no memory is the toss of a coin . If a coin appears in succession 10 The same side , Does that mean the next throw is more likely to be the opposite ? Our intuition says yes , But actually every throw is 50/50 The opportunity of , No matter how many coincidences happened before .
No memory for no progress Progress-Free it is desirable that . No process means , As miners try to solve the problem of iterating over random numbers to find the hash value of the next block ( Solution ), Every attempt is a separate event , No matter how much work has been done in the past , The probability of finding a solution every time you try is constant . let me put it another way , In every attempt , None of the participants came closer to the solution or made any progress . A miner who has been looking for a hash for a year is no more likely to find a hash on the next try than a miner who has just opened a mine .
therefore , Find a given solution in a given period of time ( Hash value ) The probability of the hash is only determined by the speed at which all participants iterate in the hash . It's not history , Not the data , It's just the hash rate .
The hash rate is in turn a function of the number of participants and the speed of the device used to compute the hash .
SHA The input is irrelevant
In the bitcoin blockchain , The input is the block head . But if we just give it random values , So the probability of finding a consistent hash is still the same . Whether the input is a valid block or from / dev / random Bytes of , The average need is 10 Minutes to find the hash value of the next block .
Of course , If you find a hash that meets the requirements , But your input is not a valid block , Such a solution cannot be added to the blockchain , But it's still workload verification ( Though useless ).
The difficulty is the galaxy
Strangely enough , Difficulties are universal , It means it's across the universe . We can get miners on Mars to help us find , They don't need to communicate with the earth miners , The key is every 10 It's only a few minutes before we find the answer .( ok , They need to tell earth people in some way whether they have solved this problem , Otherwise we'll never know ).
It is worth noting that , There is no real communication between distant participants , Because they work together to solve the same statistical problems , But they don't even know about each other .
such “ universality ” Although it looks amazing at first , But it's actually easy to explain . I use the “ Universal universal” The word" , Because it uses a word to describe it , But it does mean “ Every participant knows ”.
SHA-256 The input of can be considered as 0 To 2 Of 256 An integer between squares ( Because the output is 32 byte , in other words 0 and 2 Of 256 Square , Any larger value can guarantee that , For example, it becomes redundant ). Even if it's very big ( Much larger than the number of atoms in the perceptible universe ), It's a set of numbers , Every participant knows , Participants can only be selected from this set of data .
If the input set is well known , function (SHA-256) It is well known that , And the difficulty requirements are well known , So the possibility of finding a solution is really “ general ”.
Try SHA Will make you a participant
If the determined problem is to find a matching hash value , So you only need to try it once , and Bingo, You've also affected the global hash rate , And for the person who tries to be a participant in helping others solve problems . You don't have to tell people you did it ( Unless you really find a solution ), Others don't need to know it , But your attempt did affect the results . For the whole universe ,no less.
If that's still questionable , A good analogy might be the problem of finding large prime numbers . It's hard to find the largest prime number , Once found , It becomes “ Was found to be ” or “ It is known that ”. There are countless prime numbers , But there is only one instance of every number in the universe . therefore , People trying to find the largest prime are working on the same problem . You don't have to tell anyone that you decided to look for the largest prime , You just need to post it when you find one . If no one finds the largest prime , Then it will never be found . therefore , As long as it turns out ( If found ) Be announced , Participate in ( Trying to find a ) person , Even if it's completely confidential , It still affects the results .
Think about this incredible statistic , That is to say, any participant will affect the result even in the case of complete confidentiality , Even if it doesn't succeed, it will , This is what makes Nakamoto's invention so brilliant .
It is worth noting that , Because of the search for SHA It's the concept of no progress , Every attempt can be thought of as a participant trying to join and leave immediately . therefore , Miners join and leave 50 times a second .
Participation is a statistical display
The global hash rate listed on many websites is not because every miner is in some “ Miner registration office ” register , They report hash rates regularly . But there is no such thing .
The hash rate is known , Because it's very important for 10 Find solutions to specific difficulties in minutes , On average, , Many of these attempts ( At the time of writing 〜10 Of 21) It has to be done by someone somewhere .
We don't know who these participants are , They never announced that they were working , People who don't find solutions ( In fact, they are all ) Didn't tell anyone they were working , Their location could be anywhere in the universe , But we know for sure that they exist . Because the problem needs to continue to be solved ( The hash value needs to be found ).
Work is a clock
The key to the problem is : The difficulty of finding a consistent hash is like a clock . If you like , A universal clock , Because there is only one such clock in the universe , So there's nothing to synchronize , Anyone can “ see ” it .
It doesn't matter that the clock isn't accurate . It is important to , It's the same clock for everyone , And the state of the blockchain can be unambiguously linked to the tick of the clock .
This clock is operated by multiple efficiencies of an unknown number of collective participants all over the world , Completely independent of each other .
The last part of the puzzle
The solution has to be a hash of the block ( The head of the block, to be exact ). As we mentioned , Input doesn't matter , But if it's the actual block , So whenever a solution is found , It all happens at the tick of our working time check clock . Not before that , It's not after that , It's right at the moment of tick . We know this unequivocally , Because the block is part of the mechanism .
let me put it another way , If the block is not input to SHA256 function , We will still have a distributed clock , But we can't connect this block to the tick of this clock . Using blocks as input solves this problem .
It is worth noting that , Our work proves that the clock only provides us with tick timing . There's no way to judge the order from tick to tick , This is it. Merkle The use of trees .
How about distributed consensus ?
Consensus means agreement . All participants can only agree on the tick of the clock, and have no choice but to reach a consensus . Besides , Everyone knows the tick and the additional data . in fact , As Nakamoto explained in the email quoted earlier , This really solved the Byzantine general problem .
In a rare but common case , There are two consecutive ticks associated with a block , conflict . This conflict is resolved by what block is associated with the next tick , Make one of the controversial pieces “ orphan ”. How blockchain continues is an accident , So it can also be indirectly attributed to the working time clock .
this is it
This is what work has been done for blockchain . This is not a “ The miners ”, Miners have the right to solve problems , It's not about turning real energy into a valuable concept , It's all the red herring .
for example , The reward of winning the prize is the reason to encourage miners to participate , But that's not what makes blockchain possible . Block is a Merkle Trees , But it has nothing to do with proof of work , It encrypts the block sorting record .Merkle The tree also makes the former tick “ More sure ”,“ There is no denying that ” Or simpler .
Workload proof is also a mechanism that blocks are actually immutable , It's a good side effect , Can make it possible to isolate witnesses , But it can also be done by retaining the signature ( Witness ) To complete , So it's secondary .
Conclusion
The work of bitcoin blockchain proves to be just a distributed 、 Distributed clocks .
If you understand the explanation , So you should better grasp the proof of work and the proof of rights and interests Proof-of-Stake Comparison , And obviously the two are not comparable : Proof of interest is about ( Randomly distributed ) jurisdiction , And the work proved to be a clock .
In the context of blockchain , Proof of work can be a misuse . The term is Hashcash The legacy of the project , It's really used to prove work . In blockchain , But it's mainly about time spent verifiably . When people find a hash value that satisfies the difficulty , People find it takes time . The way to complete this time is “ Work ”, Hashing is interesting , Because it's a proof of time .
The fact that work proves to be all about time and not work also shows that , There may be other similar statistical challenges , These challenges take time and effort . This may also mean that the bitcoin hash rate is too high , And the bitcoin clock we described above can run reliably at a fraction of the hash rate , But hash rate is an incentive structure to stimulate energy consumption .
边栏推荐
- pmm监控oracle
- 高考结束,可以干什么事情,专业应该如何选择?-- 来自一个在校大学生的肺腑之言
- 右键 powershell here 功能添加
- Image scaling with aspect ratio preserving by opencv
- Go failing - expected ‘package‘, found ‘EOF‘
- 开源项目 英雄联盟 之WPF
- JMeter piezometric interface programming North
- OpenGL error Guide
- [signalr complete series] Net6 Zhongshi signalr communication
- Lvgl Chinese font production
猜你喜欢

Lvgl Chinese font production

Exam item management system based on SSM

Oppo K9 tests "bundling sales" and consumers "earn" or "lose"?

Management system of College Students' associations based on SSM

Manual testing cannot be changed to automated testing. What is missing?

基于SSM框架的学生在线教育教学课程管理系统

Detailed explanation of scenario method for common test case design methods

Chinese classics for children

PMM monitoring Oracle
![From function test to advanced automation test, I stayed up 7 days to sort out this 3000 word super complete learning guide [with network disk resources]](/img/bd/478558d50aa14320c70d3f8a7b76a5.png)
From function test to advanced automation test, I stayed up 7 days to sort out this 3000 word super complete learning guide [with network disk resources]
随机推荐
unforgettable moments
Docker swarm installs redis cluster (bitnami/redis cluster:latest)
Writing shell scripts using vscode
1_ Attribute management function
JMeter piezometric interface programming North
基于SSM框架的连锁超市购物零售后台管理系统
JS the most commonly used sorting - hand tearing JS series
A - Eddy‘s AC难题(C语言)
[signalr complete series] Net6 Zhongshi signalr communication
C. Jump and treat (DP + monotonic queue optimization)
给孩子的国学经典
Source Insight 4.0设置注释与反注释的快捷键
Mavros controls UAV to conduct binocular slam in gazebo environment
Chinese classics for children
大厂外包or自研公司?测试人找工作怎么选?
Quartz: an old and robust open source task scheduling framework, which is smooth enough to use
[CNN]|CNN与Transformer区别
Matlab reports an error when trying to use * * * as a function problem, and tries to execute script PCA as a function:
Canvas drawing -- how to place the drawing in the center of the canvas
难忘时刻