aptos-foundation / AIPs

Aptos Improvement Proposals (AIPs)
https://governance.aptosfoundation.org/
120 stars 95 forks source link

[AIP-79][Discussion] Implementation of instant on-chain randomness #407

Closed thepomeranian closed 4 months ago

thepomeranian commented 6 months ago

AIP Discussion

This AIP describes the implementation of the randomness API from AIP-411 on top of Aptos blockchain, which is to provide Move smart contracts with access to (1) instant, (2) unbiasable and (3) unpredictable randomness under the proof-of-stake assumption that secures the blockchain itself. The implementation should also be efficient, i.e., negligible impact to the throughput or latency of the blockchain system. The AIP will focus on the on-chain randomness protocol description and implementation, and the efficient blockchain system integrations. Specifically, we describe how we implement a weighted distributed key generation (DKG) protocol in a PoS setting to set up threshold keys among the validators, and have validators generate randomness every block using their keys and a weighted verifiable unpredictable function (VUF). We will also describe other major system changes such as reconfiguration changes and Aptos VM changes.

Read more about it here: https://github.com/aptos-foundation/AIPs/blob/main/aips/aip-79.md

ghost commented 5 months ago

Could i ask an stupid question would you mind? is every block transaction are confirmed in certain time and period that precious to microsecond?

danielxiangzl commented 5 months ago

Could i ask an stupid question would you mind? is every block transaction are confirmed in certain time and period that precious to microsecond?

Each block has a timestamp in microsecond, determined by the block proposer. Every validators agree on the timestamp since they agree on the block, but they may commit the block at different physical time points since the system is decentralized.