
Overview
Starkzap supports multiple ways to connect wallets, each suited for different use cases and security requirements. This guide covers all available connection methods.New to wallets? A wallet is like a bank account on the blockchain—it has an address (like an account number) and uses a signer (like authentication) to authorize transactions. A signer is what proves you own the wallet, similar to how OAuth tokens prove you’re logged in. See the Glossary for more details.
Connection Methods Comparison
Choose the right method for your use case:| Method | Best For | User Experience | Gas Fees | Setup Complexity |
|---|---|---|---|---|
| Private Key | Server-side apps, development | Manual key entry | ⚠️ User pays (or configure AVNU Paymaster) | ⭐ Simple |
| Privy | Consumer apps, mobile/web | Email/social login | ⚠️ User pays (or configure AVNU Paymaster) | ⭐⭐ Moderate |
| Cartridge | Gaming applications | Social login, Face ID/Touch ID | ✅ Automatic - Cartridge pays | ⭐⭐ Moderate |
Quick Decision Guide
- Building a game? → Use Cartridge (includes automatic gasless transactions)
- Building a consumer app? → Use Privy (email/social login, configure AVNU Paymaster for gasless)
- Building a server-side service? → Use Private Key (with proper security, configure AVNU Paymaster for gasless)
- Need automatic gasless transactions? → Use Cartridge (built-in paymaster)
- Need email-based auth? → Use Privy
- Just testing? → Use Private Key for quick setup
Connection Methods
1. Local Private Key (StarkSigner)
The simplest approach — sign transactions locally using a private key (like storing a password locally). Best for:- Server-side applications
- Trusted environments
- Development and testing
A private key is like a password—it proves you own the wallet. Unlike a password, you should never expose it in client-side code. Only use this method on secure servers or for development.For gasless transactions: Configure AVNU Paymaster separately to sponsor transaction fees.
2. Privy Signer (Server-Side Key Management)
Privy manages private keys securely on their infrastructure (like how OAuth providers manage authentication). The signing happens through your backend. Best for:- Consumer applications
- Mobile and web apps
- Applications requiring secure key management
Think of Privy like OAuth for wallets—they manage the keys (like Google manages your login), and you just call their API to sign transactions (like calling Google’s API to verify a token).For gasless transactions: Configure AVNU Paymaster separately to sponsor transaction fees.
For detailed Privy integration instructions, see the Privy Integration Guide.
{ walletId, hash } and must return { signature }.
Option B: Custom signing function (for server-side Node.js)
3. Cartridge Controller
Cartridge is specialized for gaming applications and provides social login and passkey authentication. Opens a popup for user authentication. Best for:- Gaming applications
- Social login integration
- Passkey-based authentication
- Apps that want automatic gasless transactions
Key Advantage: Cartridge includes a built-in paymaster that automatically sponsors (pays for) all transactions, so users never pay gas fees. This is perfect for gaming where you want seamless, gasless transactions. For detailed integration instructions, see the Cartridge Controller Integration Guide.
4. Custom Signer
ImplementSignerInterface to integrate any key management solution (hardware wallets, MPC, HSMs, etc.):
Account Presets
Account presets define what type of wallet account to create. Think of it like choosing between “Personal” vs “Business” account types—different presets have different features and security models.An account preset is like selecting a user role or account type. Each preset (OpenZeppelin, Argent, Braavos) has different capabilities, just like how different user roles have different permissions in your app.
Built-in Presets
Custom Account Class
Wallet Lifecycle
Deployment
Starknet accounts are smart contracts that need to be “deployed” (created on the blockchain) before they can execute transactions. Think of it like creating a new user account in your database—it needs to exist before you can use it.Deployment is like provisioning a new service or creating a new account. The SDK handles this automatically, but you can control when it happens with the
deploy option.For sponsored wallets,
execute() automatically deploys the account in the same transaction if needed — no separate deploy step required.Ensure Ready
A convenience method that checks deployment and optionally deploys:Deployment Policy Options
"never"- Fail if account is undeployed"if_needed"- Deploy undeployed accounts automatically"always"- Force deployment flow even if already deployed
Using the Onboarding API
The onboarding API simplifies wallet connection by handling strategy selection, signer construction, and account readiness:Production Guidance
- Prefer signer separation by trust boundary:
- Server-only keys on backend
- Privy for managed end-user keys
- Cartridge for delegated UX
- Always call
ensureReady()before user actions - Use appropriate account presets for your use case
- Handle deployment errors gracefully in production
Next Steps
- Learn about Executing Transactions
- Explore ERC20 Token Operations
- Set up Staking & Delegation