Create Go Accounts

Overview

Create a Go Account for each child enterprise in your organization to enable your users to access the Go Network and trade cryptocurrency with BitGo as their sole counterparty. To learn more about the Go Accounts and the Go Network, see BitGo Wallet Types and Go Network Overview.

Creating Go Accounts for child enterprises is similar to creating other wallet types for your own enterprise. However, there are some key differences and steps, outlined below.

Prerequisites

1. Create Keys

Create the public and private keys for your user's Go Account.

Endpoint: Create Key

  • cURL
  • JaveScript
1 2 3 4 5 6 7 export BITGO_EXPRESS_HOST="YOUR_LOCAL_HOST" export ACCESS_TOKEN="YOUR_ACCESS_TOKEN" curl -X POST \ "http://$BITGO_EXPRESS_HOST:3080/api/v2/ofc/keychain/local" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN"

Step Result

  • JSON
1 2 3 4 { "pub": "xpub661MyMwAqRbcEq5qQLciVPfCyCvx9KstKVp71TxujjY9Kbapv6o2YjtRAV1tfYgQZxBaN6FfFfE3CD21ZRSsd4WkqkFWSZDTiDqf49qtkh7", "prv": "xprv9s21ZrQH143K2M1NJK5i8FiURB6TjsA2xGtWD5ZJBQ1ASoFgNZUmzwZwKC9WnyRaN2f4uAdHPdMmLbw2SsUKa6J2bWUEWihbMKcrhJSZueH" }

2. Encrypt Keys

Use your Bitgo login password to encrypt the private key, prv, that you created in the prior step.

Endpoint: Encrypt Messages

  • cURL
1 2 3 4 5 6 7 8 9 10 11 12 13 export BITGO_EXPRESS_HOST="YOUR_LOCAL_HOST" export ACCESS_TOKEN="YOUR_ACCESS_TOKEN" export INPUT="PRV_KEY" export PASSWORD="YOU_BITGO_LOPGIN_PASSWORD" curl -X POST \ "http://$BITGO_EXPRESS_HOST:3080/api/v2/encrypt" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "input": "'"$INPUT"'", "password": "'"$PASSWORD"'" }'

Step Result

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 { "encrypted": { "iv": "YRvtB4SoQN2eOyWpdS6noA==", "v": 1, "iter": 10000, "ks": 256, "ts": 64, "mode": "ccm", "adata": "", "cipher": "aes", "salt": "2Nqa5ra4XYM=", "ct": "CrSFjkrOufzhlRbTjh0Yz8ShBDViWpDXtZ3FAdD/Vyq3BMAxjTSjknDGtbW4yhs6uiFcgsCELYcj8rddBnTya6YJvtYDYvX/F2NHEFPAcJ7MuuWv80f2X/+SgMVyJ/qgHH/pqw8Sv4eOv0EUUrU4Yr+N8yk9XU4=" } }

3. Upload Keys

Upload to BitGo the public key, xpub, you created in Step 1 and the encrypted private key, encryptedPrv, you created in Step 2.

Endpoint: Create Key

  • cURL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 export ACCESS_TOKEN="YOUR_ACCESS_TOKEN" curl -X POST \ "https://app.bitgo-test.com/api/v2/ofc/key" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "encryptedPrv": { "iv": "YRvtB4SoQN2eOyWpdS6noA==", "v": 1, "iter": 10000, "ks": 256, "ts": 64, "mode": "ccm", "adata": "", "cipher": "aes", "salt": "2Nqa5ra4XYM=", "ct": "CrSFjkrOufzhlRbTjh0Yz8ShBDViWpDXtZ3FAdD/Vyq3BMAxjTSjknDGtbW4yhs6uiFcgsCELYcj8rddBnTya6YJvtYDYvX/F2NHEFPAcJ7MuuWv80f2X/+SgMVyJ/qgHH/pqw8Sv4eOv0EUUrU4Yr+N8yk9XU4=" }, "source": "user", "originalPasscodeEncryptionCode": "anim", "pub": "xpub661MyMwAqRbcFiU9xs5UzYPhgSnx4s55pSeB5FKgLAXG8xn8kdZCfbZ5fLSf8NpntDLjGcQW4oR1xiNMc21bLHbvBzPdsVy75JkRxEqtT6E" }'

