Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
Free 30-min Web3 Consultation
Book Consultation
Smart Contract Security Audits
View Audit Services
Custom DeFi Protocol Development
Explore DeFi
Full-Stack Web3 dApp Development
View App Services
LABS
Guides

How to Build a Wallet-as-a-Service (WaaS) Platform

A developer guide for creating a scalable, white-label wallet infrastructure service. This tutorial covers API architecture, secure key management, tenant isolation, and monetization models.
Chainscore © 2026
introduction
DEVELOPER GUIDE

Launching a Wallet-as-a-Service (WaaS) Platform

A technical guide for developers and businesses on building a scalable Wallet-as-a-Service platform to abstract blockchain complexity for end-users.

Wallet-as-a-Service (WaaS) is an infrastructure layer that enables applications to embed non-custodial or custodial wallet functionality via APIs, removing the need for users to manage private keys directly. Unlike traditional browser extensions or mobile wallets, WaaS platforms like Coinbase Wallet as a Service or Magic handle key generation, transaction signing, and multi-chain interactions on behalf of the user's application. This model is essential for mainstream adoption, allowing developers to integrate Web3 features—such as NFT minting, gasless transactions, and social logins—with a familiar user experience. The core value proposition is abstracting cryptographic complexity while maintaining security and user sovereignty.

Architecting a WaaS platform requires decisions across several key components. First, you must choose a key management model: non-custodial (using MPC or account abstraction) or custodial. For non-custodial setups, Multi-Party Computation (MPC) libraries like ZenGo's tss-lib or services from Fireblocks or Web3Auth split private key shares between the user and the service provider. Alternatively, ERC-4337 account abstraction allows for smart contract wallets with social recovery and sponsored transactions. The backend must also manage user onboarding (via email, social, or passkeys), transaction relaying (handling gas fees), and multi-chain support through RPC providers like Alchemy or Infura.

A secure and scalable backend is critical. Core services include a Key Management Service (KMS) for secure cryptographic operations, often using HSMs or cloud KMS like AWS KMS or GCP Cloud HSM. An Identity Provider handles authentication, mapping a user's traditional login to a blockchain address. The Transaction Engine constructs, signs, and broadcasts transactions, supporting features like gas estimation and fee sponsorship. For data, you'll need a User Metadata Database (PostgreSQL) and a Blockchain Indexer (The Graph, Subsquid) to track on-chain activity. APIs should be RESTful or GraphQL, documented with tools like Swagger, and protected with rate limiting and audit logging.

For a basic non-custodial WaaS flow using MPC, the code involves generating and managing key shares. Below is a simplified Node.js example using a hypothetical SDK, demonstrating user registration and transaction signing. Note: This is illustrative; production requires a secure, audited MPC library.

javascript
// Example: User onboarding and transaction signing with MPC
import { WaaSClient } from 'waas-mpc-sdk';

const client = new WaaSClient('your-api-key');

// 1. Create a new user wallet
const user = await client.createUser({
  identifier: 'user@email.com',
  authMethod: 'EMAIL'
});
console.log(`User wallet address: ${user.walletAddress}`); // e.g., 0x...

// 2. The MPC server and user device collaboratively sign a transaction
const txPayload = {
  to: '0xRecipientAddress',
  value: '0.1', // ETH
  chainId: 1 // Ethereum Mainnet
};

// This triggers a secure MPC signing round; the private key never exists whole.
const signedTx = await client.signTransaction(user.id, txPayload);
// 3. Relay the signed transaction
const txHash = await client.relayTransaction(signedTx);

Launching successfully requires addressing critical challenges. Security is paramount; conduct regular audits (e.g., by Trail of Bits), implement multi-factor authentication for admin panels, and ensure SOC 2 Type II compliance. Scalability demands a microservices architecture with load balancers and caching (Redis) to handle peak loads. Cost management involves optimizing gas fees through bundlers for ERC-4337 or using gas station networks. Furthermore, regulatory compliance (KYC/AML in some jurisdictions) and user support for transaction issues are operational necessities. Leading platforms differentiate with features like fiat on-ramps, cross-chain swaps, and delegated signing for DAOs.

The future of WaaS is integration with broader account abstraction standards and intent-based architectures. By leveraging WaaS, developers can build applications where blockchain interactions are invisible, focusing on user experience rather than wallet management. To start, explore Web3Auth's SDK for social logins, Safe's AA stack for smart accounts, or Circle's Programmable Wallets. The goal is to make onboarding as simple as signupWithGoogle while maintaining the decentralized ethos of crypto. Begin with a prototype on a testnet, iterate based on user feedback, and prioritize security at every layer of your stack.

