Skip to content

Conversation

@matthiasmatt
Copy link
Contributor

@matthiasmatt matthiasmatt commented Nov 18, 2025

This pull request introduces a new passkey-based ERC-4337 account abstraction flow for Nibiru EVM end-to-end tests, including new smart contracts, a TypeScript SDK for passkey operations, and updated documentation and tooling. It adds a minimal ERC-4337 account contract secured by P-256 signatures, a factory for deploying such accounts, and a Hardhat/TypeScript SDK for testing and interacting with the flow. The documentation is expanded to guide users through setup, deployment, and testing. Several dependency and configuration changes ensure compatibility and smooth development.

ERC-4337 Passkey Account Implementation:

  • Added PasskeyAccount and PasskeyAccountFactory contracts implementing a minimal ERC-4337 account abstraction secured by P-256 public keys and signatures, with a factory for deploying minimal-proxy clones. (evm-e2e/contracts/passkey/PasskeyAccount.sol)
  • Introduced a thin wrapper contract EntryPointV06 tagging the EntryPoint implementation with a version string for bundler compatibility. (evm-e2e/contracts/passkey/EntryPointV06.sol)
  • Defined supporting types and interfaces for ERC-4337 user operations and entry point interaction. (evm-e2e/contracts/passkey/UserOperation.sol, evm-e2e/contracts/passkey/interfaces/IEntryPoint.sol) [1] [2]

Passkey SDK Addition:

  • Added a new passkey-sdk package with TypeScript code for passkey-based user operation construction, bundler interaction, and utilities, including scripts for local bundler operation and E2E tests. (evm-e2e/passkey-sdk/package.json, evm-e2e/passkey-sdk/src/bundler.ts, evm-e2e/passkey-sdk/src/index.ts) [1] [2] [3]

Documentation and Developer Tooling:

  • Expanded README.md with detailed instructions for installing dependencies, deploying the passkey account factory, running a bundler, and executing E2E tests for the passkey ERC-4337 flow. (evm-e2e/README.md) [1] [2]
  • Updated scripts (justfile, package.json) and addresses for new contracts (.entrypoint.addr, .passkeyfactory.addr). [1] [2] [3] [4]

Build and Dependency Configuration:

  • Migrated Hardhat config to TypeScript and enabled optimizer. (evm-e2e/hardhat.config.ts, evm-e2e/hardhat.config.js) [1] [2]
  • Updated dependencies to use @account-abstraction/contracts@0.6.0 and reverted @openzeppelin/contracts to 4.9.6 for compatibility. (evm-e2e/package.json, evm-e2e/package-lock.json) [1] [2] [3] [4] [5]

Addresses and Scripts:

  • Added deployment addresses for the new EntryPoint and PasskeyAccountFactory contracts. (evm-e2e/.entrypoint.addr, evm-e2e/.passkeyfactory.addr) [1] [2]
  • Added a script for starting a bundler via npm. (evm-e2e/package.json)

These changes collectively enable end-to-end testing and development of passkey-secured ERC-4337 accounts on Nibiru EVM, with a modern SDK and streamlined developer experience.

@matthiasmatt matthiasmatt requested a review from a team as a code owner November 18, 2025 16:19
Copy link

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces a comprehensive passkey signing system for the Nibiru EVM, including smart contracts, a TypeScript SDK, and deployment tooling. The changes are well-structured and cover a lot of ground. My review focuses on several areas for improvement:

  • Gas Efficiency: The evm-e2e PasskeyAccountFactory contract should use the clone pattern for significant gas savings, similar to its evm-forge counterpart.
  • SDK Portability & Performance: The TypeScript SDK can be improved by removing Node.js-specific dependencies for better browser support and by optimizing resource usage in the bundler interaction logic.
  • Code Clarity & Robustness: Some of the scripts and SDK code can be made more maintainable and robust with minor refactoring and by adding cleanup logic.

@codecov
Copy link

codecov bot commented Nov 18, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 59.26%. Comparing base (f6f0bcd) to head (6a8340e).

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2443      +/-   ##
==========================================
+ Coverage   59.21%   59.26%   +0.04%     
==========================================
  Files         359      360       +1     
  Lines       24254    24281      +27     
==========================================
+ Hits        14362    14389      +27     
  Misses       8660     8660              
  Partials     1232     1232              
Files with missing lines Coverage Δ
x/evm/const.go 41.66% <ø> (ø)
x/evm/precompile/p256.go 100.00% <100.00%> (ø)
x/evm/precompile/precompile.go 70.31% <100.00%> (+0.47%) ⬆️
🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@matthiasmatt matthiasmatt changed the title feat: add passkey signing feat: ERC-4337-compatible passkey (P-256) account system for the Nibiru EVM Nov 20, 2025
@matthiasmatt matthiasmatt changed the title feat: ERC-4337-compatible passkey (P-256) account system for the Nibiru EVM feat: ERC-4337-compatible passkey (P-256) account system Nov 20, 2025
@matthiasmatt matthiasmatt enabled auto-merge (squash) November 20, 2025 19:15
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.

2 participants