Step Result

You receive a key ID, id, that you must pass in the next step.

  • JSON
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 { "id": "63ee42c723f584000746d0057a2fb075", "pub": "xpub661MyMwAqRbcFiU9xs5UzYPhgSnx4s55pSeB5FKgLAXG8xn8kdZCfbZ5fLSf8NpntDLjGcQW4oR1xiNMc21bLHbvBzPdsVy75JkRxEqtT6E", "ethAddress": "0x098a57ddc2ce053bd73dd4d6f7f71004be082b4f", "source": "user", "type": "independent", "encryptedPrv": { "iv": "YRvtB4SoQN2eOyWpdS6noA==", "v": 1, "iter": 10000, "ks": 256, "ts": 64, "mode": "ccm", "adata": "", "cipher": "aes", "salt": "2Nqa5ra4XYM=", "ct": "CrSFjkrOufzhlRbTjh0Yz8ShBDViWpDXtZ3FAdD/Vyq3BMAxjTSjknDGtbW4yhs6uiFcgsCELYcj8rddBnTya6YJvtYDYvX/F2NHEFPAcJ7MuuWv80f2X/+SgMVyJ/qgHH/pqw8Sv4eOv0EUUrU4Yr+N8yk9XU4=" } }

4. Create Go Account

Endpoint: Add Wallet

  • cURL
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 export ACCESS_TOKEN="YOUR_ACCESS_TOKEN" export LABEL="DESIRED_WALLET_NAME" export ENTERPRISE_ID="YOUR_ENTERPRISE_ID" export KEYS="KEY_ID" curl -X POST \ "https://app.bitgo-test.com/api/v2/ofc/wallet" \ -H "Content-Type: application/json" \ -H "Authorization: Bearer $ACCESS_TOKEN" \ -d '{ "label": "'"$LABEL"'", "enterprise": "'"$ENTERPRISE_ID"'", "type": "trading", "m": 1, "n": 1, "keys": ["'"$KEYS"'"] }'

Step Result

You created a Go Account for your user's child enterprise.

  • 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 { "id": "62e18ee98b38310008a830927220dfdc", "users": [ { "user": "62ab90e06dfda30007974f0a52a12995", "permissions": [ "admin", "view", "spend" ] } ], "coin": "ofc", "label": "Trading Wallet", "m": 1, "n": 1, "keys": ["63ee42c723f584000746d0057a2fb075"], "keySignatures": {}, "enterprise": "60e6229d19d3c400068bde7da6d41b6f", "tags": [ "62e18ee98b38310008a830927220dfdc", "62c5ae8174ac860007aff138a2d74df7" ], "disableTransactionNotifications": false, "freeze": {}, "deleted": false, "approvalsRequired": 1, "isCold": false, "coinSpecific": {}, "admin": {}, "clientFlags": [], "walletFlags": [], "allowBackupKeySigning": false, "recoverable": false, "startDate": "2022-07-27T19:15:53.000Z", "type": "trading", "buildDefaults": {}, "customChangeKeySignatures": {}, "hasLargeNumberOfAddresses": false, "multisigType": "onchain", "config": {}, "balance": 0, "confirmedBalance": 0, "spendableBalance": 0, "balanceString": "0", "confirmedBalanceString": "0", "spendableBalanceString": "0", "pendingApprovals": [] }

Next Steps

Enable your users to fund their Go Account, place trade orders, and withdraw their assets:

  1. Fund Go Account
  2. Place Trade Orders
  3. Withdraw from Go Account (Advanced) or Withdraw from Go Account (Simple)

See Also