> ## Documentation Index
> Fetch the complete documentation index at: https://rain-sandbox-trial.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Wallet Creation

> How wallets are created, how to retrieve their addresses, and how to register them with Rain for card funding.

A wallet is created automatically the first time a new user successfully signs up. There is no separate wallet creation step.

After `confirmLoginCode` or `signUpWithPasskey` completes, the user’s wallet is ready to use. From there, you can retrieve its addresses and register the appropriate address with Rain when the wallet will be used to support card spend.

## What gets created

Each wallet is created from a single seed and includes accounts for supported blockchain networks.

| Account | Curve | Derivation path | Address format | Used on |
| - | - | - | - | - |
| Ethereum | secp256k1 | `m/44'/60'/0'/0/0` | `0x` + 40 hex characters, EIP-55 checksummed | Supported EVM chains, including Base, Arbitrum, Polygon, and others |
| Solana | ed25519 | `m/44'/501'/0'/0'` | Base58, 32 to 44 characters | Solana mainnet and devnet |

Both blockchain accounts are derived from the same wallet seed. A single [recovery phrase](/docs/embedded-wallets/key-export)  restores the wallet across supported networks. For EVM networks, the wallet uses the same address across each supported EVM chain.

The seed is generated and secured by Rain’s wallet infrastructure. See [security model](/docs/embedded-wallets/overview#security-model) for details.

## Get wallet addresses

Use `getWalletAddress` after the user has an active session. Calling `getWalletAddress()` without a chain ID returns the wallet’s EVM address. To retrieve the Solana address, pass a Solana chain ID.

<CodeGroup>
  ```swift iOS theme={null}
  let client = try await rain.provider(.rain)
  let evm = try await client.getWalletAddress()                                   // "0x…"
  let sol = try await client.getWalletAddress(chainId: RainChain.solanaMainnet)   // base58
  ```

  ```kotlin Android theme={null}
  val client = rain.provider(ProviderId.RAIN)
  val evm = client.getWalletAddress()                              // "0x…"
  val sol = client.getWalletAddress(RainChain.SOLANA_MAINNET)      // base58
  ```
</CodeGroup>

`getWalletAddress` requires an active session. If no session is available, resolving the client returns `RAIN_201`. Use `hasActiveSession()` before resolving the client when session state may be unknown.

## Registering the wallet with Rain

To use an embedded wallet with Rain card issuing, send the wallet addresses to your backend and include them when you create the user or company application.

This request should be made from your backend using your Rain API key. Do not call the application API directly from the client.

<CodeGroup>
  ```json Consumer application (POST /v1/issuing/applications/user) theme={null}
  {
    "firstName": "Ada",
    "lastName": "Lovelace",
    "email": "ada@example.com",
    "walletAddress": "0x3cA8ac240F6ebeA8684b3E629A8e8C1f0E3bC0Ff",
    "solanaAddress": "7Np41oeYqPefeNQEHSv1UDhYrehxin3NStELsSKCT4K2"
  }
  ```

  ```json Corporate application (POST /v1/issuing/applications/company) theme={null}
  {
    "name": "Example Inc.",
    "initialUser": {
      "firstName": "Ada",
      "lastName": "Lovelace",
      "email": "ada@example.com",
      "walletAddress": "0x3cA8ac240F6ebeA8684b3E629A8e8C1f0E3bC0Ff"
    }
  }
  ```
</CodeGroup>

The examples above show abbreviated payloads. See [Create a consumer application](/reference/applications/create-a-consumer-application-for-a-user) and [Create a corporate application](/reference/applications/create-a-corporate-application-for-a-company)  for the full request schemas.

Include `solanaAddress` when your program supports card funding on Solana.

For Rain managed programs, Rain creates a collateral contract after the application is approved and assigns the registered wallet as the contract owner. Rain then sends a `contract.created` webhook.

Once the collateral contract is created, the wallet can fund the contract and withdraw collateral from it. See [Card funding and settlement](/docs/embedded-wallets/card-funding-and-settlement).

<Warning>
  **Create the wallet and add its address to the application before the user begins KYC.** Rain deploys the collateral contract using the wallet address on the application. You can change the owner wallet later, but additional restrictions apply. See [Changing the owner wallet](/docs/embedded-wallets/card-funding-and-settlement#changing-the-owner-wallet).
</Warning>

## Timing with KYC

Wallet creation does not depend on the user’s Rain application status. A user can create a wallet, receive funds, and send funds before applying for a card or while KYC is still pending.

Card funding begins only after the application is approved and Rain creates the collateral contract. A typical sequence is:`Create wallet` → `Create application with wallet address` → `Complete KYC` → `contract.created` → `Fund collateral contract` → `Issue card`

## One wallet per account

Each Rain account has one wallet. If a user creates a separate account with another email address or phone number, that account has its own wallet and is not linked to the first account.

Corporate programs generally do not require multiple wallets. A single wallet can own the company’s collateral contract, and multiple cards can spend from that contract. See [Corporate wallets](/docs/embedded-wallets/overview#corporate-wallets).

## Existing wallets from other providers

If your users already have wallets from Portal, Privy, Turnkey, or other providers, you can use those wallets with Rain instead of creating new Rain wallets.

Register the appropriate wallet provider adapter, then use `getWalletAddress` to retrieve the existing wallet address. Register that address with Rain the same way you would register a Rain wallet.

See [Third-party wallet providers](/sdks/embedded-wallets/third-party-providers).

## What's next

<Columns cols={2}>
  <Card title="Receiving funds" icon="arrow-down-to-bracket" href="/docs/embedded-wallets/receiving-funds">
    Show the address and QR code so the wallet can be funded.
  </Card>

  <Card title="Card funding and settlement" icon="credit-card" href="/docs/embedded-wallets/card-funding-and-settlement">
    From approved application to spending card.
  </Card>
</Columns>
