Skip to content

Add EIP-55 checksum support and validation utilities for EVM addresses#2233

Draft
iron-prog wants to merge 3 commits into
hiero-ledger:mainfrom
iron-prog:feature/evm-checksum-support
Draft

Add EIP-55 checksum support and validation utilities for EVM addresses#2233
iron-prog wants to merge 3 commits into
hiero-ledger:mainfrom
iron-prog:feature/evm-checksum-support

Conversation

@iron-prog
Copy link
Copy Markdown

@iron-prog iron-prog commented May 5, 2026

Description:

Add EIP-55 checksum support and validation utilities for EVM addresses to improve correctness and developer experience.

  • Add EvmAddress.to_checksum_address() to generate EIP-55 compliant addresses
  • Add EvmAddress.is_valid() for hex address format validation
  • Add EvmAddress.is_checksum_valid() for checksum verification
  • Add EvmAddress.normalize() for canonical lowercase representation
  • Add comprehensive unit tests for valid, invalid, and edge cases

Related issue(s):

Fixes: #2234

Notes for reviewer:

Notes for reviewer:

  • Follows the EIP-55 checksum address format reference implementation
  • Handles mixed-case inputs safely by normalizing before hashing
  • No changes to existing behavior; feature is additive
  • Unit tests pass locally (focused on EvmAddress and full tests/unit suite)

Checklist

  • Documented (Code comments, README, etc.)
  • Tested (unit, integration, etc.)

@iron-prog iron-prog requested review from a team as code owners May 5, 2026 15:44
@codacy-production
Copy link
Copy Markdown

codacy-production Bot commented May 5, 2026

Up to standards ✅

🟢 Issues 0 issues

Results:
0 new issues

View in Codacy

NEW Get contextual insights on your PRs based on Codacy's metrics, along with PR and Jira context, without leaving GitHub. Enable AI reviewer
TIP This summary will be updated as you push new changes.

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented May 5, 2026

Review Change Stack

Walkthrough

Adds EIP-55 checksum generation and verification to EvmAddress, plus normalization and validation helpers (normalize, is_valid, is_checksum_valid) and unit tests; imports keccak256 and implements to_checksum_address() to produce 0x-prefixed checksummed addresses.

Changes

EIP-55 Checksum Validation for EvmAddress

Layer / File(s) Summary
Dependencies
src/hiero_sdk_python/crypto/evm_address.py
keccak256 import added to enable EIP-55 checksum computation.
Checksum generation
src/hiero_sdk_python/crypto/evm_address.py
to_checksum_address() added: lowercases 40-char hex, computes keccak hash, applies EIP-55 casing rules, returns 0x-prefixed checksummed address.
Normalization
src/hiero_sdk_python/crypto/evm_address.py
normalize(address: str) strips optional 0x, lowercases and validates 40 hex chars; returns 40-char lowercase hex (no 0x).
Basic Validation
src/hiero_sdk_python/crypto/evm_address.py
is_valid(address: str) rejects non-strings and otherwise returns boolean for optional-0x 40-hex format.
Checksum Verification
src/hiero_sdk_python/crypto/evm_address.py
is_checksum_valid(address: str) requires 0x prefix, validates raw hex, recomputes checksum via from_string(raw).to_checksum_address(), and compares to input.
Tests
tests/unit/evm_address_test.py
Adds tests for checksum formatting (EIP-55 reference, lowercase and mixed-case stability), invalid-length and non-hex inputs, checksum validity true/false cases, embedded-0x malformed rejection, and normalize() behavior.

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately and concisely summarizes the main change: adding EIP-55 checksum support and validation utilities for EVM addresses, which directly matches the changeset.
Description check ✅ Passed The description clearly explains the EIP-55 checksum support addition with detailed bullet points of all four new methods and comprehensive unit tests, all directly related to the changeset.
Linked Issues check ✅ Passed All coding requirements from issue #2234 are met: checksum generation via to_checksum_address(), address validation via is_valid(), checksum verification via is_checksum_valid(), and normalization via normalize().
Out of Scope Changes check ✅ Passed All changes are within scope: four new methods added to EvmAddress with corresponding comprehensive unit tests, with no modifications to existing behavior or unrelated features.
Docstring Coverage ✅ Passed Docstring coverage is 91.30% which is sufficient. The required threshold is 80.00%.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

Tip

💬 Introducing Slack Agent: The best way for teams to turn conversations into code.

Slack Agent is built on CodeRabbit's deep understanding of your code, so your team can collaborate across the entire SDLC without losing context.

  • Generate code and open pull requests
  • Plan features and break down work
  • Investigate incidents and troubleshoot customer tickets together
  • Automate recurring tasks and respond to alerts with triggers
  • Summarize progress and report instantly

Built for teams:

  • Shared memory across your entire org—no repeating context
  • Per-thread sandboxes to safely plan and execute work
  • Governance built-in—scoped access, auditability, and budget controls

One agent for your entire SDLC. Right inside Slack.

👉 Get started


Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 1df5ce9b-8a4d-4fc6-a6e8-fcb6fef6ba15

📥 Commits

Reviewing files that changed from the base of the PR and between 79b34a7 and e242f73.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/crypto/evm_address.py
  • tests/unit/evm_address_test.py

Comment thread src/hiero_sdk_python/crypto/evm_address.py Outdated
Comment thread tests/unit/evm_address_test.py Outdated
@iron-prog iron-prog force-pushed the feature/evm-checksum-support branch 3 times, most recently from f4bfb95 to 5469ffd Compare May 5, 2026 16:23
@aceppaluni
Copy link
Copy Markdown
Contributor

