This demo showcases the implementation of EIP-7702 with Passkey authentication in a Next.js application. The application demonstrates a secure and user-friendly way to interact with blockchain using WebAuthn (Passkeys) for authentication.
The application is a demonstration of NFT minting using EIP-7702 and Passkeys, featuring:
- Passkey-based wallet creation and authentication
- EIP-7702 contract delegation
- NFT minting functionality
- Real-time transaction monitoring
- Users start by clicking the "LOGIN" button in the header
- The system generates a new EOA (Externally Owned Account)
- A WebAuthn credential (Passkey) is created for secure authentication
- The Passkey is authorized on the EOA through an EIP-7702 authorization transaction
- Users can track the process through the terminal log at the bottom of the page
- Once logged in, the user's wallet address is displayed in the header
- The address links to the blockchain explorer for transaction history
- The wallet card shows additional account information
- Authenticated users can view available NFT listings
- Single NFTs and bundles are available for minting
- Real-time minting status updates
- Success confirmation with transaction details
The account system is built around three main operations:
- Account Creation
export async function create({ client, addLog }) {
// Generate new EOA
// Create WebAuthn credential
// Authorize WebAuthn key
// Store account data
}
- Authorization
export async function authorize({
account,
client,
publicKey,
}) {
// Sign EIP-7702 authorization
// Inject ExperimentDelegation contract
// Enable WebAuthn key
}
- Transaction Execution
export async function execute({
account,
calls,
client,
addLog,
}) {
// Get nonce
// Sign transaction with WebAuthn
// Execute contract calls
}
- Secure Key Management: Uses WebAuthn for secure key generation and storage
- Smart Contract Integration: Implements EIP-7702 for contract delegation
- Transaction Handling: Supports both single and batch transactions
- Real-time Feedback: Provides transaction status and confirmation
- Error Handling: Comprehensive error management and user feedback
- Passkey-based authentication
- EIP-7702 compliant contract delegation
- Secure transaction signing
- User verification requirements
- Real-time transaction monitoring
The demo operates on a custom blockchain network with the following features:
- Block explorer: https://gelato-eip7702-demo.cloud.blockscout.com
- Smart contract verification
- Real-time transaction tracking