> 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-android/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 \
\- `numParties` child wallet keys \
\- `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**:

```kotlin

val walletResponse = client.createMpcWallet(
    name = "KeyGenGroupID123",
    numParties = 2,
    wallets = listOf(
        MpcKeyGenWallet(
            derivationPath = "m/84/0/0/0/0",
            chainId = "ethereum",
            ecType = "ecdsa"
        )
    )
)
walletResponse.masterWallets.forEach { masterWallet ->
    masterWallet.forEach { wallet
        println("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: - `name`: The name of master wallet - `Mnemonic`: The mnemonic phrase generated by the mobile app. - `numParties` child wallet keys - `wallets`: A list of KeyGenWallet to perform keygen. Each item requires: - `secret`: The private key of the Child Wallet (derived from the mnemonic phrase). - `walletAddress`: The public address or public key of the Child Wallet. - `ChainId`: The chain name (e.g., ethereum, solana). - `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**:

```kotlin

val walletResponse = client.createMnemonicWallet(
    name = "KeyGenGroupID123",
    numParties = 2,
    mnemonicPhrase = "your mnemonic phrase here",
    wallets = listOf(
        KeyGenWallet(
            secret = "derived private key",
            walletAddress = "0xYourWalletAddress",
            chainId = "ethereum",
            ecType = "ecdsa"
        )
    )
)
walletResponse.masterWallets.forEach { masterWallet ->
    masterWallet.forEach { wallet
        println("keyIdentity: ${wallet.keyIdentity} - ecType: ${wallet.ecType} - address: ${wallet.address}")
    }
}

```

#### Signing MPC

To create an Sign MPC, use the `SigningRequest` with the following attributes:

* create a new Build `SigningRequest` should include the following attributes:
  * `derivationPath` : The derivation Path of Wallet.
  * `message` : Your message
  * `paillierGroupID` : User's Paillier group ID.
  * `keyGenGroupID` : the keygen Group ID of master wallet
  * `keyIdentity` : the keyIdentity of wallet
  * `ecType`: Cryptographic algorithm type (e.g., `eddsa`, `ecdsa`)

**Example**:

```kotlin
    val signingReq = SigningRequest(
        derivationPath = "m/84/0/0/0/0",
        message = 'Hello Wallet',
        paillierGroupID = "paillierGroupID",
        keyGenGroupID = "keyGenGroupID",
        keyIdentity = "walletKeyIdentity",
        ecType = "ecdsa"
    )
    val signMessage = client.signing(signingReq)
```


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://cramiumlabs.gitbook.io/docs/sdk-mpc-android/usage-guide-for-an-mpc-wallet-app/creating-an-mpc-wallet.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
