Create Addresses
Create a new receive address for a BitGo wallet to enhance privacy. See the Guide.
-
Create a new receive address for your wallet. You can create a new address for every transaction to enhance privacy. There's no limit to the number of addresses you can create.
Account-based assets can withdraw only from the base address. If you have multiple receive addresses, you must periodically consolidate balances to the base address. UTXO-based assets can withdraw from any address.
Prerequisites: You must have an existing wallet. See Create Wallets.
// 1. Create Address
export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X POST \
https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/address \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 1. Create Address
const { BitGo } = require('bitgo');
// Fill in with actual access token
const accessToken = '<your_actual_access_token>';
// Initialize the SDK
const bitgo = new BitGo({
accessToken: accessToken,
env: 'custom',
customRootURI: 'https://app.bitgo.com',
});
// Create the wallet
const { wallet } = await bitgo.coin('tbtc4').wallets().generateWallet({
label: 'my hot Wallet',
passphrase: 'VerySecurePassword1234',
enterprise: '5612c2beeecf83610b621b90964448cd'
});
// Or Alternatively you can get an existing wallet
const walletId = '63bc8506e014900008265c65363245f4'
const existingWallet = await bitgo.coin('tbtc4').wallets().get({ id: walletId });
// use the appropriate wallet instance to create new address
const address = await wallet.createAddress();
console.log(JSON.stringify(address, undefined, 2));
Response
// 1. Create Address Response
{
"id": "631283e10e052800066295e210da142a",
"address": "2N9wCEV3KGEFsyo9xoUGjVYaSVwjSueutjz",
"chain": 10,
"index": 2,
"coin": "tbtc4",
"wallet": "6312824bf3281c0006fedaad1d667e67",
"coinSpecific": {
"witnessScript": "5221031a4b6c3d9e8f2a5b7c0d1e4f7a2b5c8d3e6f9a0b1c4d7e0f3a6b9c2d5e8f1a4b7c021039d2e7f4a1b8c5d0e3f6a9b2c5d8e1f4a7b0c3d6e9f2a5b8c1d4e7f0a3b6c9d2e5f8a210453f8e2b9c6d3a0f7e4b1c8d5a2f9e6b3c0d7a4f1e8b5c2d9a6f3e0b7c4d1a8f5e2b9c6d3a053ae"
}
}