Create Multisignature Keys

Create and upload public-private key pairs for self-custody multisig wallets. See the Guide.

  1. Create a public-private key pair locally on your machine. Key creation occurs entirely client side — at no point does BitGo have access to your private user or backup keys for self-custody wallets.

    Repeat this step two more times to create the backup and BitGo keys. The BitGo key pub and prv you receive are only temporary — BitGo creates the actual key pair after you upload them.

    Prerequisites: You must have a BitGo account. See Get Started.

    API Reference

  2. Upload the public keys and an encrypted version of the private keys to BitGo. Passing a value for encryptedPrv enables you to use your walletPassphrase to sign transactions from self-managed hot wallets. If omitted, signing requires passing your full, unencrypted private key.

    You receive an id for each key that you use when you create your wallet. Repeat this step to upload the backup and BitGo keys. Upon uploading the BitGo key, BitGo creates the actual public-private key pair and stores it — you can't use the BitGo key you created in step 1 to co-sign transactions.

    API Reference

// 1. Create Public and Private Keys
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"

curl -X POST \
  http://$BITGO_EXPRESS_HOST/api/v2/$COIN/keychain/local \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN"
// 2. Upload Public Keys to BitGo
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ENTERPRISE_ID="<YOUR_ENTERPRISE_ID>"
export PUB="<YOUR_PUBLIC_KEY>"
export ENCRYPTED_PRV="<YOUR_BITGO_LOGIN_PASSPHRASE>"

curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/key \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "enterprise": "'"$ENTERPRISE_ID"'",
    "source": "user",
    "pub": "'"$PUB"'",
    "encryptedPrv": "'"$ENCRYPTED_PRV"'"
  }'
Response
// 1. Create Public and Private Keys Response
{
  "pub": "xpub661MyMwAqRbcEq5qQLciVPfCyCvx9KstKVp71TxujjY9Kbapv6o2YjtRAV1tfYgQZxBaN6FfFfE3CD21ZRSsd4WkqkFWSZDTiDqf49qtkh7",
  "prv": "xprv9s21ZrQH143K2M1NJK5i8FiURB6TjsA2xGtWD5ZJBQ1ASoFgNZUmzwZwKC9WnyRaN2f4uAdHPdMmLbw2SsUKa6J2bWUEWihbMKcrhJSZueH"
}

// 2. Upload Public Keys to BitGo Response
{
  "id": "68499a2877a6825438c3339f769ee77a",
  "pub": "xpub661MyMwAqRbcGzKB8maGqFbyvCVGiuMTeRRtRH8pGZ1ozpMJPtkVL9LL6vPT2Xg6BHJCADbDg88byz6Z9eawDqSJkRMnHcQj4TrDVW5vN79",
  "ethAddress": "0x884089925e0a735027679ea14425b4b76b216f69",
  "source": "user",
  "type": "independent",
  "encryptedPrv": "VerySecurePassword1234"
}