Custody Starter Architecture: Create Receive Addresses
Create and list receive addresses for customer deposits. See the Guide.
-
Create a new receive address on your deposit/withdraw wallet. You can create unlimited addresses for a wallet. Using unique addresses for each customer or transaction improves privacy, simplifies accounting, and makes it easier to track deposits.
Some networks like Ethereum do not immediately return a new multisignature address since creating a new address requires a blockchain transaction. The
pendingChainInitializationparameter identifies if an address is awaiting confirmation. -
View all addresses created for a wallet. This returns the address, label, and other metadata for each address.
// 1. Create Receive Address
export COIN="<ASSET_ID>"
export WALLET_ID="<DEPOSIT_WITHDRAW_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export LABEL="Customer ABC"
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" \
-d '{
"label": "'"$LABEL"'"
}'
// 2. List Wallet Addresses
curl -X GET \
"https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/addresses" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"
// 1. Create Receive Address
const { BitGo } = require('bitgo');
const accessToken = '<YOUR_ACCESS_TOKEN>';
const bitgo = new BitGo({
accessToken: accessToken,
env: 'prod',
});
async function createReceiveAddress() {
const wallet = await bitgo.coin('<ASSET_ID>').wallets().get({
id: '<DEPOSIT_WITHDRAW_WALLET_ID>'
});
const address = await wallet.createAddress({
label: 'Customer ABC'
});
console.log('New Receive Address Created:');
console.log('Address:', address.address);
console.log('Label:', address.label);
console.log('Address ID:', address.id);
}
createReceiveAddress();
// 2. List Wallet Addresses
async function listAddresses() {
const wallet = await bitgo.coin('<ASSET_ID>').wallets().get({
id: '<WALLET_ID>'
});
const addresses = await wallet.addresses();
console.log('Wallet Addresses:');
addresses.addresses.forEach(addr => {
console.log(` ${addr.label || 'No label'}: ${addr.address}`);
});
}
listAddresses();
// 1. Create Receive Address Response
{
"id": "631283e10e052800066295e210da142a",
"address": "bc1q8w3mcwt83tpmmr4reas3xt8t7rcshu7gztszew",
"chain": 10,
"index": 2,
"coin": "btc",
"wallet": "7849948ac0623f81f74f63dbd8351d5g",
"label": "Customer ABC",
"coinSpecific": {
"redeemScript": "...",
"witnessScript": "..."
},
"addressType": "p2shP2wsh"
}
// 2. List Wallet Addresses Response
{
"coin": "btc",
"totalAddressCount": 5,
"addresses": [
{
"id": "631283e10e052800066295e210da142a",
"address": "bc1q8w3mcwt83tpmmr4reas3xt8t7rcshu7gztszew",
"chain": 10,
"index": 0,
"coin": "btc",
"wallet": "7849948ac0623f81f74f63dbd8351d5g",
"label": "Default Receive Address"
},
{
"id": "631283e10e052800066295e210da142b",
"address": "bc1p...",
"chain": 10,
"index": 1,
"coin": "btc",
"wallet": "7849948ac0623f81f74f63dbd8351d5g",
"label": "Customer ABC"
}
]
}