@iron-prog Can you link the issue you are trying to solve with this PR? This can be done within the description. Tapping edit allows you to add an issue. Format should be "Fixes: #Issue_Number

Thank you

@iron-prog
Copy link
Copy Markdown
Author

iron-prog commented May 5, 2026

Created and linked issue #2234 for this feature

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 6, 2026

Hello, this is the OfficeHourBot.

This is a reminder that the Hiero Python SDK Office Hours are scheduled in approximately 4 hours (14:00 UTC).

This session provides an opportunity to ask questions regarding this Pull Request.

Details:

Disclaimer: This is an automated reminder. Please verify the schedule here for any changes.

From,
The Python SDK Team

@exploreriii exploreriii added step: 1st 1st stage of the review approval process reviewer: community pull requests looking for community reviews labels May 6, 2026
@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 7, 2026

Hi there! I'm the LinkedIssueBot.
This pull request has been automatically closed due to the following reason(s):

Thank you,
From Python SDK team

@github-actions github-actions Bot closed this May 7, 2026
@Akshat8510 Akshat8510 reopened this May 7, 2026
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 4


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 2606c85a-2e05-4342-8766-4acbfcd5a5c8

📥 Commits

Reviewing files that changed from the base of the PR and between e242f73 and 3709a28.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/crypto/evm_address.py
  • tests/unit/evm_address_test.py

Comment thread src/hiero_sdk_python/crypto/evm_address.py Outdated
Comment thread src/hiero_sdk_python/crypto/evm_address.py Outdated
Comment thread tests/unit/evm_address_test.py Outdated
Comment thread tests/unit/evm_address_test.py
@iron-prog iron-prog force-pushed the feature/evm-checksum-support branch from 3709a28 to 49f6a3e Compare May 7, 2026 12:03
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 2


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 0534818d-b981-4cdd-abb8-ea8557926269

📥 Commits

Reviewing files that changed from the base of the PR and between 3709a28 and 49f6a3e.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/crypto/evm_address.py
  • tests/unit/evm_address_test.py

Comment thread tests/unit/evm_address_test.py
Comment thread tests/unit/evm_address_test.py
@iron-prog iron-prog force-pushed the feature/evm-checksum-support branch from 6ee8922 to c074dbc Compare May 7, 2026 12:13
Copy link
Copy Markdown

@chaitanyamedidar chaitanyamedidar May 7, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hey @iron-prog , implementation looks good. One small non blocking polish item I'd suggest is few of the newly added unit tests still do not have docstrings, while the surrounding evm_address_test.py tests generally do. Since the contributor testing guide asks for clear test names plus brief docstrings, it may be worth adding one line docstrings to the new validation/normalization tests before merge for consistency.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion I've update the all test cases with valid doctoring

Signed-off-by: iron-prog <dt915725@gmail.com>
@iron-prog iron-prog force-pushed the feature/evm-checksum-support branch from 59dbe85 to 628b0cf Compare May 8, 2026 02:05
Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1


ℹ️ Review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: ASSERTIVE

Plan: Pro

Run ID: 94d3a6df-5277-40db-971e-f766997b6192

📥 Commits

Reviewing files that changed from the base of the PR and between 49f6a3e and 628b0cf.

📒 Files selected for processing (2)
  • src/hiero_sdk_python/crypto/evm_address.py
  • tests/unit/evm_address_test.py

Comment thread tests/unit/evm_address_test.py
@github-actions github-actions Bot added the queue:junior-committer PR awaiting initial quality review label May 8, 2026
@exploreriii exploreriii removed step: 1st 1st stage of the review approval process reviewer: community pull requests looking for community reviews labels May 8, 2026
@github-actions github-actions Bot added the open to community review PR is open for community review and feedback label May 9, 2026
@manishdait
Copy link
Copy Markdown
Contributor

@iron-prog, Thanks for the PR moving this to draft, unless the proposal get merge in the sdk-collaboration-hub.

@manishdait manishdait marked this pull request as draft May 13, 2026 10:55
@exploreriii exploreriii added the dev: blocked developer unable to proceed label May 13, 2026
@github-actions
Copy link
Copy Markdown

Hi @iron-prog,

This pull request has had no commit activity for 10 days. Are you still working on it?
To keep the PR active, you can:

  • Push a new commit.
  • Comment /working on the linked issue (not this PR).

If you're no longer working on this, please comment /unassign on the linked issue to release it for others. Otherwise, this PR may be closed due to inactivity.

Reach out on discord or join our office hours if you need assistance.

From the Python SDK Team

@iron-prog
Copy link
Copy Markdown
Author

I am currently busy in ongoing final university exams. Please feel free to leave architectural reviews on this (hiero-ledger/sdk-collaboration-hub#256) the meantime. I will address all feedback and proceed with the implementation right after my exams are over. Thanks!"

@exploreriii exploreriii added status: discussion a new proposed feature that should be discussed before proceeding and removed queue:junior-committer PR awaiting initial quality review open to community review PR is open for community review and feedback labels May 18, 2026
@iron-prog
Copy link
Copy Markdown
Author

@manishdait @chaitanyamedidar my exams are over now I'm back on this , since i did recieve any architechral feedback on the proposal , so I wanted to gently ping the maintainers to see if there are any initial thoughts, concerns, or changes required for the design.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

dev: blocked developer unable to proceed status: discussion a new proposed feature that should be discussed before proceeding

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add EIP-55 checksum support and validation for EVM addresses

6 participants