Skip to content
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

[EVM] Add support for revertible random #5862

Closed
sideninja opened this issue May 7, 2024 · 1 comment · Fixed by #5934
Closed

[EVM] Add support for revertible random #5862

sideninja opened this issue May 7, 2024 · 1 comment · Fixed by #5934
Assignees

Comments

@sideninja
Copy link
Member

sideninja commented May 7, 2024

Currently, we implemented access to random sources through a cadence arch contract, which uses the Flow history source of randomness contract and can be used with commit-reveal schemes to create non-revertible randomness.

However, it would be useful to also allow revertible random generation (revertible if the transaction execution is suspended after revealing the random results).
Currently, we expose a random source for the current block in the EVM block field, which is not good since all random results of the same transaction and other transactions can be predicted by the execution environment. We should instead implement a new cadence arch function that uses the same source of randomness in the FVM backend as well as a Go PRG implementation to produce random output, this is then returned through the cadence arch function into EVM. This way we hide the random source and the PRG instance from the transaction execution environment and only expose the random results.

@sideninja sideninja self-assigned this May 7, 2024
@sideninja
Copy link
Member Author

The discussion thread that initiated the issue can be found on Discord: https://discord.com/channels/613813861610684416/1230199673629835375/1237010136032215121

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant