-
Notifications
You must be signed in to change notification settings - Fork 96
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Remove the randomness feature from Honey Badger. #183
Comments
As a zero-overhead alternative: Edit: To clarify, the value we'd use as a source of randomness is Question: Is this value safe to use as a random seed? I.e. is it unknowable in advance (before f + 1 parties published their decryption shares), and more or less evenly distributed? (The latter is probably not even necessary: we'd just use it as a seed for a PRNG.) |
I'm pretty confident that this would be suitable: For every individual contribution, we'd get the product of the public master key with the proposer's chosen random value. But we'd sum up (or xor) N - f of those, from different nodes. Some of those are honest and chose a genuinely random value. With #209, however, we would either not produce a random value in every epochs, or we'd have to resort to another method (use the common coin after all) in those epochs. |
#170 would probably make it insecure, however, since we'd learn about the other nodes' values before Subset terminates… |
Let's implement this step-by-step:
|
This is only secure if threshold encryption is enabled, but it doesn't require an additional coin and provides a configurable number of random bytes, as required by poanetwork/parity-ethereum#34.
|
As discussed, the above is trivial enough to leave it to the user: Let's remove the
|
A randomness primitive is desirable for a lot of smart contract use cases. Basically it suffices to initialize a (possibly on-chain) PRNG with a new seed in each epoch that cannot be known before that epoch.
This is already achievable with hbbft, by using a separate Coin instance's output value as the pseudo-random seed. However, the coin must not be flipped before the epoch's batch has been determined, otherwise a validator would be able to make their choice of proposed transactions based on the random seed. So currently, the coin would have to be flipped after Honey Badger has output, which adds another round of messages, and therefore decreases block rate/increases lag.
We could make Honey Badger output twice for each epoch: first to notify the user that the new batch has been decided but not yet decrypted, and then, a bit later, to produce the actual batch. That would allow us to initiate the coin flip after the first output, in parallel with the decryption round.
Alternatively, we could make the randomness an optional feature of Honey Badger itself, so it would do the above internally, and just output a random value together with each batch. That might be a slightly more convenient API, but it would be less flexible: there could be use cases where one wants to do something other than flip a coin at the earliest possible moment where a batch is decided.
The text was updated successfully, but these errors were encountered: