Skip to main content
MoonKey provides wallet infrastructure that empowers users to transact on Ethereum, Solana, and all EVM- and SVM-compatible blockchains. Create self-custodial embedded wallets for your users that are directly integrated into your application—no browser extensions or separate wallet apps required. These embedded wallets can be automatically created during user authentication or manually created when needed, giving you complete flexibility in how you onboard users to web3. Users maintain full custody of their wallets without needing to manage seed phrases or private keys, though they can export their keys at any time for maximum portability.
MoonKey embedded wallets use distributed key sharding to ensure only the rightful owner can control their wallet or access its keys. Neither MoonKey nor your application ever sees the user’s complete private key.

Embedded wallets

MoonKey’s embedded wallet system lets you build self-custodial wallets directly into your app. Users get a seamless blockchain experience without the technical complexity of traditional wallet management.

How it works

When a user authenticates with your app, MoonKey can automatically create an embedded wallet for them based on your configuration. The wallet’s private key is securely sharded across multiple locations using distributed key management, ensuring that:
  • Users maintain full custody - Only the user can access their complete private key
  • No seed phrase management - Users don’t need to write down or remember recovery phrases
  • Seamless experience - Wallets work instantly without any setup
  • Maximum portability - Users can export their private key at any time

Key features

Multi-chain Support

Create and manage wallets on Ethereum, Solana, and all EVM/SVM-compatible chains including Base, Polygon, Arbitrum, and more.

Self-custodial

Users have complete control over their wallets. Private keys are securely sharded and only reconstituted for signing operations.

Automatic Creation

Configure wallets to be created automatically when users log in, or create them manually when needed.

Easy Transactions

Simple APIs for sending transactions, signing messages, and interacting with smart contracts.

Export Keys

Users can export their private keys to use their wallet in other applications like MetaMask or Phantom.

UI Components

Pre-built UI components for signing, transactions, and key export with full customization options.

User wallets

MoonKey specializes in creating self-custodial embedded wallets for your users. This means users have a blockchain wallet experience that feels native to your application.

Benefits for users

No technical complexity
  • No seed phrases to write down or store
  • No browser extensions to install
  • No separate apps to download
  • Seamless authentication and wallet access
Full ownership
  • Complete control over their assets
  • Ability to export private keys
  • Freedom to move to other wallets
  • Self-custodial by default
Instant onboarding
  • Wallets created in seconds
  • No blockchain knowledge required
  • Start transacting immediately
  • Familiar login methods (email, OAuth)

Benefits for developers

Simple integration
  • Easy-to-use React SDK
  • Pre-built UI components
  • Comprehensive REST API
  • TypeScript support
Flexible configuration
  • Automatic or manual wallet creation
  • Customizable UI components
  • Multiple authentication methods
  • Support for multiple chains
Production ready
  • Secure key management
  • High uptime and reliability
  • Transaction broadcasting
  • Error handling

Wallet creation

MoonKey offers two approaches to wallet creation:

Automatic wallet creation

Configure MoonKey to automatically create wallets when users authenticate:
import { MoonKeyProvider } from '@moon-key/react-auth';

<MoonKeyProvider
  publishableKey="your_publishable_key"
  config={{
    embeddedWallets: {
      createOnLogin: 'always' // Automatically create wallet for every user
    }
  }}
>
  {children}
</MoonKeyProvider>
When to use:
  • Your app requires all users to have a wallet
  • You want the simplest onboarding experience
  • Users will interact with blockchain features immediately
Learn more about automatic wallet creation.

Manual wallet creation

Create wallets programmatically when needed:
import { useCreateWallet } from '@moon-key/react-auth/ethereum';

function CreateWalletButton() {
  const { createWallet } = useCreateWallet();
  
  const handleCreate = async () => {
    const wallet = await createWallet();
    console.log('Wallet created:', wallet.address);
  };
  
  return <button onClick={handleCreate}>Create Wallet</button>;
}
When to use:
  • Not all users need a wallet
  • Users opt-in to blockchain features
  • You want to delay wallet creation for UX reasons

Multi-chain support

MoonKey wallets work across multiple blockchain ecosystems:

Ethereum and EVM chains

Create wallets compatible with:
  • Ethereum - Mainnet and testnets
  • Layer 2s - Base, Arbitrum, Optimism, Polygon
  • Sidechains - Polygon, Gnosis Chain, and more
  • Custom EVMs - Any EVM-compatible network
import { MoonKeyProvider } from '@moon-key/react-auth';
import { base, polygon, arbitrum } from 'viem/chains';

<MoonKeyProvider
  publishableKey="your_publishable_key"
  config={{
    supportedChains: [base, polygon, arbitrum]
  }}
>
  {children}
</MoonKeyProvider>

Solana and SVM chains

Create wallets compatible with:
  • Solana - Mainnet, Devnet, Testnet
  • Custom SVM - SVM-compatible networks
import { MoonKeyProvider } from '@moon-key/react-auth';

<MoonKeyProvider
  publishableKey="your_publishable_key"
  config={{
    solana: {
      rpcs: {
        'solana:mainnet': {
          rpc: 'https://api.mainnet-beta.solana.com',
          rpcSubscriptions: 'wss://api.mainnet-beta.solana.com'
        }
      }
    }
  }}
>
  {children}
