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. Build Transaction

Withdrawals from your Go Account differ by asset and destination. Notably, withdrawing fiat currency to your whitelisted bank account requires a wire transfer. BitGo charges a $16 wire-transfer fee (for US-based banks). Your bank may charge a wire-transfer fee too. Contact your bank to learn more.

  • Withdraw Crypto
  • Withdraw Fiat

To withdraw coins and tokens from your Go Account to another wallet, you must build a transaction and send the assets, on chain. However, if you withdraw to another Go Account, the withdraw occurs off chain.

Endpoint: Build a Transaction

  • cURL
  • JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 export COIN="<ASSET_ID>" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export AMOUNT="<AMOUNT_IN_BASE_UNITS>" export ADDRESS="<DESTINATION_ADDRESS>" 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 '{ "comment": "BTC tx build", "idfSignedTimestamp": "2023-09-28T10:55:38.732Z", "idfUserId": "628ca09d1b78a6022750254f0777561a", "idfVersion": 1, "instant": false, "preview": false, "recipients": [ { "amount": "'"$AMOUNT"'", "address": "'"$ADDRESS"'" # If sending to another Go Account, use the walletId parameter instead } ], "sequenceId": "4dEeycHsDSsCAG1zYPKGSxyPkHQ" }'

Step Result

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 { "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 }, "feeInfo": { "feeString": "0" }, "coin": "ofc", "token": "ofctbtc" }

2. Send Transaction

The following examples show withdrawing crypto asset to crypto wallet and withdrawing 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

  • cURL (Crypto to Wallet)
  • cURL (Fiat to Bank Account)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 export COIN="<ASSET_ID>" export WALLET_ID="<YOUR_WALLET_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export AMOUNT="<AMOUNT_IN_BASE_UNITS>" export ADDRESS="<DESTINATION_ADDRESS>" 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 '{ "comment": "BTC tx build", "halfSigned": { "payload": { "coin": "ofctbtc", "recipients": [ { "amount": "'"$AMOUNT"'", "address": "'"$ADDRESS"'" # If sending to another Go Account, use the walletId parameter instead } ], "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" } }'

Step Result

  • JSON (Crypto to Wallet)
  • JSON (Fiat to Bank Account)
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 { "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" }

3. Approve Transaction (Optional)

Endpoint: Update Pending Approval

  • cURL
  • JavaScript
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 export COIN="<ASSET_ID>" export APPROVAL_ID="<APPROVAL_ID>" export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>" export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>" export XPRV="<XPRV>" 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", "walletPassphrase": "'"$WALLET_PASSPHRASE"'", "xprv": "'"$XPRV"'", "otp": "'"$OTP"'" }'

Step Result

Once approved, BitGo rebuilds the unsigned transaction, applying the most up-to-date fees.

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 { "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. 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