Skip to main content

Overview

By default, the SDK creates CHIPI wallets (OpenZeppelin account with SNIP-9 session keys) or READY wallets (Argent X v0.4.0). You can also pass a custom classHash to deploy any StarkNet account that implements SNIP-9.

When to Use Custom Class Hashes

  • Your project has a custom account contract with special features (spending limits, social recovery, multisig)
  • You need a specific audited account version (e.g., CHIPI v33 with spending policy)
  • You’re building on top of an account standard not yet included in the SDK defaults

Requirements

Your custom account must:
RequirementStandardWhy
Be declared on StarkNet mainnetstarknet_getClass returns the classSDK computes the wallet address from the class hash
Implement SRC-6__validate__, __execute__Standard StarkNet account interface
Implement SNIP-9 v2execute_from_outside_v2Required for Chipi paymaster to sponsor gas
Accounts without SNIP-9 support cannot use the Chipi paymaster. Transactions will fail at estimation with TRANSACTION_EXECUTION_ERROR.

Creating a Wallet with Custom Class Hash

const wallet = await serverClient.createWallet({
  params: {
    encryptKey: "user-pin",
    externalUserId: "user-123",
    chain: "STARKNET",
    classHash: "0x0484bbd2404b3c7264bea271f7267d6d4004821ac7787a9eed7f472e79ef40d1",
  },
});
When classHash is provided:
  • The SDK uses your class hash instead of the default CHIPI or READY hash
  • The wallet address is computed from your class hash + constructor calldata
  • The Chipi paymaster sponsors the deployment (if your account supports SNIP-9)

Known Compatible Class Hashes

AccountVersionClass HashFeatures
CHIPI (default)v290x053f4f8...459f2aSession keys, passkeys, SNIP-9 v2
CHIPIv330x0484bbd...f40d1+ Spending policy, audit fixes
READY (Argent X)v0.4.00x036078...927fArgent X compatible, SNIP-9 v2

Upgrading Custom Wallets

Custom wallets can be upgraded to newer class hashes using the wallet upgrade flow:
const upgrade = await serverClient.prepareWalletUpgrade({
  publicKey: wallet.publicKey,
  targetClassHash: "0x<new-class-hash>",
});

Feature Compatibility

FeatureCHIPIREADYCustom (SNIP-9)
Gasless transactionsYesYesYes
Session keysYesNoDepends on contract
Passkey authYesNoDepends on contract
Wallet upgradeYesYesYes
x402 paymentsYesYesYes