</MoonKeyProvider>
Learn more about configuring networks.

Wallet operations

MoonKey provides simple APIs for common wallet operations:

Sign messages

Sign arbitrary messages for authentication or verification:
import { useSignMessage } from '@moon-key/react-auth/ethereum';

const { signMessage } = useSignMessage();

const result = await signMessage({
  message: 'Welcome to MyApp!',
  wallet: user.wallet
});

Sign transactions

Sign transactions without broadcasting them:
import { useSignTransaction } from '@moon-key/react-auth/ethereum';

const { signTransaction } = useSignTransaction();

const result = await signTransaction({
  transaction: {
    to: '0xRecipient...',
    value: '0x38d7ea4c68000'
  },
  wallet: user.wallet
});

Send transactions

Sign and broadcast transactions in one step:
import { useSendTransaction } from '@moon-key/react-auth/ethereum';

const { sendTransaction } = useSendTransaction();

const result = await sendTransaction({
  transaction: {
    to: '0xRecipient...',
    value: '0x38d7ea4c68000'
  },
  wallet: user.wallet
});

console.log('Transaction hash:', result.transactionHash);

Export private key

Allow users to export their private key:
import { useExportPrivateKey } from '@moon-key/react-auth/ethereum';

const { exportPrivateKey } = useExportPrivateKey();

await exportPrivateKey({
  wallet: user.wallet,
  uiConfig: {
    title: 'Export Private Key',
    privateKeyDescription: 'Your private key provides full access to your wallet'
  }
});
Learn more about wallet operations.

UI components

MoonKey provides pre-built UI components for all wallet operations: All UI components are fully customizable to match your brand. Learn more about UI components.

Headless wallet operations

For complete control over your UI, use MoonKey’s headless wallet operations. Build custom interfaces while MoonKey handles the security and blockchain complexity. Learn more about whitelabel wallet operations.

Security and custody

MoonKey wallets are designed with security as the top priority:

Distributed key sharding

Private keys are split into multiple shards that are distributed across different secure locations. The complete key is only reconstituted in a secure environment when needed for signing operations. Benefits:
  • No single point of failure
  • Neither MoonKey nor your app sees complete keys
  • Users maintain full custody
  • Resistant to common attack vectors

User control

Users have complete control over their wallets:
  • Self-custodial - Users own their keys, not MoonKey or your app
  • Exportable - Users can export private keys at any time
  • Portable - Use exported keys in any compatible wallet
  • No lock-in - Users can leave your platform with their assets

Secure operations

All wallet operations follow security best practices:
  • Transaction signing - Performed in secure environments
  • Key storage - Encrypted and sharded across locations
  • API authentication - Secure session tokens and API keys
  • User confirmation - Clear UI for approving operations

Common use cases

Gaming

Create wallets for gamers to own in-game assets:
  • Automatically create wallets on signup
  • Seamless NFT minting and trading
  • In-game token transactions
  • Cross-game asset portability

DeFi applications

Enable users to interact with DeFi protocols:
  • Swap tokens
  • Provide liquidity
  • Stake assets
  • Yield farming

NFT marketplaces

Let users buy, sell, and trade NFTs:
  • Mint NFTs directly in your app
  • List items for sale
  • Make offers and bids
  • Transfer NFTs between wallets

Social applications

Add blockchain features to social apps:
  • Token-gated communities
  • Reward systems
  • Tipping and micropayments
  • Proof of ownership

E-commerce

Accept crypto payments seamlessly:
  • Checkout with crypto
  • Issue refunds
  • Loyalty tokens
  • Gift cards and vouchers

REST API

For server-side wallet management, MoonKey provides a comprehensive REST API:
# Create a wallet
curl -X POST https://api.moonkey.fun/v1/wallets/create \
  -H "Authorization: Bearer sk_test_YOUR_SECRET_KEY" \
  -H "Content-Type: application/json" \
  -d '{
    "wallet_type": "ethereum",
    "user_id": "user_123"
  }'
Learn more about the REST API.

Comparison with external wallets

FeatureMoonKey Embedded WalletsExternal Wallets (MetaMask, Phantom)
SetupAutomatic, no installationRequires browser extension or app
User experienceSeamless, built into your appSeparate popup/app
CustodySelf-custodial by userSelf-custodial by user
Seed phrasesOptional (can export key)Required for user to manage
OnboardingInstant, with email/OAuthMust have wallet already
UX controlFull control over UILimited customization
Cross-deviceWorks anywhere user logs inRequires extension on each device
You can support both embedded and external wallets in the same app. Let users choose their preferred wallet experience.

Best practices

  • Use automatic creation for apps where all users need wallets
  • Use manual creation for apps with optional blockchain features
  • Consider user onboarding flow and experience
  • Clearly explain that users own their wallets
  • Show how to export private keys
  • Explain what self-custodial means
  • Provide wallet security education
  • Show clear error messages for failed transactions
  • Explain insufficient balance errors
  • Guide users on how to fund wallets
  • Provide transaction status updates
  • Use Sepolia (Ethereum) or Devnet (Solana) for development
  • Test all transaction flows thoroughly
  • Verify gas estimation and fees
  • Check error handling scenarios
  • Test wallet operations on mobile devices
  • Ensure UI is responsive
  • Consider mobile network speeds
  • Provide mobile-friendly interfaces

Get started

Next steps