> For the complete documentation index, see [llms.txt](https://cramiumlabs.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cramiumlabs.gitbook.io/docs/sdk-mpc-ios/usage-guide-for-an-mpc-wallet-app/creating-an-mpc-wallet.md).

# Creating an MPC wallet

#### MPC Wallet

To generate a new MPC wallet using the `createMpcWallet()` method, This process generates shards, including:&#x20;

* `name`: The name of master wallet&#x20;
* `Mnemonic`: The mnemonic phrase generated by the mobile app.&#x20;
* `numParties` child wallet keys&#x20;
* `wallets`: A list of MpcKeyGenWallet to perform keygen. Each item requires:&#x20;
  * `derivationPath`: The derivation Path of Wallet.&#x20;
  * `ChainId`: The chain name (e.g., ethereum, solana).&#x20;
  * `ecType`: The cryptographic algorithm type (eddsa, ecdsa).

```
Additional Notes:
    - Use Trust Wallet Core to derive the `secret` using the Derivation Path.
        - CoinType.ethereum
        - CoinType.solana
        - CoinType.arbitrum
        - More coins : https://trustwallet.github.io/docc/documentation/walletcore/cointype/
    - Refer to the Trust Wallet Registry for `ChainId` and `ecType`: https://github.com/trustwallet/wallet-core/blob/master/registry.json
```

**Example**:

```swift

let walletResponse = client.createMpcWallet(
    name: "KeyGenGroupID123",
    numParties: 2,
    mnemonicPhrase: "your mnemonic phrase here",
    wallets: [
        MpcKeyGenWallet(
            derivationPath: "m/84/0/0/0/0",
            chainId: "ethereum",
            ecType: "ecdsa"
        )
    ]
)

for masterWallet in walletResponse.masterWallets {
    for wallet in masterWallet {
        // Assuming wallet has properties: keyIdentity, ecType, and address
        print("keyIdentity: \(wallet.keyIdentity) - ecType: \(wallet.ecType) - address: \(wallet.address)")
    }
}

```

#### Mnemonic Compatible MPC Wallet

To generate a new MPC wallet using the `createMnemonicWallet()` method, This process generates shards, including:&#x20;

* `name`: The name of master wallet&#x20;
* `Mnemonic`: The mnemonic phrase generated by the mobile app.&#x20;
* `numParties` child wallet keys&#x20;
* `wallets`: A list of KeyGenWallet to perform keygen. Each item requires:&#x20;
  * `secret`: The private key of the Child Wallet (derived from the mnemonic phrase).
  * `walletAddress`: The public address or public key of the Child Wallet.&#x20;
  * `ChainId`: The chain name (e.g., ethereum, solana).&#x20;
  * `ecType`: The cryptographic algorithm type (eddsa, ecdsa).

```
Additional Notes:
    - When receiving the backup from `createMpcWallet()`, please ensure that the server shards of the newly created Paillier group and Keygen group are stored in a safe and secure location.
    - Use Trust Wallet Core to derive the `secret` using the Derivation Path.
        - CoinType.ethereum
        - CoinType.solana
        - CoinType.arbitrum
        - More coins : https://trustwallet.github.io/docc/documentation/walletcore/cointype/
    - Refer to the Trust Wallet Registry for `ChainId` and `ecType`: https://github.com/trustwallet/wallet-core/blob/master/registry.json
```

**Example**:

```swift

let walletResponse = client.createMnemonicWallet(
    name: "KeyGenGroupID123",
    numParties: 2,
    mnemonicPhrase: "your mnemonic phrase here",
    wallets: [
        KeyGenWallet(
            secret: "derived private key",
            walletAddress: "0xYourWalletAddress",
            chainId: "ethereum",
            ecType: "ecdsa"
        )
    ]
)

for masterWallet in walletResponse.masterWallets {
    for wallet in masterWallet {
        // Assuming wallet has properties: keyIdentity, ecType, and address
        print("keyIdentity: \(wallet.keyIdentity) - ecType: \(wallet.ecType) - address: \(wallet.address)")
    }
}

```
