You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
perf (optional): skip Keccak for uniform-case EVM input when not in strict mode #9
For all-lowercase or all-uppercase addresses with strict off, the hash only serves details.checksum, which is almost always false for such input. Computing it lazily, or documenting that checksum means "is valid EIP-55", would roughly double throughput again for lowercase input flows. It changes the meaning of the details field, so the maintainer should decide.
Outside strict mode, uniform-case EVM input is no longer hashed; details.checksum is true only for a verified mixed-case checksum or an address with no hex letters (commit 398961d). Strict mode still verifies against EIP-55. Lowercase EVM validation goes from ~4.4k to ~1M ops/s.
@Dhananjay-alt, thanks for the benchmark and the EIP-55 coverage. Please open a new PR against the latest main for this change. I’m closing #10 because its default EVM validator accepts a malformed address.
On commit aeb8e3e, an input beginning with two consecutive 0x prefixes followed by 38 digits passes validation and reports checksum: true. Detection also lists the EVM chains. The same input is rejected on main. The first length check succeeds because it counts the second prefix, and the hex helper strips that prefix again.
Please check for exactly 40 hex digits after removing one optional prefix, before the checksum fast path. The replacement should reject this input through both validation and detection while preserving valid addresses with or without a prefix. Please run the full check and coverage suites against the updated main.
There’s a concrete compatibility cost here. On main, the lowercase EIP-55 vector 0xde709f2102306220921060314715629080e2fb77 returns details.checksum === true even with strict mode off. Treating uniform-case addresses as unchecked would change a value callers can observe.
I’d prioritize the hash implementation in #1 and defer this shortcut. Any separate fast-path proposal should preserve the checksum result for that vector and pass the repeated-prefix regression tests in #11.
Activity
perf: skip Keccak for uniform-case EVM input outside strict mode
perf: single-pass Bech32 checksum, leaner SHA-256, Byron precheck
Dhananjay-alt commentedon Nov 21, 2026
Fixed in #10.
Outside strict mode, uniform-case EVM input is no longer hashed; details.checksum is true only for a verified mixed-case checksum or an address with no hex letters (commit 398961d). Strict mode still verifies against EIP-55. Lowercase EVM validation goes from ~4.4k to ~1M ops/s.
Samarth208P commentedon Nov 21, 2026
@Dhananjay-alt, thanks for the benchmark and the EIP-55 coverage. Please open a new PR against the latest main for this change. I’m closing #10 because its default EVM validator accepts a malformed address.
On commit aeb8e3e, an input beginning with two consecutive
0xprefixes followed by 38 digits passes validation and reportschecksum: true. Detection also lists the EVM chains. The same input is rejected on main. The first length check succeeds because it counts the second prefix, and the hex helper strips that prefix again.Please check for exactly 40 hex digits after removing one optional prefix, before the checksum fast path. The replacement should reject this input through both validation and detection while preserving valid addresses with or without a prefix. Please run the full check and coverage suites against the updated main.
Samarth208P commentedon Nov 21, 2026
There’s a concrete compatibility cost here. On
main, the lowercase EIP-55 vector0xde709f2102306220921060314715629080e2fb77returnsdetails.checksum === trueeven with strict mode off. Treating uniform-case addresses as unchecked would change a value callers can observe.I’d prioritize the hash implementation in #1 and defer this shortcut. Any separate fast-path proposal should preserve the checksum result for that vector and pass the repeated-prefix regression tests in #11.