Withdraw from Wallet - Go Account (Advanced)
Overview
You build withdrawals from your Go Account by submitting transaction details to BitGo. BitGo uses the data you pass to construct an unsigned transaction that wallet admins can approve. After video verification, a BitGo Trust operator signs the transaction with the user key. Then a different BitGo Trust operator downloads and signs the transaction in the BitGo Offline Vault Console (OVC). BitGo then uploads and broadcasts the transaction.
If you don't need this level of granular control for your Go Account withdrawals, see the integration guide for the simple flow.
Prerequisites
1. Get idHash
(Optional)
idHash
(Optional)This step is required only for withdrawing fiat from your Go Account to a BitGo-approved bank account. Crypto withdrawals skip this step.
Endpoint: List Bank Accounts
export ENTERPRISE_ID="<ENTERPRISE_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X GET \
https://app.bitgo-test.com/api/v2/bankaccounts?enterpriseId=$ENTERPRISE_ID \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN"
Step Result
BitGo identifies your bank account with a unique idHash
that you can pass as the address
value in the next step. You also receive information about the available payment rails and associated bank fees.
{
"bankAccounts": [
{
"type": "wire", // available payment rails vary by bank and region
"accountNumber": "012345678",
"address1": "test",
"address2": "test",
"enterpriseId": "1032e75c451052000436831deb797af1",
"id": "60749ab75f8c4500060f5a8b244dd0cb",
"name": "My Bank",
"owner": {
"name": "test",
"address1": "test",
"address2": "test"
},
"idHash": "c2f4cf5555a66d77",
"routingNumber": "087654321",
"shortCountryCode": "US",
"verificationState": "approved",
"fee": { // fees vary by payment rail and bank
"amount": "string",
"individualFees": [
{
"type": "static",
"amount": "string"
}
]
},
"feeInfo": {
"coin": "fiatusd",
"bank": "silvergate",
"type": "static",
"amount": "string"
},
}
]
}
2. Build Transaction
To withdraw assets from your Go Account to another wallet, you must build a transaction and send the assets, on chain. However, if you're withdrawing to another Go Account, the withdrawal occurs off chain, with BitGo simply updating the ledger.
Endpoint: Build a Transaction
export COIN="<ASSET_ID>" # Asset IDs in Go Accounts always start with "ofc" (such as ofctbtc4)
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"
export ADDRESS="<DESTINATION_ADDRESS_OR_ID_HASH>" # If withdrawing fiat to a bank account, use the `idHash`, returned in the prior step
curl -X POST \
https://app.bitgo-test.com/api/v2/$COIN/wallet/$WALLET_ID/tx/build \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"recipients": [
{
"amount": "'"$AMOUNT"'",
"address": "'"$ADDRESS"'"
}
]
}'
let params = {
recipients: [
{
amount: 1000,
address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',
// Use address when sending to a wallet on chain
walletId: '654ec786c07fe6dc0dcfe03916ec4bb0',
// Use walletId when sending to another Go Account off chain
},
],
};
wallet.prebuildTransaction(params).then(function (transaction) {
// print transaction details
console.dir(transaction);
});
Step Result
{
"payload": "{\"coin\":\"ofctbtc4\",\"recipients\":[{\"address\":\"tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t\",\"amount\":\"1\"}],\"fromAccount\":\"62c5b1de8a0c5200071c9a603bdbadc5\",\"nonce\":\"d8e5d930-f827-42b1-ad85-40544dad1be6\",\"timestamp\":\"2025-06-25T17:45:56.394Z\",\"feeString\":\"0\",\"shortCircuitBlockchainTransfer\":false,\"isIntraJXTransfer\":false}",
"feeInfo": { "feeString": "0" },
"coin": "ofc",
"token": "ofctbtc4"
}
3. Authenticate Transaction
Use your Go Account passphrase to authenticate the transaction. To ensure your passphrase isn't passed over the Internet, so you must use BitGo Express in external-signing mode or the JavaScript SDK. If you're using Express in external signing-mode, configure your Go Account passphrase as the WALLET_<walletId>_PASSPHRASE
environment variable.
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export WALLET_ID="<YOUR_WALLET_ID>"
export WALLET_PASSPHRASE="<YOUR_GO_ACCOUNT_PASSPHRASE>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/ofc/signPayload \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"walletId": "'"$WALLET_ID"'",
"walletPassphrase": "'"$WALLET_PASSPHRASE"'",
"payload": "{\"coin\":\"ofctbtc4\",\"recipients\":[{\"address\":\"tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t\",\"amount\":\"190000\"}],\"fromAccount\":\"67ab85b5190bf872e84da2b6e527d9f3\",\"nonce\":\"77d91a11-a7fa-4ad7-91e5-f054328717f9\",\"timestamp\":\"2025-06-26T15:02:06.924Z\",\"feeString\":\"0\",\"shortCircuitBlockchainTransfer\":false,\"isIntraJXTransfer\":false}"
}
// assuming that "bitgo" is an already initialized bitgo instance
const wallet = await bitgo.coin('ofc').wallets().get({ id: goAccountId });
if (wallet === undefined) {
throw new Error(`Could not find OFC wallet ${goAccountId}`);
}
const walletPassphrase = "<YOUR_WALLET_PASSPHRASE>";
const tradingAccount = wallet.toTradingAccount();
const stringifiedPayload = JSON.stringify(<payload_returned_by_tx/build_api>);
const signature = await tradingAccount.signPayload({
payload: stringifiedPayload,
walletPassphrase,
});
Step Result
{
"coin": "ofctbtc4",
"recipients": [
{
"address": "tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t",
"amount": "1"
}
],
"fromAccount": "62c5b1de8a0c5200071c9a603bdbadc5",
"nonce": "77d91a11-a7fa-4ad7-91e5-f054328717f9",
"timestamp": "2025-06-26T15:02:06.924Z",
"feeString": "0",
"shortCircuitBlockchainTransfer": false,
"isIntraJXTransfer": false,
"payload": "{\"coin\":\"ofctbtc4\",\"recipients\":[{\"address\":\"tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t\",\"amount\":\"1\"}],\"fromAccount\":\"62c5b1de8a0c5200071c9a603bdbadc5\",\"nonce\":\"77d91a11-a7fa-4ad7-91e5-f054328717f9\",\"timestamp\":\"2025-06-26T15:02:06.924Z\",\"feeString\":\"0\",\"shortCircuitBlockchainTransfer\":false,\"isIntraJXTransfer\":false}",
"signature": "20dda1e9558adb297f69020f94cbf4955fabec73478506347dbb5ac8e73b506fc908bbc48bde75b339b99f5de808ed34b2017055c9df198fd1f8b4e524899f9583"
}
4. Send Transaction
The following examples withdraw crypto to a crypto wallet and fiat to a bank account. However, you can also withdraw fiat to another Go Account, if the recipient address is whitelisted.
Endpoint: Send a Half-Signed Transaction
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/tx/send" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"halfSigned": { # pass the payload you received in the proir step
"coin": "ofctbtc4",
"recipients": [
{
"address": "tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t",
"amount": "1"
}
],
"fromAccount": "62c5b1de8a0c5200071c9a603bdbadc5",
"nonce": "77d91a11-a7fa-4ad7-91e5-f054328717f9",
"timestamp": "2025-06-26T15:02:06.924Z",
"feeString": "0",
"shortCircuitBlockchainTransfer": false,
"isIntraJXTransfer": false,
"payload": "{\"coin\":\"ofctbtc4\",\"recipients\":[{\"address\":\"tb1q5mwcr2749nnm5c5d6rzx5h92l2u9ex5jzygzd39vfv9qerj5fmjqwlgy4t\",\"amount\":\"1\"}],\"fromAccount\":\"62c5b1de8a0c5200071c9a603bdbadc5\",\"nonce\":\"77d91a11-a7fa-4ad7-91e5-f054328717f9\",\"timestamp\":\"2025-06-26T15:02:06.924Z\",\"feeString\":\"0\",\"shortCircuitBlockchainTransfer\":false,\"isIntraJXTransfer\":false}",
"signature": "20dda1e9558adb297f69020f94cbf4955fabec73478506347dbb5ac8e73b506fc908bbc48bde75b339b99f5de808ed34b2017055c9df198fd1f8b4e524899f9583"
}
}'
export WALLET_ID="<YOUR_WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ADDRESS="<ID_HASH>"
export AMOUNT="<AMOUNT_IN_BASE_UNITS>"
curl -X POST \
https://app.bitgo-test.com/api/v2/ofctusd/wallet/$WALLET_ID/tx/send \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"recipients": [
{
"address": "'"$ADDRESS"'",
"amount": "'"$AMOUNT"'"
}
],
"halfSigned": {
"payload": {
"coin": "ofctusd",
"recipients": [
{
"address": "'"$ADDRESS"'",
"amount": "'"$AMOUNT"'"
}
],
"fromAccount": "<wallet id>",
"nonce": "f4af25d0-a037-4afc-8ce6-d7f158d826d1",
"timestamp": "2021-09-10T22:45:20.777Z",
"idfSignedTimestamp": "2021-09-10T22:45:20.113Z",
"idfVersion": 1,
"idfUserId": "<user id>",
"feeString": "1000"
},
"signature": "<signature>"
}
}'
Step Result
{
"error": "address(es) on advanced whitelist are missing verification",
"pendingApproval": {
"id": "65155c4a72fddb000774edbee5fa75fd",
"coin": "ofctbtc",
"wallet": "63ff43c474598902272894f328452ad7",
"enterprise": "63f31592e277e50837712300495902c7",
"creator": "628ca09d1b78a6022750254f0777561a",
"createDate": "2023-09-28T10:58:18.272Z",
"info": {
"type": "transactionRequest",
"transactionRequest": {
"coinSpecific": {
"ofctbtc": {
"payload": {
"coin": "ofctbtc",
"recipients": [
{
"address": "2NDBpypweakRZzgbWqxEK42pnxgfYzd5iuY",
"amount": "10000"
}
],
"fromAccount": "63ff43c474598902272894f328452ad7",
"nonce": "80bc93b5-eeec-4c11-afca-f6dae4bba2f2",
"timestamp": "2023-09-28T10:55:39.135Z",
"idfSignedTimestamp": "2023-09-28T10:55:38.732Z",
"idfVersion": 1,
"idfUserId": "628ca09d1b78a6022750254f0777561a",
"feeString": "0",
"shortCircuitBlockchainTransfer": true,
"isIntraJXTransfer": true
},
"signature": "1f989926e3fc8ed0138bd0e188e90e2c5321ef86734896886c004005740a005dfd2008142dbc48aee68d1f576c4a9ac558e5b7b4acbd5aa765710ea636aca9d032",
"transactionType": "BOOK_TRANSFER"
}
},
"verificationItems": ["2NDBpypweakRZzgbWqxEK42pnxgfYzd5iuY"],
"videoApprovers": [],
"comment": "BTC tx build",
"requestedAmount": "10000",
"fee": 0,
"sourceWallet": "63ff43c474598902272894f328452ad7",
"recipients": [
{
"_id": "65155c4a68fddb000865edbf",
"address": "2NDBpypweakRZzgbWqxEK42pnxgfYzd5iuY",
"amount": "10000"
}
],
"buildParams": {
"comment": "BTC tx build"
},
"policyUniqueId": "63ff43c474558903072894f7",
"verificationRuleId": "Offchain Wallet Whitelist"
}
},
"state": "pendingVideoApproval",
"scope": "wallet",
"userIds": [
"628ca09d1b78a6022750254f0777561a",
"5bd8bdb0925d7c9823d4fc823e9e2fd3"
],
"approvalsRequired": 1,
"singleRunResults": [
{
"_id": "65145c4a72fddb001865edc0",
"ruleId": "Custody Enterprise Transaction ID Verification",
"triggered": false
}
],
"resolvers": []
},
"triggeredPolicy": "63ff43c474598900562194f765fd68ff"
}
{
"transfer": {
"id": "<id>",
"coin": "ofctusd",
"wallet": "<wallet id>",
"walletType": "trading",
"enterprise": "603ca88c44f82002560378421dc7a191",
"txid": "ddd6875812fa59f899a68059ff303bfa6d39fc350ee687c407383d0444b43d2b",
"height": 999999999,
"heightId": "999999999-613be001f3de560006842d52251d5d49",
"date": "2021-09-10T22:45:21.342Z",
"type": "send",
"value": -10000,
"valueString": "-10000",
"baseValue": -10000,
"baseValueString": "-10000",
"feeString": "0",
"payGoFee": 0,
"payGoFeeString": "0",
"usd": -100,
"usdRate": 1,
"state": "signed",
"instant": false,
"isReward": false,
"isFee": false,
"tags": [
"603ca8c01b83cb000656311787dab4cd",
"603ca88c44f82002560378421dc7a191"
],
"history": [
{
"date": "2021-09-10T22:45:21.340Z",
"action": "signed"
},
{
"date": "2021-09-10T22:45:21.216Z",
"user": "5e4ed695ae2e542100336fb16e586019",
"action": "created"
}
],
"signedDate": "2021-09-10T22:45:21.340Z",
"entries": [
{
"address": "address",
"wallet": "603ca8c01b83cb000656311787dab4cd",
"value": -10000,
"valueString": "-10000"
},
{
"address": "bf6cc5252438dc85",
"value": 10000,
"valueString": "10000"
}
],
"signedTime": "2021-09-10T22:45:21.340Z",
"createdTime": "2021-09-10T22:45:21.216Z"
},
"txid": "ddd6875812fa59f899a68059ff303bfa6d39fc350ee687c407383d0444b43d2b",
"tx": {
"transaction": {
"coin": "ofctusd",
"recipients": [
{
"address": "<bank id hash>",
"amount": "10000"
}
],
"fromAccount": "<wallet id>",
"nonce": "f4af25d0-a037-4afc-8ce6-d7f158d826d1",
"timestamp": "2021-09-10T22:45:20.777Z",
"idfSignedTimestamp": "2021-09-10T22:45:20.113Z",
"idfVersion": 1,
"idfUserId": "<user id>",
"feeString": "0"
},
"signature": "<signature>",
"idfVersion": 1,
"idfSignedTimestamp": "2021-09-10T22:45:20.113Z",
"idfUserId": "<user id>"
},
"status": "signed"
}
5. Approve Transaction (Optional)
Endpoint: Update Pending Approval
export COIN="<ASSET_ID>"
export APPROVAL_ID="<APPROVAL_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export OTP="<OTP>"
curl -X POST \
http://api/v2/$COIN/pendingapprovals/$APPROVAL_ID
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"state": "approved",
"otp": "'"$OTP"'"
}'
const baseCoin = this.bitgoSDK.coin(initialPendingApproval.coin);
const pendingApproval = await baseCoin.pendingApprovals().get({ id: initialPendingApproval.id });
const result = await pendingApproval.approve(params);
Step Result
Once approved, BitGo rebuilds the unsigned transaction, applying the most up-to-date fees.
{
"id": "655686880765186f0b3e9e88e1bdd0f4",
"coin": "tbtc4",
"wallet": "6553e933288be490293ae748efafeaaf",
"enterprise": "62c5ae8174ac860007aff138a2d74df7",
"creator": "62ab90e06dfda30007974f0a52a12995",
"createDate": "2023-11-16T21:15:52.703Z",
"info": {
"type": "transactionRequest",
"transactionRequest": {
"requestedAmount": "10000",
"fee": 45242,
"sourceWallet": "6553e933288be490293ae748efafeaaf",
"policyUniqueId": "6553e933288be490293ae753",
"recipients": [
{
"address": "2N3sBpM1RnWRMXnEVoUWnM7xtYzL756JE2Q",
"amount": "10000",
"_id": "655686880765186f0b3e9e8a"
}
],
"buildParams": {
"recipients": [
{
"address": "2N3sBpM1RnWRMXnEVoUWnM7xtYzL756JE2Q",
"amount": "10000"
}
]
},
"coinSpecific": {
"tbtc4": {
"txHex": "01000000000101eac5e7d68acfc2349672fb99094e79c2006e5fd663475c8f1eb6f29095970b740100000000ffffffff02102700000000000017a914747e6b7f5db53794b0fc01d95878e0f9b6db96738746c1020000000000220020efb9deaabeab5d62cecc363f24cd6deafcdd14d93d8734f7f01ed3953e732a640500483045022100cd6c221e4cefbb51aa82087d86e7d089b2473eb21ae809dba89eb9f13c4caf19022000f3b7f1b7fec2dc49cbfce35baa69ca37ab9ee8e51c779cde5b98a653f3e142010000695221029bde55661e4f359cf9ca2d1846c235e752f760ed6d65e2018f821253e78b3c722103f2b4a813ab79e4fb46edf3a6a87fb154a85b45810158e949f41a3fce3c9bf574210399a6d766f6d3a3843f8479446ee766b5745dc15c24d1db5149214d27987bd29453ae00000000"
}
},
"validTransaction": "01000000000101eac5e7d68acfc2349672fb99094e79c2006e5fd663475c8f1eb6f29095970b740100000000ffffffff02102700000000000017a914747e6b7f5db53794b0fc01d95878e0f9b6db96738746c1020000000000220020efb9deaabeab5d62cecc363f24cd6deafcdd14d93d8734f7f01ed3953e732a640400483045022100cd6c221e4cefbb51aa82087d86e7d089b2473eb21ae809dba89eb9f13c4caf19022000f3b7f1b7fec2dc49cbfce35baa69ca37ab9ee8e51c779cde5b98a653f3e14201473044022002b246c43722fec49858caf6b0605a0d01a6b6c13c964b84bf272604fd3951780220324ee44ba3ce8febb154c317e688a5f6ed410ad8e2bd77c5678bf1f7f3eb45f601695221029bde55661e4f359cf9ca2d1846c235e752f760ed6d65e2018f821253e78b3c722103f2b4a813ab79e4fb46edf3a6a87fb154a85b45810158e949f41a3fce3c9bf574210399a6d766f6d3a3843f8479446ee766b5745dc15c24d1db5149214d27987bd29453ae00000000",
"validTransactionHash": "ff40ccd5c8ba75ffdce27d8584b6e8ee625cb3f71f7cbb6d072a445a97c2c8c3"
}
},
"state": "approved",
"scope": "wallet",
"userIds": [
"62ab90e06dfda30007974f0a52a12995",
"627ff9325a5c1b0007c05a40d15e1522"
],
"approvalsRequired": 1,
"singleRunResults": [
{
"ruleId": "Custody Enterprise Transaction ID Verification",
"triggered": false,
"_id": "655686880765186f0b3e9e89"
}
],
"resolvers": [
{
"user": "627ff9325a5c1b0007c05a40d15e1522",
"date": "2023-11-16T21:33:24.644Z",
"resolutionType": "pending"
}
]
}
Next
Depending on your Go Account policies, you may need to conduct video verification with a BitGo operator. If so, log in to BitGo and schedule video ID verification. Once verification completes, or if verification isn't required, BitGo signs the transaction and broadcasts it to the blockchain. You can view your completed withdrawal in BitGo or on a blockchain explorer.
See Also
Updated 8 days ago