Skip to content

Define sha256 & blake3 spec functions - #5555

Merged
jtraglia merged 3 commits into
ethereum:masterfrom
jtraglia:explicit-hash-functions
Aug 24, 2026
Merged

Define sha256 & blake3 spec functions#5555
jtraglia merged 3 commits into
ethereum:masterfrom
jtraglia:explicit-hash-functions

Conversation

@jtraglia

Copy link
Copy Markdown
Member

Currently, the hash function in Python is overloaded to be the SHA256 hash. Now that there are two hash functions (BLAKE3 was introduced in EIP-8321), we should make this explicit. Also, I never liked that these were defined internally instead of in the markdown files.

@mkalinin

Copy link
Copy Markdown
Contributor

Could we have sha256 and blake3 names in the spec? The suffix _hash isn’t necessary cause those two names have a strong hash function semantics in the view of everyone. Maybe use _hash for the alias when they are imported from libraries in the spec builder to free up these names for the spec itself?

@jtraglia

Copy link
Copy Markdown
Member Author

Could we have sha256 and blake3 names in the spec?

Yes, will do! I was very much on the fence about this 😄

@jtraglia jtraglia changed the title Define sha256_hash & blake3_hash functions Define sha256 & blake3 spec functions Aug 24, 2026
@jtraglia
jtraglia merged commit 57eba76 into ethereum:master Aug 24, 2026
18 checks passed
@jtraglia
jtraglia deleted the explicit-hash-functions branch August 24, 2026 16:12
0xsamalt added a commit to 0xsamalt/consensus-specs that referenced this pull request Aug 24, 2026
Builtin hash is no longer shadowed in the compiled spec namespace
after ethereum#5555, so the dataclass-generated hash can be used.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants