Skip to content

Account Abstraction vs Conventional Wallets

The Staking Example: Before vs After

One of the clearest ways to understand the benefits of account abstraction is through a common DeFi operation: token staking. Let's see how the experience differs between conventional wallets and HumanWallet.

πŸ”΄ Conventional Wallet Experience

The Problem: Multiple Transactions

When using traditional wallets like MetaMask for staking, users face a cumbersome multi-step process:

Step 1: Token Approval
  1. User clicks "Approve" in the dApp
  2. MetaMask popup appears requesting signature
  3. User pays gas fee (e.g., $5-15 depending on network congestion)
  4. Wait 15-60 seconds for transaction confirmation
  5. Transaction succeeds or fails
Step 2: Actual Staking
  1. User clicks "Stake" in the dApp
  2. Another MetaMask popup appears
  3. User pays another gas fee (e.g., $10-25)
  4. Wait another 15-60 seconds for confirmation
  5. Staking finally completes

🟒 HumanWallet Account Abstraction Experience

The Solution: Batch Operations + Gasless Transactions

With HumanWallet's account abstraction, the same staking operation becomes seamless:

Single Action: Smart Staking
  1. User clicks "Stake" in the dApp
  2. Biometric authentication (FaceID/TouchID) - 2 seconds
  3. Smart contract automatically batches approval + staking
  4. Paymaster sponsors all gas fees
  5. Single user operation executes both actions
  6. Staking completes in 5-10 seconds

πŸ› οΈ Technical Implementation

How Batch Operations Work

// Conventional approach (2 separate transactions)
const approvalTx = await tokenContract.approve(stakingContract, amount)
await approvalTx.wait()
 
const stakingTx = await stakingContract.stake(amount)
await stakingTx.wait()
 
// HumanWallet approach (1 batched operation)
const batchOperation = await humanWallet.writeContracts([
  {
    address: tokenContract.address,
    abi: tokenABI,
    functionName: "approve",
    args: [stakingContract.address, amount],
  },
  {
    address: stakingContract.address,
    abi: stakingABI,
    functionName: "stake",
    args: [amount],
  },
])

ERC-4337 Account Abstraction Standards

HumanWallet leverages multiple standards to enable this experience:

  • ERC-4337: Account abstraction standard for smart contract wallets
  • ERC-7212: Precompile for secp256r1 curve (WebAuthn) signature verification
  • WebAuthn: W3C standard for biometric authentication
  • Safe: Battle-tested smart contract wallet infrastructure

πŸ“Š Real-World Impact

User Adoption Metrics

Projects using HumanWallet report significant improvements:

  • 3x higher conversion rates for first-time users
  • 67% reduction in support tickets related to transaction failures
  • 85% of users prefer biometric signing over seed phrases
  • 90% reduction in user-facing gas costs

Developer Benefits

  • Simplified dApp logic: No need to handle two-step approval flows
  • Better error handling: Atomic operations mean clearer failure states
  • Improved analytics: Single operation = cleaner user journey tracking
  • Higher user satisfaction: Smoother experience leads to better retention

🎯 More Batch Operation Examples

DeFi Swapping

Conventional: Approve β†’ Swap (2 transactions) HumanWallet: Single batched swap operation

NFT Marketplace

Conventional: Approve β†’ List NFT (2 transactions) HumanWallet: Single batched listing operation

Yield Farming

Conventional: Approve β†’ Deposit β†’ Stake (3 transactions!) HumanWallet: Single batched farming operation

Governance Participation

Conventional: Approve β†’ Delegate β†’ Vote (3 transactions!) HumanWallet: Single batched governance operation

πŸš€ Getting Started with Batched Operations

Basic Implementation

import { ClientRepository } from "@humanwallet/sdk"
 
const client = new ClientRepository(bundlerRpc, paymasterRpc, passkeyUrl, chain)
 
// Batch multiple operations
const result = await client.writeContracts([
  // Operation 1: Token approval
  {
    address: tokenAddress,
    abi: tokenABI,
    functionName: "approve",
    args: [spenderAddress, amount],
  },
  // Operation 2: Main action
  {
    address: contractAddress,
    abi: contractABI,
    functionName: "stake",
    args: [amount],
  },
])
 
// Wait for completion
const receipt = await client.waitForUserOperation(result)

Advanced Patterns

// Complex DeFi operation: Approve β†’ Swap β†’ Stake rewards
const complexOperation = await client.writeContracts([
  // 1. Approve token A for swapping
  {
    address: tokenA,
    abi: erc20ABI,
    functionName: "approve",
    args: [dexContract, swapAmount],
  },
  // 2. Swap token A for token B
  {
    address: dexContract,
    abi: dexABI,
    functionName: "swapExactTokensForTokens",
    args: [swapAmount, minAmountOut, [tokenA, tokenB], userAddress, deadline],
  },
  // 3. Approve token B for staking
  {
    address: tokenB,
    abi: erc20ABI,
    functionName: "approve",
    args: [stakingContract, stakeAmount],
  },
  // 4. Stake token B
  {
    address: stakingContract,
    abi: stakingABI,
    functionName: "stake",
    args: [stakeAmount],
  },
])

πŸ’‘ Best Practices

When to Use Batch Operations

βœ… Great for batching:

  • Token approval + main action
  • Multiple related contract calls
  • Setting up complex positions
  • Governance workflows

❌ Not ideal for batching:

  • Unrelated operations
  • Operations that might fail independently
  • Time-sensitive sequences

Error Handling

try {
  const batchResult = await client.writeContracts(operations)
  const receipt = await client.waitForUserOperation(batchResult)
 
  if (receipt.success) {
    console.log("All operations completed successfully!")
  } else {
    console.log("Batch operation failed - all operations reverted")
  }
} catch (error) {
  console.error("Failed to submit batch operation:", error)
}

🌟 The Future of Web3 UX

Account abstraction represents a fundamental shift in how users interact with blockchain applications. By eliminating gas fees, reducing transaction counts, and enabling biometric authentication, HumanWallet makes Web3 feel like Web2.

Ready to transform your dApp's user experience?
Try the DemoIntegration GuideSDK Documentation

Account abstraction isn't just a technical improvementβ€”it's the key to mainstream Web3 adoption. πŸš€