prerequisites
FOUNDATIONAL KNOWLEDGE

Prerequisites and Core Technologies

Before building a Wallet-as-a-Service platform, you need a solid grasp of the underlying blockchain technologies and infrastructure.

A Wallet-as-a-Service platform is a backend infrastructure that enables applications to embed non-custodial wallets for their users without managing private keys. The core prerequisite is a deep understanding of public-key cryptography and hierarchical deterministic (HD) wallets defined in BIP-32, BIP-39, and BIP-44. These standards govern how a single seed phrase generates a tree of key pairs, allowing for the creation of millions of deterministic addresses. You must be proficient in implementing these standards in your chosen programming language, typically using libraries like ethers.js, web3.js, or viem for EVM chains, or equivalent SDKs for Solana, Cosmos, or other ecosystems.

The second major prerequisite is expertise with account abstraction and smart contract wallets. Modern WaaS platforms often use smart contract accounts (like ERC-4337 on Ethereum) instead of traditional Externally Owned Accounts (EOAs). This requires knowledge of smart contract development, user operation bundling, and paymaster services for gas sponsorship. You'll need to decide on a signature scheme—whether it's traditional ECDSA, multi-signature setups, or more advanced options like Schnorr signatures or BLS signatures for aggregation, which can significantly reduce on-chain gas costs for batch transactions.

Infrastructure choices are critical. You will need to run or connect to reliable blockchain nodes (RPC providers) for each supported chain. Services like Alchemy, Infura, or QuickNode are common, but for high-volume platforms, operating your own node cluster may be necessary for reliability and cost control. Furthermore, you must design a secure key management system. While the platform is non-custodial, it often involves generating and encrypting seed phrases or private key shards. This demands a Hardware Security Module (HSM) or a cloud KMS like AWS KMS or GCP Cloud HSM to perform cryptographic operations in a trusted environment, ensuring keys are never exposed in plaintext in application memory.

Finally, a robust WaaS platform requires building several backend services: a transaction orchestrator to construct, sign, and broadcast transactions; a state synchronizer to track on-chain balances and events across all user wallets; and an indexing service for fast querying of transaction history. You must also implement rigorous security audits, rate limiting, and fraud detection mechanisms. Starting with a single chain (e.g., Ethereum Mainnet) is advisable before expanding to a multi-chain architecture, which introduces complexities like cross-chain messaging and varying fee markets.

architecture-overview
ARCHITECTURE

Launching a Wallet-as-a-Service (WaaS) Platform

A technical guide to designing the core infrastructure for a scalable, secure, and developer-friendly Wallet-as-a-Service platform.

A Wallet-as-a-Service (WaaS) platform abstracts the complexity of blockchain key management, allowing applications to embed non-custodial wallets without handling private keys directly. The core architecture is built around three pillars: a secure key management service, a unified blockchain interface, and a developer-facing API layer. This separation of concerns ensures that sensitive operations like key generation and transaction signing are isolated, while providing a simple integration path for client applications. Platforms like Magic and Dynamic popularized this model, enabling mainstream adoption by handling the underlying cryptographic complexity.

The Key Management Service (KMS) is the most critical security component. It never stores plaintext private keys. Instead, it uses Hardware Security Modules (HSMs) or cloud KMS solutions like AWS KMS or GCP Cloud HSM to generate and store encryption keys. User wallet keys are then encrypted with these master keys (a process called envelope encryption) before being stored in a secure database. For transaction signing, the KMS retrieves the ciphertext, decrypts it within the HSM's secure boundary to access the private key, signs the transaction, and returns only the signature. This ensures the private key is never exposed in memory to the application server.

A robust WaaS platform must interact with multiple blockchains. The Blockchain Abstraction Layer normalizes differences between networks like Ethereum, Solana, and Polygon. It handles chain-specific operations such as estimating gas, constructing transactions, and broadcasting them via reliable RPC providers. This layer often implements Multi-Party Computation (MPC) or Account Abstraction (ERC-4337) for enhanced security and user experience. For example, using MPC, signing authority can be distributed across multiple parties, eliminating any single point of failure for a private key.

The public-facing Developer API is what applications integrate with. It provides RESTful or GraphQL endpoints for wallet lifecycle operations: POST /v1/wallets to create a wallet, POST /v1/wallets/{id}/sign to sign a message, and GET /v1/wallets/{id}/assets to fetch balances. The API must include robust authentication using API keys, rate limiting, and detailed logging. Webhook support is essential for notifying client applications of on-chain events, such as an incoming token transfer to a user's wallet, enabling real-time updates in the application UI.

