3 ms·
According to Eth docs: > One validator is randomly selected to be a block proposer in every slot. This validator is responsible for creating a new block and se
by whatisweb3 4y ago
According to Eth docs:
> One validator is randomly selected to be a block proposer in every slot. This validator is responsible for creating a new block and sending it out to other nodes on the network. Also in every slot, a committee of validators is randomly chosen, whose votes are used to determine the validity of the block being proposed.
The annotated code for this can be found in [2].
[1] https://github.com/ethereum/annotated-spec/blob/master/phase0/beacon-chain.md#compute_proposer_index https://github.com/ethereum/annotated-spec/blob/master/phase...
[2] https://notes.ethereum.org/@vbuterin/Sys3GLJbD#Misc https://notes.ethereum.org/@vbuterin/Sys3GLJbD#Misc
- niemandhier 4y agoMaybe I am stupid, but at least to me its not obvious how one would randomly select a member in a decentralized way, assuming some actors are malicious?
- capableweb 4y agoThere are tons of different ways of doing so, with their own set of pros/cons. I'm not familiar with exactly how Eth2 does it, but I suppose your curiosity is a general one, not specific to Eth2, so here is how it works for Algorand as an example using VRFs (Verifiable Random Function): > The VRF takes a secret key and a value and produces a pseudorandom output, with a proof that anyone can use to verify the result. The VRF functions similar to a lottery and is used to choose leaders to propose a block and committee members to vote on a block. This VRF output, when executed for an account, is used to sample from a binomial distribution to emulate a call for every Algo in a user’s account. The more Algos in an account, the better chance the account has of winning – it’s as if every Algo in an account gets its own lottery. This method ensures that a user does not gain any advantage by creating multiple accounts. https://www.algorand.com/Algorand%20Protocol.pdf https://www.algorand.com/Algorand%20Protocol.pdf The search term you're looking for is "decentralized leader election", searching for that on Google or Google Scholar gives you bunch of results ranging from random musings to academic papers.
- YetAnotherNick 4y agoI tried to search for it, but can't find any concrete example assuming malicious nodes. There are many edge cases to cover here like who gets to set the secret key or any parameter. What if nodes get offline. What about things like DDoSing the node.
- capableweb 4y agoFor Algorand, the answer is in the very paper I linked: > If the network does stall, either from network outages or malicious behavior, the nodes go into recovery mode, waiting for recover messages. Individual nodes will send these messages to signal to the network that it should either continue processing the last known block proposal or to propose a new block. When a quorum of votes is received for either one of these messages, the system will revert to normal operation. In the case of malicious behavior, the protocol may select a new leader. In the case of network outage, the current block will continue to be processed or a new block might be proposed. For other blockchains, the answer will depend on their implementation. It's likely you're gonna have to understand the underlying protocol before you can understand the potential threats, and consequently how the protocol addresses those threats. So for other blockchains, your best bet to understand what happens in the case of malicious nodes, is to understand the whitepaper describing the protocol.
- jaimehrubiks 4y agoI'd love to see this explained too, like in simple words.
- dane-pgp 4y agoOne simple algorithm, just to convince you that this is possible, would be as follows: * All of the members generate a key-pair, and introduce themselves to each other with their public key as their identity. * After a certain time interval, all members individually pick their own random number, and publish just the hash of it, thereby "pre-committing" to it (signing it with their private key). * Once all the hashes are known, the members reveal the random numbers that were the inputs (and the other members check that they hash to the pre-committed values). * The members then XOR all the random numbers together (and then maybe hash the result) to produce a single final random number. * That random number is reduced modulo the number of members, producing a number which is then used as an index into the list of members (sorted by public key). There are edge cases with malicious or badly connected nodes potentially dropping out at each stage, so this requires a bootstrapped consensus system that can agree on which nodes are bad and punish them financially.
- deleted 4y ago[deleted]
- whatisweb3 4y agoIt is probably better to describe it as pseudo-random. See here: [1] [1] https://eth2.incessant.ink/book/06__building-blocks/02__randomness.html#wait-what-is-randomness https://eth2.incessant.ink/book/06__building-blocks/02__rand...
- pa7x1 4y agoThe procedure Ethereum uses to generate randomness is called RANDAO. You can see an explanation here: https://benjaminion.xyz/eth2-annotated-spec/phase0/beacon-chain/#randao https://benjaminion.xyz/eth2-annotated-spec/phase0/beacon-ch...