当前位置:网站首页>POW共识机制
POW共识机制
2022-06-23 12:37:00 【梦飞】
一、基本原理
因为记账有一定的奖励和手续费,所以自然会有竞争,POW (Proof of Work) 工作量证明共识机制就是用来在“谁有权记账”这一问题上达成共识。 简单来说,就是争夺记账权的多方通过付出计算资源解决一个数学难题,谁先解决谁就获得记账权,这个争夺的过程就是“挖矿”,也是比特币发行的过程。具体的计算问题是,计算出新区块的hash值,并且这个hash值要小于某个数,也就是要有足够多的前导零,前导零越多,计算难度越大,可以以此调整生成一个区块的所需的时间。新区块综合了上一区块的hash值、上一区块生成之后的新的验证过的交易内容的Markle Root值,以及一个待猜测的一定范围内的随机数Nonce,计算量就在于穷举Nonce值以计算出符合条件的hash值。POW还有一个最长链机制,即用户会把最长链作为主链并继续拼接下去。因此,系统中可能出现链的分叉(Fork),但最终会有一条链成为最长的链。
二、优缺点
1. 优点:
(1)可以避免双花攻击行为发生。 (2)挖矿难度可以自动调整。 (3)可以吸引用户快速参与其中,因为越早参与获利越多。 (4)通过“挖矿”发行比特币,相对公平。
2. 缺点及解决思路:
- 51风险 如果串通的矿工控制了一半以上的资源(事实上可以更少),将会有最长主链的控制权,可以对交易进行针对性选择,使得系统不再是去中心化的。而且已经提出有策略可以使得矿池获得比资源比例更高的收益,核心思想就是自私挖矿。这样的话就会有联盟的动力,原本的激励一致性就被破坏了,大多数矿工可信的假设也不再成立。 解决思路:给联盟可控制的资源设置足够小的瓶颈,防止某一方具有控制权。
- 资源浪费 计算hash难题并不是什么技术性问题,而是拼资源,虽然一定程度上达到了公平性和安全性,但是这样的资源消耗没有其他任何的现实价值,没有抢夺到记账权的节点的计算资源更是白白浪费了,只能继续下一次的争夺。 解决思路:创造价值才是区块链的初衷,但这样看起来好像白白把计算资源用在了毫无意义的计算上,从计算意义这一角度出发,可以不改变基本机制,但是把计算对象转到有科研或者其他实际价值的难题上,这样就可以让资源得到有效的利用,比如把算力用来搜索质数,从而计算孪生素数表,或者与人工智能的深度学习相结合等。也可以改用其他需要消耗较少计算资源的机制,比如POS权益证明,DPOS权益授权证明等,尽管其他的机制也有一些待解决的问题。
- 共识周期长 如果难度太低,则容易产生分叉,难度太高,又会限制交易速度。为了减少分叉的产生而做出的妥协使得比特币每秒的交易量很低,与支付宝等中心化应用相去甚远,并不适合商业使用。
边栏推荐
- <Sicily>1001. Rails
- Stimulsoft Ultimate Reports 2022.3.1
- 20 years' Shanghai station D question Walker (two points, concise)
- Can cold plate, submerged and spray liquid cooling lead the development of high-performance computing?
- Lm05 former VIX (second generation product)
- What is the reason why maxcompute is sometimes particularly slow to execute SQL queries
- mysql innodb的redo log buffer中未commit的事务持久化到redo log后,万一事务rollback了怎么办?
- kubernetes comfig subpath
- An idea of using keep alive to cache data in vue3 form pages
- 解决:Argument type ‘String‘ expected to be an instance of a class or class-constrained type
猜你喜欢

Solve "thread 1:" -[*.collectionnormalcellview isselected]: unrecognized selector sent to instance 0x7F "

Ablebits Ultimate Suite for Excel

Localization information | aikesheng and China kefangde complete product compatibility and mutual certification

「开发者说」钉钉连接器+OA审批实现学校学生假勤场景数字化

Qunhui 10 Gigabit network configuration and test

C#部分——值类型和引用类型

AssetBundle资源管理

20年上海站D题Walker(二分,简洁)

【深入理解TcaplusDB技术】单据受理之事务执行

Solution: argument type 'string' expected to be an instance of a class or class constrained type
随机推荐
CSS magic nugget mug; Optimization of CK, ES and redisearch schemes in ten million level data query; Why does module circular dependency not lead to dead loop Sauced afternoon tea issue 13
首次曝光!唯一全域最高等级背后的阿里云云原生安全全景图
What is the version of version 1.54 when connecting to Oracle?
How do the top ten securities firms open accounts? Is online account opening safe?
网络基础和框架
What should testers do if the requirements need to be changed when the project is half tested?
What should I do if a serious bug occurs within the scope of my own test and I am about to go online?
Synergetic process
R language uses matchit package for propensity matching analysis (set the matching method as nearest, match the control group and case group with the closest propensity score, 1:1 ratio), and use matc
Photon网络框架
[basic knowledge] - data bit width converter
C # learning (advanced course) day13 - Reflection
ROS observation [51]: how to integrate odometer and IMU with robots_ Localization convergence
判断测试结束的标准有哪些?
How can testers get started quickly when they change jobs to a new company?
Tt-slam: dense monocular slam for flat environment (IEEE 2021)
Unity小需求——简单实现仿王者钻石夺宝(单抽)
HomeKit支持matter协议,这背后将寓意着什么?
20 years' Shanghai station D question Walker (two points, concise)
数据中台稳定性的“四高” | StartDT Tech Lab 18