Skip to content

Create Wallet Guide

Enable new users to create secure HumanWallet accounts with passkey authentication

👤 New Users🔐 Passkey Creation⚡ Instant Setup

This guide shows how to implement wallet creation functionality for new users who want to create a HumanWallet account using secure passkey authentication.

Overview

HumanWallet creation allows new users to generate a secure wallet account using WebAuthn passkeys. This process eliminates traditional password requirements while providing enterprise-grade security through biometric authentication.

Seamless Integration with Existing Wagmi Code

If you already have wallet connection implemented with Wagmi, adding wallet creation is trivial:

  • Same useConnect hook: Just add a forceCreate parameter
  • Same error handling: All your existing error states work
  • Same UI patterns: Reuse your connection components
  • Same state management: Works with your current loading states

Key Features

  • Passkey Registration: Creates secure WebAuthn credentials during wallet setup
  • Instant Access: Immediate wallet availability after creation
  • No Seed Phrases: Eliminates the need for users to manage complex seed phrases
  • Biometric Security: Uses device biometrics or security keys for authentication

Core Hook Usage

Basic Wallet Creation Hook

The foundation of wallet creation uses the extended useConnect hook with force creation:

hooks/useWalletCreation.ts
import { useConnect } from "wagmi"
import type { Connector } from "wagmi"
 
export function useWalletCreation() {
  const { connectors, connect, isPending, error } = useConnect()
 
  const createNewWallet = (connector: Connector) => {
    // Extended connect function with forceCreate parameter
    ;(connect as (args: { connector: Connector; forceCreate?: boolean }) => void)({
      connector,
      forceCreate: true,
    })
  }
 
  const getHumanWalletConnector = () => {
    return connectors.find((connector) => connector.name === "HumanWallet")
  }
 
  return {
    connectors,
    createNewWallet,
    getHumanWalletConnector,
    isPending,
    error,
  }
}

Continue Learning