-
Notifications
You must be signed in to change notification settings - Fork 830
Add ERC: Future-block oracleless randomness #1094
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
Conversation
| 2. **Aggregate**: The algorithm MUST perform the following loop: | ||
| * For each block `i` in the range from `requestBlockNumber + 1` to `requestBlockNumber + BLOCK_WINDOW`: | ||
| a. **Source the blockhash**: Fetch the `blockhash(i)`. | ||
| b. **Bind to request**: Create a request-specific hash to prevent cross-request contamination: `intermediate_hash = keccak256(abi.encodePacked(blockhash(i), requestId))`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Don't you think this could theoretically allow collisions under malicious input. We can tru using abi.encode(blockhash, requestId) or structured hashing (e.g., EIP-712 style), which is unambiguous.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
By input, do you mean requestId?
I think the only risk would be if the requestId is the same across different requests - making it easier for validators to manipulate them all at once. But as for other factors, since blockhashes are not defined when you get requestId, there shouldn't be a problem with collisions.
|
CC @SamWilsn |
|
The commit 9c5872e (as a parent of 86efa2f) contains errors. |
|
Unfortunately this proposal does not seem like a good fit for the ERC process. EIPs/ERCs exist to promote interoperability between independent implementers. Generally we require that there be multiple implementations on both sides of the standard. For example, tokens are a good fit because on one half we have many wallets and on the other half we have many different tokens. This proposal looks like it'll have a single implementation to generate randomness, which can be picked up as a library by contracts that want it. Instead of an ERC, this proposal should get API documentation and its own git repository. |

When opening a pull request to submit a new EIP, please use the suggested template: https://github.com/ethereum/EIPs/blob/master/eip-template.md
We have a GitHub bot that automatically merges some PRs. It will merge yours immediately if certain criteria are met: