Crypto-as-a-Service: Create Go Account - Automated
Generate Go Accounts using automated endpoint. See the Guide.
-
Use the automated endpoint to generate and encrypt the keys, upload them to BitGo, and create the Go Account in a single request. BitGo creates a Go Account wallet and returns the wallet data along with the single user keychain.
Make sure to backup the user keychain - it includes the pub and encryptedPrv keys which are not stored anywhere else.
-
Create a new receive address for your Go Account for a specific asset. You must specify the off-chain asset ID (e.g., ofctsol for off-chain test Solana) in the onToken parameter.
// 1. Generate Go Wallet
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="ofc"
export SERVICE_USER_TOKEN="<SERVICE_USER_ACCESS_TOKEN>"
export LABEL="<YOUR_GO_ACCOUNT_NAME>"
export WALLET_PASSPHRASE="<SERVICE_USER_LOGIN_PASSPHRASE>"
export CHILD_ENTERPRISE_ID="<CHILD_ENTERPRISE_ID>"
export PASSCODE="<YOUR_ENCRYPTION_CODE>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/generate \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $SERVICE_USER_TOKEN" \
-d '{
"label": "'"$LABEL"'",
"passphrase": "'"$WALLET_PASSPHRASE"'",
"enterprise": "'"$CHILD_ENTERPRISE_ID"'"
"type": "trading", # Go Accounts are trading type BitGo wallets
"passcodeEncryptionCode": "'"$PASSCODE"'", # Encrypts your wallet passphrase
}'
// 2. Create Receive Address
export WALLET_ID="<YOUR_WALLET_ID>"
export SERVICE_USER_TOKEN="<SERVICE_USER_ACCESS_TOKEN>"
export ON_TOKEN="<OFF-CHAIN_ASSET_ID>"
curl -X POST \
"https://app.bitgo-test.com/api/v2/ofc/wallet/$WALLET_ID/address" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $SERVICE_USER_TOKEN" \
-d '{
"onToken": "'"$ON_TOKEN"'", # For example, `ofctsol` for off-chain test Solana
}'
// 1. Generate Go Wallet
const { BitGo } = require('bitgo');
// Fill in with actual access token
const accessToken = '<SERVICE_USER_ACCESS_TOKEN>';
// Initialize the SDK
const bitgo = new BitGo({
accessToken: accessToken,
env: 'test',
});
// Generate Go Account
async function createGoAccount() {
const goAccount = await bitgo.coin('ofc').wallets().generateWallet({
label: '<YOUR_WALLET_NAME>',
passphrase: '<SERVICE_USER_LOGIN_PASSPHRASE>',
enterprise: '<CHILD_ENTERPRISE_ID>',
type: 'trading', // Go Accounts are trading type BitGo wallets
passcodeEncryptionCode: '<YOUR_ENCRYPTION_CODE>'
});
console.log(JSON.stringify(goAccount, null, 2));
}
createGoAccount();
// 2. Create Receive Address
const { BitGo } = require('bitgo');
// Fill in with actual access token
const accessToken = '<SERVICE_USER_ACCESS_TOKEN>';
// Initialize the SDK
const bitgo = new BitGo({
accessToken: accessToken,
env: 'custom',
customRootURI: 'https://app.bitgo.com',
});
// Get Go Account
const walletId = '<GO_ACCOUNT_WALLET_ID>';
const wallet = await bitgo.coin('ofc').wallets().get({ id: walletId });
// Create address for specific token
const address = await wallet.createAddress({
onToken: '<OFF-CHAIN_ASSET_ID>' // For example, 'ofctsol' for off-chain test Solana
});
console.log(JSON.stringify(address, null, 2));
Response
// 1. Generate Go Wallet Response
{
"wallet": {
"id": "68f6f18b7af1db4904d979d0d2e5d822",
"users": [
{
"user": "68728b8c66417fe09212fda389cc92c6",
"permissions": [
"admin",
"spend",
"view",
"trade"
]
}
],
"coin": "ofc",
"label": "your-child-enterprise-go-account",
"m": 1,
"n": 1,
"keys": [
"68f6f18b8b3ff242f952ceb03a7290a3"
],
"keySignatures": {},
"enterprise": "68f6abc2b621ab5c1c0b63e4d5da21a0",
"organization": "68928b9066417fe09212fe9965c88552",
"bitgoOrg": "BitGo Trust",
"tags": [
"68f6f18b7af1db4904d969d0d2e5d822",
"68f6abc2b621ab5c1c0b63e4d5da21a0"
],
"disableTransactionNotifications": false,
"freeze": {},
"deleted": false,
"approvalsRequired": 1,
"isCold": false,
"coinSpecific": {
"needsKeyReshareAfterPasswordReset": false,
"pendingSystemInitialization": true
},
"admin": {},
"clientFlags": [],
"walletFlags": [],
"allowBackupKeySigning": false,
"recoverable": true,
"startDate": "2025-10-21T02:35:55.000Z",
"type": "trading",
"buildDefaults": {},
"customChangeKeySignatures": {},
"hasLargeNumberOfAddresses": false,
"hasReceiveTransferPolicy": false,
"creator": "68728b8c66417fe09211fda389cc48c6",
"walletFullyCreated": true,
"config": {},
"pendingApprovals": []
},
"userKeychain": {
"id": "68f6f18b8b3ff242f952ceb03a7290a3",
"pub": "xpub661MyMwAqRbcEpSQ8LWmWrDbu3s36XPF3GbZ5MvJiMgDiKCsdmarRuJY6X4CT521BmDYfTmwc6MDazsdu8wBN6fNL9dsY1VzeRwkBvVmcXR",
"ethAddress": "0x7efb44aeef5583ddc75fff533e27ae59f680d4a2",
"source": "user",
"type": "independent",
"encryptedPrv": "{\"iv\":\"HdF9ZbsQnGmJKnxXzBHouh==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"FU5QOdz7p7h=\",\"ct\":\"8wKjkJ8Gh5L6AwmzdwEbjaPkO+IoaCDnjcQceFcbZ+PvkTHHH4v6rlbbHIwt6fdsXikrH6I3mhgHYgGf871xYFNjUkbyEAZ/xUPQEtk46G6w6/rH1S8ZXuxkJ/PTHhiKDIl5P+7dd1+KEO8BtLoJCiFlkZiMuP5=\"}"
},
"responseType": "GoAccountWalletWithUserKeychain",
"warning": "Be sure to backup the user keychain -- it is not stored anywhere else!",
"encryptedWalletPassphrase": "{\"iv\":\"wek1Ha/Po/aUAI/FnJCFtx==\",\"v\":1,\"iter\":10000,\"ks\":256,\"ts\":64,\"mode\":\"ccm\",\"adata\":\"\",\"cipher\":\"aes\",\"salt\":\"J37ZHREx7e9=\",\"ct\":\"px189Udy+8/joIi1EsYZRzuQS2C7j+p=\"}"
}
// 2. Create Receive Address Response
{
"id": "67ec59c0929b08484faecc752f542d8c",
"address": "HNohgG7TsPkqBhWxxmbE1dRzuNrxSfFfdxuwxYwmMTxm",
"chain": 0,
"index": 397,
"coin": "ofc",
"token": "ofctsol",
"wallet": "68f6f18b7af1db4904d979d0d2e5d822"
}