但是如何在超级账本上实现可证明的公平和密码安全的伪随机数生成器(CSPRNG)?
我的第一个假设是从共识算法中获得一个随机数,但是如果验证者仅使用自己操纵的块发送交易,验证者就可以操纵当前块。
后来,我开发了这种算法,该算法应该可以工作,但是很难实现:
for every block:
every validator:
1. generates new temporary privkey and pubkey
2. makes a raw transaction to the next validators pubkey
3. transfers his privkey to the blockchain after a block was broadcasted
4. verifies every privkey which belongs to a pubkey on the blockchain
5. calculates H(blockhash | privkey1 | privkey2 | ... | privkeyn) as new random number
我认为这对于赌博应用程序也很有趣。
那么解决我的问题的最简单方法是什么?我应该实现上面显示的算法吗?