Create key

post/api/v2/{coin}/key

Path Parameters

  • coinstringRequired
    A cryptocurrency or token ticker symbol.
    Example: "btc"

Request Body

encryptedPrv string
Private part of this key pair, encrypted with a passphrase that only the client knows. Required for all sources except "bitgo".
provider string
name of the KRS provider. Only needed for backup keys.
source string
Allowed values: backup bitgo cold user
Example: user
derivedFromParentWithSeed string
Max length: <= 250 characters
disableKRSEmail boolean
krsSpecific object
Optional extra information to pass through to the specific KRS provider
enterprise string
The Enterprise that will own this key
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
identifier string
newFeeAddress boolean
Create a new keychain instead of fetching enterprise key (only for Ethereum)
originalPasscodeEncryptionCode string
Passphrase that is used to decrypt box D on the wallet keycard
pub string
Public part of this key pair. If the key type is "independent" (default) it is required for user key and is optional for backup key. If key type is "tss" this field is not required.
Example: xpub661MyMwAqRbcGMVhmc7wqQRYMtcX9LAvSj1pjB213y5TsrkV2uuzJjWnjBrT1FUeNWGPjaVm5p7o6jdNcQJrV1cy3a1R8NQ9m7LuYKA8RpH
commonPub string
The commonPub for the key. This value is necessary for BLS keys when the source is either “user” or “backup”. Setting this indicates to BitGo that the owner of the key has received all key shares they needed for generating their key.
commonKeychain string
The commonKeychain for the key if this is a TSS key. This value is required to be set when the type is set to “tss” and when the source is either “user” or “backup”. Setting this indicates to BitGo that the owner of the key has received all key shares they needed for generating their key. This value is the common pub concatenated with the common chaincode.
keyShares array[object]
Only required for BitGo TSS keys. Those will be the shares from the user and the backup provider that BitGo will end up generating the BitGo key (share) from.
from string required
The source of the key share.
Allowed values: user backup bitgo
Example: user
to string required
The recipient of the key share.
Allowed values: user backup bitgo
Example: user
publicShare string required
Public part of the share concatenated with chain code (64+64 characters hex string).
privateShare string required
Private part of the share concatenated with chain code (64+64 characters hex string). Depending on who the source and the recipient are, the share might be encrypted against the recipient's public key.
type string
Coin name used to choose correct KRS public key for the given provider. Possible valid values are "btc", "eth", "bitcoin"
Example: eth
keyType string
A value from a string enum denoting what kind of key this is. Defaults to “independent” indicating an on-chain key is requested. If set to “tss” this tells us that a “tss” key is requested.
Allowed values: tss independent blsdkg
Default: tss
Example: tss
userGPGPublicKey string
User's public key in ASCII armored format. Only required for BitGo TSS keys.
backupGPGPublicKey string
Backup public key in ASCII armored format (may be managed by user or KRS). Only required for BitGo TSS keys.
javascript
1 2 3 4 5 6 7 8 // Create user key. let userKey = bitgo.coin('tbtc').keychains().create(); // Create BitGo key. let bitGoKey = bitgo.coin('tbtc').keychains().createBitGo(); // Create backup key. let backupKey = bitgo.coin('tbtc').keychains().createBackup({ provider: 'cme' });

200 Response

One of
encryptedPrv string
The encrypted private key
id string required
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
isBitGo boolean
"true" if this key is owned by BitGo
Example: false
source string
Allowed values: backup bitgo cold user
Example: user
type string required
A value from a string enum denoting what kind of key this is. Defaults to “independent” indicating an on-chain key is requested. If set to “tss” this tells us that a “tss” key is requested.
Allowed values: tss independent blsdkg
Default: independent
Example: tss
ethAddress string
Ethereum address associated with this key
pub string
public part of a key pair
Example: xpub661MyMwAqRbcGMVhmc7wqQRYMtcX9LAvSj1pjB213y5TsrkV2uuzJjWnjBrT1FUeNWGPjaVm5p7o6jdNcQJrV1cy3a1R8NQ9m7LuYKA8RpH

400 Response

error string required
Human-readable error message
requestId string required
Client request id
context object
Properties that apply to a specific error name
name string required
Error code