Skip to content

Conversation

@angrymouse
Copy link

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:

  • The PR edits only existing draft PRs.
  • The build passes.
  • Your GitHub username or email address is listed in the 'author' header of all affected PRs, inside .
  • If matching on email address, the email address is the one publicly listed on your GitHub profile.

@eip-review-bot
Copy link
Collaborator

eip-review-bot commented Jun 16, 2025

File ERCS/erc-7977.md

Requires 1 more reviewers from @g11tech, @SamWilsn, @xinbenlv

Comment on lines 65 to 68
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))`.

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.

Copy link
Author

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.

@angrymouse
Copy link
Author

CC @SamWilsn

@angrymouse angrymouse changed the title Add ERC: Future-block based oracleless randomness in smart contracts Add ERC-7977: Future-block based oracleless randomness in smart contracts Jul 2, 2025
@github-actions github-actions bot removed the w-ci label Jul 2, 2025
@angrymouse angrymouse changed the title Add ERC-7977: Future-block based oracleless randomness in smart contracts Add ERC-7977: Future-block oracleless randomness Jul 2, 2025
@eip-review-bot eip-review-bot changed the title Add ERC-7977: Future-block oracleless randomness Add ERC: Future-block oracleless randomness Jul 2, 2025
@angrymouse
Copy link
Author

image
I could not post this on ethereum magicians for some reason. Any thoughts why?

@github-actions
Copy link

github-actions bot commented Jul 2, 2025

The commit 9c5872e (as a parent of 86efa2f) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci label Jul 2, 2025
@angrymouse
Copy link
Author

@SamWilsn

@SamWilsn
Copy link
Contributor

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.

@SamWilsn SamWilsn closed this Jul 18, 2025
@github-actions github-actions bot removed the w-ci label Jul 18, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants