Custody Starter Architecture: Set Up Standby Wallet (MPC)
Create an MPC standby wallet as intermediate buffer. See the Guide.
-
Generate a self-custody MPC wallet using BitGo Express or the SDK. This creates the wallet and keys in one step. The standby wallet is a self-custody wallet that serves as an intermediate buffer between your custody wallet (cold storage) and your deposit/withdraw wallet (daily operations).
This response contains critical key material. Save the backup keychain in a secure place. Save the wallet ID and backup keychain from the response. You need the wallet ID to configure whitelist policies.
// 1. Create Standby Wallet
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export WALLET_PASSPHRASE="<YOUR_WALLET_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 Standby Wallet
const { BitGo } = require('bitgo');
const accessToken = '<YOUR_ACCESS_TOKEN>';
const bitgo = new BitGo({
accessToken: accessToken,
env: 'prod',
});
async function createStandbyWallet() {
const newWallet = await bitgo.coin('<ASSET_ID>').wallets().generateWallet({
label: 'Standby Wallet - Hot',
passphrase: '<YOUR_WALLET_PASSPHRASE>',
enterprise: '<YOUR_ENTERPRISE_ID>',
multisigType: 'tss',
type: 'hot',
walletVersion: 5
});
console.log('Standby Wallet Created:');
console.log('Wallet ID:', newWallet.wallet.id());
console.log('Receive Address:', newWallet.wallet.receiveAddress());
// IMPORTANT: Save the backup keychain securely
console.log('Backup Keychain (SAVE SECURELY):', newWallet.backupKeychain);
}
createStandbyWallet();
Response
// 1. Create Standby Wallet Response
{
"wallet": {
"id": "665e33f768f9b4b1cc2ca87a6b87cdfb",
"users": [
{
"user": "660d7c9fa6fbf0d00b415146cf70405a",
"permissions": ["admin", "spend", "view"]
}
],
"coin": "eth",
"label": "Standby Wallet - Hot",
"m": 2,
"n": 3,
"keys": [
"665e33f6fcf87cac817eb3b2ed964042",
"665e33f6e7331ba062e62c48c6ccaf98",
"665e33f6fcf87cac817eb3b01c6b4c36"
],
"keySignatures": {
"backupPub": "2068a68569154bd290750ee27c4ce005...",
"bitgoPub": "20119f72ea457cb041a0df35fb4ec314..."
},
"enterprise": "66325011d4b1ff58feae3b311d669aae",
"organization": "66325011d4b1ff58feae3b321d669aaf",
"bitgoOrg": "BitGo Trust",
"tags": [
"665e33f768f9b4b1cc2ca87a6b87cdfb",
"66325011d4b1ff58feae3b311d669aae"
],
"disableTransactionNotifications": false,
"freeze": {},
"deleted": false,
"approvalsRequired": 1,
"isCold": false,
"coinSpecific": {},
"admin": {
"policy": {
"date": "2024-01-15T10:30:00.000Z",
"id": "665e33f768f9b4b1cc2ca87b6b87cdfc",
"label": "default",
"rules": [],
"version": 0,
"latest": true
}
},
"clientFlags": [],
"walletFlags": [],
"allowBackupKeySigning": false,
"recoverable": false,
"startDate": "2024-01-15T10:30:00.000Z",
"type": "hot",
"buildDefaults": {},
"customChangeKeySignatures": {},
"hasLargeNumberOfAddresses": false,
"multisigType": "tss",
"hasReceiveTransferPolicy": false,
"creator": "660d7c9fa6fbf0d00b415146cf70405a",
"walletFullyCreated": true,
"config": {},
"balanceString": "0",
"confirmedBalanceString": "0",
"spendableBalanceString": "0",
"receiveAddress": {
"id": "665e33f868f9b4b1cc2ca87c6b87cdfd",
"address": "0x1a52b70e708f4aec9d92260aa035b3c71e51df84",
"chain": 0,
"index": 0,
"coin": "eth",
"wallet": "665e33f768f9b4b1cc2ca87a6b87cdfb",
"coinSpecific": {}
},
"pendingApprovals": []
},
"userKeychain": {
"id": "665e33f6fcf87cac817eb3b2ed964042",
"source": "user",
"type": "tss",
"encryptedPrv": "{...}"
},
"backupKeychain": {
"id": "665e33f6e7331ba062e62c48c6ccaf98",
"source": "backup",
"type": "tss",
"encryptedPrv": "{...}"
},
"bitgoKeychain": {
"id": "665e33f6fcf87cac817eb3b01c6b4c36",
"source": "bitgo",
"type": "tss",
"isBitGo": true
},
"responseType": "WalletWithKeychains",
"warning": "Be sure to backup the backup keychain -- it is not stored anywhere else!"
}