METHOD AND APPARATUS FOR GENERATING RANDOM NUMBERS IN BLOCKCHAIN
摘要:
The present disclosure mainly relates to the technical field of computers, and in particular to a method and apparatus for generating a random number in a blockchain. In a specific embodiment, the method includes: a first random number and a first digest value of the first random number are locally generated by a first node in a blockchain; the first node submits the first digest value to a smart contract; the smart contract broadcasts a first service, so that at least one blockchain node submits participation information about the first service; the smart contract determins a second node from the at least one blockchain node based on the order of submitting the participation information; when the first service ends, the first node submits the first random number to the smart contract; when the smart contract verifies that the first random number corresponds to the first digest value, the smart contract generates a second random number based on a second digest value of the second node and the first random number; and a second service is started based on the second random number. The embodiment improves the reliability of the random number, thereby ensuring the fairness of service results.
信息查询
0/0