Create Wallets - MPC
Generate a self-custody MPC wallet with BitGo. See the Guide.
-
Generate a self-custody MPC wallet and keys in one step. When you generate a wallet, BitGo creates user, backup, and BitGo key shares using threshold signature scheme (TSS) cryptography.
Set
walletVersionto5for ECDSA assets such as ETH and MATIC. This response contains critical key material — save it in a secure place.Prerequisites: You must have a BitGo account. See Get Started.
// 1. Create Wallet
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ENTERPRISE_ID="<ENTERPRISE_ID>"
export WALLET_PASSPHRASE="<YOUR_BITGO_LOGIN_PASSPHRASE>"
export LABEL="<YOUR_DESIRED_WALLET_NAME>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/generate?includeKeychains=true \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"enterprise": "'"$ENTERPRISE_ID"'",
"passphrase": "'"$WALLET_PASSPHRASE"'",
"label": "'"$LABEL"'",
"type": "hot",
"multisigType": "tss",
"walletVersion": 5
}'
// 1. Create Wallet
async function createHotWalletSimple() {
const newWallet = await bitgo.coin('teth').wallets().generateWallet({
label: '<YOUR_WALLET_NAME>',
passphrase: '<YOUR_BITGO_LOGIN_PASSPHRASE>',
multisigType: 'tss',
passcodeEncryptionCode: '<RANDOM_STRING>', // Encrypts the orginal wallet passphrase
walletVersion: 5, // Required for ECDSA assets, such as ETH, MATIC, and Cosmos SDK assets
});
console.log(JSON.stringify(newWallet, undefined,2));
}
Response
// 1. Create Wallet Response
{
"wallet": {
"id": "665e33f768f9b4b1cc2ca87a6b87cdfb",
"users": [
{
"user": "660d7c9fa6fbf0d00b415146cf70405a",
"permissions": ["admin", "spend", "view"]
}
],
"coin": "hteth",
"label": "MPCv2-using-settings-api",
"m": 2,
"n": 3,
"keys": [
"665e33f6fcf87cac817eb3b2ed964042",
"665e33f6e7331ba062e62c48c6ccaf98",
"665e33f6fcf87cac817eb3b01c6b4c36"
],
"keySignatures": {},
"enterprise": "66325011d4b1ff58feae3b311d669aae",
"organization": "66325011d4b1ff58feae3b76c2d30987",
"bitgoOrg": "BitGo Trust",
"tags": [
"665e33f768f9b4b1cc2ca87a6b87cdfb",
"66325011d4b1ff58feae3b311d669aae"
],
"disableTransactionNotifications": false,
"freeze": {},
"deleted": false,
"approvalsRequired": 1,
"isCold": false,
"coinSpecific": {
"deployedInBlock": false,
"lastChainIndex": { "0": -1, "1": -1 },
"baseAddress": "0x1a52b70e708f4aec9d92260aa035b3c71e51df84",
"feeAddress": "0x56b269b691f910f1bed53893af099402c2983ea8",
"pendingChainInitialization": false,
"pendingEcdsaTssInitialization": false,
"creationFailure": [],
"gasPriceTier": "fast",
"tokenFlushThresholds": {},
"lowPriorityFeeAddress": "0x56b269b691f910f1bed53893af099402c2983ea8",
"salt": "0x7",
"walletVersion": 5,
"pendingDeployment": false,
"deployForwardersManually": false,
"flushForwardersManually": false,
"enableMMI": false,
"enableNFT": false
},
"admin": {},
"clientFlags": [],
"walletFlags": [],
"allowBackupKeySigning": false,
"recoverable": false,
"startDate": "2024-06-03T21:21:59.000Z",
"type": "hot",
"buildDefaults": {},
"customChangeKeySignatures": {},
"hasLargeNumberOfAddresses": false,
"multisigType": "tss",
"multisigTypeVersion": "MPCv2",
"config": {},
"balanceString": "0",
"confirmedBalanceString": "0",
"spendableBalanceString": "0",
"receiveAddress": {
"id": "665e33f768f9b4b1cc2ca88ae9f990fc",
"address": "0x1a52b70e708f4aec9d92260aa035b3c71e51df84",
"chain": 0,
"index": 0,
"coin": "hteth",
"wallet": "665e33f768f9b4b1cc2ca87a6b87cdfb",
"coinSpecific": {
"nonce": -1,
"updateTime": "2024-06-03T21:21:59.948Z",
"txCount": 0,
"pendingChainInitialization": false,
"creationFailure": [],
"pendingDeployment": false,
"forwarderVersion": 4,
"isTss": true,
"isNonceLocked": false
}
},
"pendingApprovals": []
},
"userKeychain": {
"id": "665e33f6fcf87cac817eb3b2ed964042",
"source": "user",
"type": "tss",
"commonKeychain": "0294459a370b9326a8f64a5279bc072329fd6ae7df8257ed3676fe6acb84542bcc2a9c88e000d1f978be4e361a3a2134042019480a5d26e4cc8c28b3c6b447bb35",
"encryptedPrv": "{...}",
"reducedEncryptedPrv": "{...}"
},
"backupKeychain": {
"id": "665e33f6e7331ba062e62c48c6ccaf98",
"source": "backup",
"type": "tss",
"commonKeychain": "0294459a370b9326a8f64a5279bc072329fd6ae7df8257ed3676fe6acb84542bcc2a9c88e000d1f978be4e361a3a2134042019480a5d26e4cc8c28b3c6b447bb35",
"encryptedPrv": "{...}",
"reducedEncryptedPrv": "{...}"
},
"bitgoKeychain": {
"id": "665e33f6fcf87cac817eb3b01c6b4c36",
"source": "bitgo",
"type": "tss",
"commonKeychain": "0294459a370b9326a8f64a5279bc072329fd6ae7df8257ed3676fe6acb84542bcc2a9c88e000d1f978be4e361a3a2134042019480a5d26e4cc8c28b3c6b447bb35",
"isBitGo": true
}
}