Implementing a Relayer Service is necessary for handling transaction gas fees on behalf of users, a key UX improvement. When a user initiates a transaction, the WaaS platform can sign it with the user's key and then submit it through a relayer that pays the network fee. This requires maintaining secure hot wallets with funded gas balances on each supported network and implementing anti-abuse measures like transaction spam protection. The relayer architecture also enables gasless transactions and sponsorship models, which are crucial for onboarding users unfamiliar with crypto.

Finally, operational security and compliance are foundational. This includes implementing audit trails for all key operations, using multi-signature approvals for administrative actions, and conducting regular third-party security audits. The platform must be designed for high availability across multiple regions to ensure uptime. As the ecosystem evolves, architecting for interoperability with new signing schemes (like passkeys) and blockchain standards (like ERC-7579 for modular smart accounts) will ensure the platform remains competitive and secure.

key-concepts
ARCHITECTURE

Key Technical Concepts for WaaS

Core technical components and design decisions required to build a secure, scalable Wallet-as-a-Service platform.

03

Relayer & Gas Infrastructure

A relayer is a backend service that submits user transactions to the blockchain, handling gas fees abstractly.

  • Function: It receives signed user ops (ERC-4337) or meta-transactions, pays gas in the native token, and broadcasts them.
  • Gas Management: Requires robust systems for estimating costs, sponsoring fees via paymasters, and managing a hot wallet for gas funding.
  • Scalability: Must handle high throughput, manage nonce conflicts, and provide reliable transaction status updates to users.
04

User Onboarding & Recovery Flows

Designing secure, user-friendly onboarding is critical for adoption.

  • Social Logins: Use OAuth (Google, Apple) with MPC to generate a wallet seed, removing seed phrase complexity.
  • Recovery Mechanisms: Implement social recovery (trusted guardians), multi-factor authentication, or hardware security key integration.
  • Compliance: Integrate KYC/AML providers like Sumsub or Onfido for regulated use cases, linking identity to the blockchain account without exposing private data on-chain.
ARCHITECTURE

Key Management System Comparison

Comparison of core architectures for managing user keys in a WaaS platform.

Feature / MetricMulti-Party Computation (MPC)Smart Contract WalletsHardware Security Modules (HSM)

Key Custody Model

Distributed (non-custodial)

On-chain (non-custodial)

Centralized (custodial)

Private Key Generation

Never exists as a whole

User-managed or embedded

Generated and stored in HSM

Signature Generation

Threshold signing across parties

Via smart contract logic

Within secure hardware boundary

User Recovery Options

Social recovery, backup shares

Social recovery, guardians

Administrative reset (custodial)

Typical Latency

< 1 sec

~15-45 sec (block time)

< 100 ms

Gas Fee Responsibility

Platform absorbs (off-chain)

User pays for on-chain ops

Platform absorbs

Regulatory Compliance

Easier for travel rule, KYC

Challenging for attribution

Standard for financial infra

Primary Use Case

Balanced security & UX for apps

Maximum user sovereignty

Institutional-grade custody

api-design-implementation
ARCHITECTURE

Designing the WaaS API

A well-designed API is the core of any Wallet-as-a-Service platform, defining how developers interact with your infrastructure to create and manage wallets for their users.

The primary goal of a WaaS API is to abstract the complexity of blockchain key management. Instead of developers handling seed phrases and private keys directly, your API provides secure, programmatic endpoints for operations like wallet creation, transaction signing, and balance queries. A RESTful or GraphQL architecture is standard, offering predictable resource-based URLs (e.g., /v1/wallets, /v1/wallets/{id}/transactions) and stateless operations. Each request must be authenticated, typically using API keys or JWT tokens, to enforce access control and rate limiting.

Core endpoints form the foundation. The POST /wallets endpoint generates a new wallet, returning a public address and a secure, custodial reference ID—never the private key. For transaction initiation, POST /wallets/{id}/transactions accepts a raw transaction object, signs it using your secure Hardware Security Module (HSM) or multi-party computation (MPC) system, and broadcasts it to the network. Essential read endpoints include GET /wallets/{id}/balance for asset holdings and GET /wallets/{id}/transactions for history. Supporting multiple chains like Ethereum, Solana, and Polygon from day one requires a unified interface that normalizes chain-specific differences.

