Skip to content

A Passkey-based ERC-4337 Smart Account implementation with Session Keys for a seamless user experience.

Notifications You must be signed in to change notification settings

SaiKiranMatta/passkey-smart-wallet

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

75 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Project Setup Guide

Prerequisites

Ensure you have the following installed on your system before proceeding:

  • Node.js (v16 or later)
  • npm
  • Go (v1.19 or later)
  • Foundry (for smart contract development)
  • Anvil (local Ethereum node)

Environment Variables

Backend (.env)

# Database Configuration
DB_URL="<your-database-connection-string>"
# Server Configuration
SERVER_PORT=<port-number>
# Chain Configuration
CHAIN_RPC="<your-rpc-url>"
ENTRYPOINT_ADDRESS="<your-entrypoint-contract-address>"
BUNDLER_PRIVATE_KEY="<your-bundler-private-key>"
PAYMASTER_ADDRESS="<your-paymaster-contract-address>"
CHAIN_ID=<your-chain-id>

Frontend (.env)

NEXT_PUBLIC_BACKEND_URL="<your-backend-url>"
NEXT_PUBLIC_ENTRYPOINT_ADDRESS="<your-entrypoint-contract-address>"
NEXT_PUBLIC_CHAIN_ID=<your-chain-id>
NEXT_PUBLIC_FACTORY_ADDRESS="<your-factory-contract-address>"
NEXT_PUBLIC_PAYMASTER_ADDRESS="<your-paymaster-contract-address>"

Smart Contracts (.env)

PRIVATE_KEY="<your-private-key>"

Installation and Setup

Frontend

The frontend is written in Next.js. To set it up:

  1. Navigate to the frontend directory:

    cd frontend
  2. Install dependencies:

    npm install
  3. Create a .env file in the frontend directory and add the environment variables listed above.

  4. Run the development server:

    npm run dev
  5. Open your browser and navigate to http://localhost:3000.

Smart Contracts

To deploy and interact with the smart contracts:

  1. Create a .env file in the root directory and add the environment variables listed above.

  2. Start a local Anvil instance:

    anvil
  3. Deploy the contracts using the provided script:

    ./deploy.sh

Alternatively, you can deploy manually using the following commands:

source .env
forge script script/SmartAccountFactory.s.sol:DeploySmartAccount --rpc-url http://localhost:8545 --broadcast

Backend

The backend is written in Go. Follow these steps to set it up:

  1. Navigate to the backend directory:

    cd backend
  2. Install dependencies:

    go mod tidy
  3. Create a .env file in the backend directory and add the environment variables listed above.

  4. Run the backend server:

    go run cmd/main.go

About

A Passkey-based ERC-4337 Smart Account implementation with Session Keys for a seamless user experience.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published