基于策略梯度算法的工作量证明中挖矿困境研究
2019-08-01王甜甜于双元徐保民
王甜甜 于双元 徐保民
摘 要:针对区块链中工作量证明(PoW)共识机制下区块截留攻击导致的挖矿困境问题,将矿池间的博弈行为视作迭代的囚徒困境(IPD)模型, 采用深度强化学习的策略梯度算法研究IPD的策略选择。利用该算法将每个矿池视为独立的智能体(Agent), 将矿工的潜入率量化为强化学习中的行为分布,通过策略梯度算法中的策略网络对Agent的行为进行预测和优化,最大化矿工的人均收益,并通过模拟实验验证了策略梯度算法的有效性。实验发现,前期矿池处于相互攻击状态,平均收益小于1,出现了纳什均衡的问题;经过policy gradient算法的自我调整后,矿池由相互攻击转变为相互合作,每个矿池的潜入率趋于0,人均收益趋于1。实验结果表明,policy gradient算法可以解决挖矿困境的纳什均衡问题,最大化矿池人均收益。
关键词:区块链;工作量证明机制;博弈论;深度强化学习;策略梯度算法
中图分类号:TP183
文献标志码:A
Abstract: In view of the mining dilemma problem caused by block withholding attack under Proof of Work (PoW) consensus mechanism in the blockchain, the game behavior between mining pools was regarded as an Iterative Prisoners Dilemma (IPD) model and the policy gradient algorithm of deep reinforcement learning was used to study IPDs strategy choices. Each mining pool was considered as an independent Agent and the miners infiltration rate was quantified as a behavior distribution in reinforcement learning. The policy network in the policy gradient was used to predict and optimize the Agents behavior in order to maximize miners average revenues. And the effectiveness of the policy gradient algorithm was validated through simulation experiments. Experimental results show that the mining pools attack each other at the beginning with miners average revenue less than 1, which causes Nash equilibrium problem. After selfadjustment by the policy gradient algorithm, the relationship between the mining pools transforms from mutual attack to mutual cooperation with infiltration rate of each mining pool tending to zero and miners average revenue tending to 1. The results show that the policy gradient algorithm can solve the Nash equilibrium problem of mining dilemma and maximize the miners average revenue.
英文關键词Key words: blockchain; Proof of Work (PoW); game; deep reinforcement learning; policy gradient algorithm
0 引言
区块链是比特币[1]等加密货币的底层实现技术,比特币作为区块链最为成功的应用场景,是在工作量证明(Proof of Work,PoW)的共识机制下完成交易内容的。在比特币系统中,每个节点都会参与到区块的生产中,并提供一定的PoW,首先生产出区块的节点,可以获得一定的比特币奖励。这一过程就是“挖矿”,参与挖矿的节点称为“矿工”。按照比特币系统的设定,区块大约10min产生一个,意味着大多数矿工挖不到区块,为获得相对稳定的收入,矿工会选择性地加入矿池进行合作挖矿。……
