This codebase demonstrates how to use Passkeys with MEE stack
Note:
The MEE version 3.0.0 adds support for Passkeys P256 authentication, enabling you to use passkeys for secure smart account access with the MEE stack.
However, this version is powered by unaudited smart contracts and is marked experimental: while the feature is fully developed and tested, use it with caution in production environments.
This project uses Bun as its package manager. Make sure you have Bun installed.
bun installRun the code using Bun:
bun index.ts-
Setup:
The script demonstrates how to use Passkeys (P256) authentication to interact with the MEE stack using experimental MEE v3.0.0.
It initializes a Multichain Nexus Smart Account configured for two testnets:- Base Sepolia
- Optimism Sepolia
-
Key Steps:
- Signer Initialization:
Generates a P-256 signer from a sample private key (replace with secure key for real use). - Account & Client Creation:
Creates a multichain smart account and configures the MEE client (with gas sponsorship). - Transfer Instructions:
Builds two sample instructions to transfer testnet USDC tokens on each network. - Simulate and Quote:
Simulates the instructions and fetches a sponsored execution quote, including gas estimates. - Execution:
Executes the quoted multi-chain transaction and waits for confirmation. - Result:
Outputs a meeScan explorer link to view the transaction details.
- Signer Initialization:
- The Passkeys integration and v3.0.0 contract set are experimental and unaudited. Test thoroughly before integrating into production!
- Always replace the example private key with a secure, user-controlled passkey in real deployments.