Security and idempotency are non-negotiable. All mutating requests (POST, PUT, DELETE) should accept an idempotency-key header to prevent duplicate transactions from network retries. Webhooks are critical for asynchronous notifications; you must provide endpoints for developers to receive real-time alerts on events like transaction confirmations, incoming deposits, or gas price spikes. The API should return standardized error codes (e.g., INSUFFICIENT_FUNDS, NONCE_TOO_LOW) with clear, actionable messages, not generic HTTP status codes.

Consider developer experience (DX) from the start. Provide comprehensive OpenAPI/Swagger documentation, SDKs in popular languages (JavaScript, Python, Go), and a sandbox testnet environment. A well-designed WaaS API balances robust security with simplicity, enabling developers to integrate blockchain wallets in hours, not weeks, by handling the heavy lifting of key storage, signing, and node communication behind a clean interface.

tenant-isolation-security
WaaS PLATFORM DEVELOPMENT

Implementing Tenant Isolation and Security

A technical guide to architecting secure, multi-tenant wallet infrastructure for enterprises and applications.

Tenant isolation is the architectural principle that ensures data and operations for one customer (tenant) are completely segregated from all others within a shared Wallet-as-a-Service (WaaS) platform. This is non-negotiable for enterprise adoption, where regulatory compliance (like GDPR, SOC 2) and security audits demand clear data boundaries. Effective isolation prevents a bug or breach in one tenant's environment from cascading to others, protecting user funds, transaction history, and private keys. Architecturally, this spans the data layer (databases), application logic, and the blockchain interaction layer.

At the data layer, implement logical separation using unique identifiers. Never use a single global database table for all users. Instead, design schemas where a tenant_id is a foreign key on all tables (users, wallets, transactions). Enforce this at the ORM or query level. For higher security tiers, consider physical separation: dedicated database clusters or even entirely separate cloud projects per tenant, though this increases operational complexity. Access should be gated by robust authentication (JWT tokens scoped to a tenant) and authorization middleware that validates every API request against the requesting tenant's context.

Application logic must enforce tenant boundaries. A common pattern is a middleware that injects a tenant_context into every request, which subsequent services use to scope their operations. For example, a WalletService method should not just fetch a wallet by its public address; it must verify that address belongs to the authenticated tenant. All internal service calls and message queue events must carry this tenant context. Audit logs should capture the tenant_id for every action, creating an immutable trail for security monitoring and compliance reporting.

On-chain, isolation is achieved through key management architecture. Using a single smart contract wallet factory for all tenants is a critical risk. Instead, deploy a separate proxy wallet factory contract per tenant. This ensures each tenant's user wallets are logically grouped under their own immutable factory on-chain, providing a clear audit trail and preventing cross-tenant contract upgrade conflicts. Key custody solutions like MPC (Multi-Party Computation) should also be tenant-scoped, with dedicated key shares and signing nodes per tenant to eliminate any cryptographic cross-contamination.

Implement network and infrastructure isolation using cloud-native tools. Place each tenant's backend services within distinct virtual private clouds (VPCs) or Kubernetes namespaces with strict network policies. Use service meshes to manage internal communication. API gateways should route traffic based on tenant domain (e.g., tenant.yourwaas.com) or API key, applying rate limits and security policies per tenant. This containment limits the blast radius of any infrastructure compromise and aligns with the principle of least privilege at the systems level.

Security must be proactive. Integrate a tenant-aware security module that monitors for anomalous patterns within each tenant's scope, such as a sudden spike in transaction volume or funds moving to high-risk addresses. Conduct regular penetration tests that specifically attempt to bypass tenant boundaries (horizontal privilege escalation). Provide tenants with their own security dashboard and audit logs. By baking isolation into every layer—data, application, blockchain, and infrastructure—you build a WaaS platform that is secure, compliant, and scalable for demanding enterprise use cases.

IMPLEMENTATION PATTERNS

Customizable Onboarding Flow Examples

Social Login with Embedded Wallets

Social login flows allow users to create a non-custodial wallet using familiar OAuth providers like Google, X, or Discord. This pattern significantly reduces friction for mainstream users.

Key Implementation Steps:

  1. Integrate an OAuth SDK (e.g., Firebase Auth, Auth0) to handle user authentication.
  2. On successful login, use the provider's unique user ID as a seed to deterministically generate a wallet's private key using a service like Privy, Dynamic, or Magic.
  3. Securely store the encrypted key shards or recovery materials via your WaaS provider's APIs.
  4. Implement session management to allow users to seamlessly return to their wallet.

Example Use Case: A gaming DApp uses Google Sign-In. Upon first login, a new Ethereum wallet (0x...) is generated for the user, funded with gas for initial transactions, and linked to their Google account for future access.

PRICING COMPARISON

