> ## Documentation Index
> Fetch the complete documentation index at: https://docs.portalhq.io/llms.txt
> Use this file to discover all available pages before exploring further.

# Create a wallet

> The first step to the MPC process is generating key shares, or a wallet, for your users.

Once you have an instance of `Portal`, you can add logic to create web3 wallets.

## The onReady hook

The `Portal` class dynamically loads a number of resources behind the scenes to enable MPC directly in the browser. For this reason, some functionality is not immediately available after initialization.

We have include an `onReady` function to enable you to write your application logic in a more linear manner without having to explicitly poll the `ready` state of your `Portal` instance.

```typescript theme={null}
portal.onReady(() => {
    // Your code
})
```

## Wallet Creation

The `createWallet` function initiates the MPC process to create a set of shares. The user's share and the wallet address is automatically stored in the browser's local storage, but hidden from the main browser context of your web application.

```typescript theme={null}
portal.onReady(async () => {
    const walletExists = await portal.doesWalletExist()

    if (!walletExists) {
        await portal.createWallet()
    }

    const ethAddress = await portal.getEip155Address()
    const solAddress = await portal.getSolanaAddress()
})
```

<Warning>
  Be sure to use a **Production** API key when creating clients for production. Read more details about going to production [here](../../../resources/going-to-production).
</Warning>

That's it! You now have an MPC Wallet built into your web application.
