Create MPC Keys - EdDSA

Create MPC key shares for EdDSA assets by exchanging shares between parties. See the Guide.

  1. Set up the BitGo SDK to generate EdDSA key shares. You initialize the MPC library, generate a GPG key pair for encrypting private share material, and retrieve the BitGo public key for secure key exchange.

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

    API Reference

  2. Generate the user key shares. The user key share (party index 1) contains a uShare (your private share) and yShares to distribute to the backup and BitGo parties.

    API Reference

  3. Generate the backup key shares. The backup key share (party index 2) contains a uShare and yShares to distribute to the user and BitGo parties. Unlike multisignature wallets, you must manage the backup key yourself.

    API Reference

  4. Send the user and backup key shares to BitGo so it can create its own key share (party index 3). You encrypt the private shares using the BitGo GPG public key before sending. BitGo returns BitGo-to-user and BitGo-to-backup shares, the commonKeychain, and a key id.

    This response contains critical key material. Save it in a secure place.

    API Reference

  5. Combine the user's own share with the backup and BitGo shares to create the user keychain. You must verify that the derived commonKeychain matches the one BitGo returned. The SDK encrypts the combined key material with your passphrase and uploads it to BitGo.

    This response contains critical key material. Save it in a secure place.

    API Reference

  6. Combine the backup share with the user and BitGo shares to create the backup keychain. Verify the derived commonKeychain matches. Store the backup signing material locally — do not upload it to BitGo. BitGo registers only the public commonKeychain reference.

    This response contains critical key material. Save it in a secure place.

    API Reference

// 1. Set Up SDK
// Use the JavaScript SDK for this step (see JavaScript tab)
// 2. Create User Key Shares
// Use the JavaScript SDK for this step (see JavaScript tab)
// 3. Create Backup Key Shares
// Use the JavaScript SDK for this step (see JavaScript tab)
// 4. Create BitGo Keychain
export COIN="<ASSET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
export ENTERPRISE_ID="<ENTERPRISE_ID>"

curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/key \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "keyType":"tss",
    "source": "bitgo",
    "enterprise": "'"$ENTERPRISE_ID"'",
    "keyShares": [
      {
        "from": "user",
        "to": "bitgo",
        "publicShare": "<USER_PUBLIC_SHARE>",
        "privateShare": "<PGP_ENCRYPTED_PRIVATE_SHARE>",
        "privateShareProof": "<PGP_PUBLIC_KEY_BLOCK>"
      },
      {
        "from": "backup",
        "to": "bitgo",
        "publicShare": "<BACKUP_PUBLIC_SHARE>",
        "privateShare": "<PGP_ENCRYPTED_PRIVATE_SHARE>",
        "privateShareProof": "<PGP_PUBLIC_KEY_BLOCK>"
      }
    ],
    "userGPGPublicKey": "<USER_PGP_PUBLIC_KEY>",
    "backupGPGPublicKey": "<BACKUP_PGP_PUBLIC_KEY>"
  }'
// 5. Create User Keychain
curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/key \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "commonKeychain": "<COMMON_KEYCHAIN>",
    "encryptedPrv": "<ENCRYPTED_PRV>",
    "keyType":"tss",
    "source": "user",
    "originalPasscodeEncryptionCode": "<CODE>"
  }'
// 6. Create Backup Keychain
curl -X POST \
  https://app.bitgo-test.com/api/v2/$COIN/key \
  -H 'Content-Type: application/json' \
  -H "Authorization: Bearer $ACCESS_TOKEN" \
  -d '{
    "commonKeychain": "<COMMON_KEYCHAIN>",
    "encryptedPrv": "<ENCRYPTED_PRV>",
    "keyType":"tss",
    "source": "backup"
  }'
