Skip to content

Conversation

@srivtx
Copy link

@srivtx srivtx commented Dec 29, 2025

  • Replace ethers.js with ox library for ~1000x faster RLP encoding
  • Use Address.from() instead of getAddress() for address checksumming
  • Use TransactionEnvelopeEip1559/Legacy for transaction serialization
  • Add explicit type detection for EIP-1559 vs Legacy transactions
  • Default chainId to 1 (mainnet) when not provided for EIP-1559 txs

Closes #372

Summary & Motivation

This PR addresses issue #372 by migrating the @phantom/parsers package from ethers.js to ox for EVM transaction parsing.

Why ox over ethers?

  • ~1000x faster RLP encoding performance
  • Smaller bundle size (modular, tree-shakable)
  • Actively maintained by the Viem team
  • Drop-in replacement for the two features we need (address checksumming + transaction serialization)

The public API remains unchanged - this is a purely internal implementation swap.

How I Tested These Changes

  • ✅ All 45 existing unit tests pass (yarn test)
  • ✅ Build succeeds for all 24 packages (yarn build)
  • ✅ Manually verified EIP-1559, Legacy, hex passthrough, and address checksumming cases locally

Did you add a changeset?

Not yet - I can add one if needed.

Did you update the README files?

No README updates needed - the public API is unchanged. This is an internal dependency swap only.

- Replace ethers.js with ox library for ~1000x faster RLP encoding
- Use Address.from() instead of getAddress() for address checksumming
- Use TransactionEnvelopeEip1559/Legacy for transaction serialization
- Add explicit type detection for EIP-1559 vs Legacy transactions
- Default chainId to 1 (mainnet) when not provided for EIP-1559 txs

Closes phantom#372
@srivtx srivtx requested a review from a team as a code owner December 29, 2025 15:54
@socket-security
Copy link

Review the following changes in direct dependencies. Learn more about Socket for GitHub.

Diff Package Supply Chain
Security
Vulnerability Quality Maintenance License
Addednpm/​tsx@​4.21.01001008189100

View full report

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Use Ox or Viem instead of Ethers

1 participant