Creating an MPC wallet

MPC Wallet

To generate a new MPC wallet using the createMpcWallet() method, This process generates shards, including:

- name: The name of master wallet - numParties child wallet keys - wallets: A list of MpcKeyGenWallet to perform keygen. Each item requires: - derivationPath: The derivation Path of Wallet. - ChainId: The chain name (e.g., ethereum, solana). - 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:


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:


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:

    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)

Last updated