WaaS Platform Billing Models

A comparison of common billing structures for Wallet-as-a-Service platforms, detailing costs, flexibility, and target user suitability.

Billing ComponentPay-Per-TransactionMonthly SubscriptionEnterprise Custom

Pricing Model

Cost per on-chain operation

Fixed monthly fee per user/wallet

Negotiated annual contract

Transaction Fee

$0.01 - $0.10 per tx

Unlimited (within plan limits)

Volume-based discount

Wallet Creation Fee

$0.05 - $0.20 per wallet

Included

Bulk pricing available

Gas Cost Handling

User pays or platform subsidizes

Platform covers (baked into fee)

Custom allocation model

Minimum Commitment

None

100-1,000 active wallets/month

$50k+ annual spend

Best For

Startups, variable-volume apps

Predictable-scale businesses

Large institutions, white-label partners

Billing Complexity

Low (metered usage)

Medium (user management)

High (custom invoicing)

Predictable Costs

scalability-monitoring
SCALING AND MONITORING

Launching a Wallet-as-a-Service (WaaS) Platform

A technical guide to architecting, deploying, and maintaining a scalable, secure, and observable WaaS infrastructure for developers.

Launching a Wallet-as-a-Service (WaaS) platform requires a production-ready architecture designed for scale, security, and resilience. The core infrastructure typically consists of several key components: a secure key management system (KMS) like AWS KMS, HashiCorp Vault, or a multi-party computation (MPC) provider; a high-throughput Relational Database (RDBMS) such as PostgreSQL for storing user and transaction metadata; a non-custodial smart contract wallet factory (e.g., using ERC-4337 Account Abstraction); and a set of backend APIs for wallet creation, transaction signing, and blockchain interaction. This architecture must be deployed across multiple availability zones and be fronted by a load balancer to distribute traffic.

Scaling the platform involves both horizontal scaling of stateless services and careful management of stateful components. Your API servers and transaction relayers should be stateless, allowing you to add instances behind a load balancer as user demand grows. For the database, implement connection pooling (e.g., with PgBouncer) and consider read replicas to handle query load. The most critical scaling challenge is the key management layer. If using a cloud KMS, ensure you understand its request quotas and regional limits. For MPC-based solutions, the node network must be provisioned to handle signing request concurrency. Implement robust caching layers (using Redis or Memcached) for frequently accessed data like gas prices, nonces, and user session states to reduce load on primary systems.

Comprehensive monitoring and observability are non-negotiable for a financial infrastructure service. You need to instrument every layer: Application Performance Monitoring (APM) for API latency and error rates (using Datadog, New Relic, or OpenTelemetry), infrastructure monitoring for CPU, memory, and disk on your servers and database, and blockchain-specific metrics. Key blockchain metrics include average gas price, pending transaction queue depth, success/failure rates of user operations (especially for ERC-4337 bundles), and RPC endpoint health from providers like Alchemy or Infura. Set up alerts for anomalies in error rates, latency spikes, or failed blockchain transactions.

Security and operational monitoring requires dedicated tooling. Implement structured logging (e.g., JSON logs to a centralized service like Loki or Elasticsearch) for all key management and signing operations. Use a Security Information and Event Management (SIEM) system to correlate logs and detect suspicious patterns, such as rapid-fire creation of wallets from a single IP or abnormal transaction volumes. Regularly audit and test your disaster recovery procedures, including KMS key rotation, database failover, and the restoration of services from backups. Your monitoring dashboard should provide a real-time view of the system's health, security posture, and user activity.

WALLET-AS-A-SERVICE DEVELOPMENT

Frequently Asked Questions (FAQ)

Common technical questions and troubleshooting for developers building Wallet-as-a-Service (WaaS) platforms, covering key management, smart accounts, and integration challenges.

MPC (Multi-Party Computation) wallets split a single private key into multiple shares distributed across parties (client, server, backup). No single entity holds the complete key, and transactions are signed via a collaborative protocol. This is often called "keyless" architecture.

Smart Account Wallets (like ERC-4337 accounts) are smart contracts that own assets and execute logic. The signing key is a standard EOA private key or a more secure alternative, but the contract itself is the wallet. This enables features like social recovery, batched transactions, and gas sponsorship.

Key Choice: Use MPC for applications requiring traditional EOA-like addresses and seamless integration with existing dApps. Use smart accounts when you need advanced transaction logic, account abstraction benefits, and are operating primarily within a specific ecosystem like Ethereum L2s.

How to Build a Wallet-as-a-Service (WaaS) Platform | ChainScore Guides