Response
// 2. Create User Key Shares Response
{
  "uShare": {
    "i": 1,
    "t": 2,
    "n": 3,
    "y": "9a9c57f85a74eae15a57401b6467a3198743d56768d1273bf1d6cf5db147bea9",
    "seed": "0350cb2e4d7409745d84b79ca5fa7f5ca6a18a743ad61ea1e5b405828e66882f",
    "chaincode": "03c10c0e45befd366720ea8ac8fb0f4c313f99ef9b08a1e18e474d05a8e8c522"
  },
  "yShares": {
    "2": {
      "i": 2,
      "j": 1,
      "y": "9a9c57f85a74eae15a57401b6467a3198743d56768d1273bf1d6cf5db147bea9",
      "u": "1b9932507b5d4b522dfd37f6341f58afe85dacb8e5208df18a59e6420e269b03",
      "chaincode": "03c10c0e45befd366720ea8ac8fb0f4c313f99ef9b08a1e18e474d05a8e8c522"
    },
    "3": {
      "i": 3,
      "j": 1,
      "y": "9a9c57f85a74eae15a57401b6467a3198743d56768d1273bf1d6cf5db147bea9",
      "u": "da1db2fb700e1d17511176da6d3c42089c5da339bc4a1018a1547f5972afc201",
      "chaincode": "03c10c0e45befd366720ea8ac8fb0f4c313f99ef9b08a1e18e474d05a8e8c522"
    }
  }
}

// 3. Create Backup Key Shares Response
{
  "uShare": {
    "i": 2,
    "t": 2,
    "n": 3,
    "y": "c882eaf251d330d9871de9abc12723067951febb0f6c3c2aa4413460d1ecec82",
    "seed": "90251953dd94f6d79136b5b85691e909592f8f01711607b80054e2b3c3399db6",
    "chaincode": "280b166e7e9b8ebff854721906f438d3f54bd7f68838be4059008687c9a2948b"
  },
  "yShares": {
    "1": {
      "i": 1,
      "j": 2,
      "y": "c882eaf251d330d9871de9abc12723067951febb0f6c3c2aa4413460d1ecec82",
      "u": "1f06d6d087a5b9e9d9dd681daf4d54a2c26ead32c4c5af1a6ed3087a394e330f",
      "chaincode": "280b166e7e9b8ebff854721906f438d3f54bd7f68838be4059008687c9a2948b"
    },
    "3": {
      "i": 3,
      "j": 2,
      "y": "c882eaf251d330d9871de9abc12723067951febb0f6c3c2aa4413460d1ecec82",
      "u": "461c7ab528d4fe0048a351733fae0fd728ada5fd2d87a0dbc2f42f494f9cb801",
      "chaincode": "280b166e7e9b8ebff854721906f438d3f54bd7f68838be4059008687c9a2948b"
    }
  }
}

// 4. Create BitGo Keychain Response
{
  "id": "62fd86fcf9ce8e00083e1f6ea215960f",
  "source": "bitgo",
  "keyType": "tss",
  "commonKeychain": "2b4a206676f076cdd3586716ee6f39c15218f3c4f4b6fdfa97f1e088891903c89c4b412a8a9eaec9461b64e25c4c024eb043aca4d3d41c4bd043981e7da019f8",
  "isBitGo": true,
  "keyShares": [
    {
      "from": "user",
      "to": "bitgo",
      "publicShare": "<PUBLIC_SHARE_HEX>",
      "privateShare": "<PGP_ENCRYPTED_CONTENT>"
    },
    {
      "from": "backup",
      "to": "bitgo",
      "publicShare": "<PUBLIC_SHARE_HEX>",
      "privateShare": "<PGP_ENCRYPTED_CONTENT>"
    },
    {
      "from": "bitgo",
      "to": "user",
      "publicShare": "<PUBLIC_SHARE_HEX>",
      "privateShare": "<PGP_ENCRYPTED_CONTENT>"
    },
    {
      "from": "bitgo",
      "to": "backup",
      "publicShare": "<PUBLIC_SHARE_HEX>",
      "privateShare": "<PGP_ENCRYPTED_CONTENT>"
    }
  ]
}

// 5. Create User Keychain Response
{
  "id": "62fd86fc61fd1f00085664fa62f19d64",
  "source": "user",
  "keyType": "tss",
  "commonKeychain": "2b4a206676f076cdd3586716ee6f39c15218f3c4f4b6fdfa97f1e088891903c89c4b412a8a9eaec9461b64e25c4c024eb043aca4d3d41c4bd043981e7da019f8",
  "encryptedPrv": "<ENCRYPTED_PRV>"
}

// 6. Create Backup Keychain Response
{
  "id": "62fd86fc33275f000855f457021b5976",
  "source": "backup",
  "keyType": "tss",
  "commonKeychain": "2b4a206676f076cdd3586716ee6f39c15218f3c4f4b6fdfa97f1e088891903c89c4b412a8a9eaec9461b64e25c4c024eb043aca4d3d41c4bd043981e7da019f8"
}