Sign wallet transaction


Sign transactions for multisignature wallets using external-signing mode. You must maintain your keys, in the clear, on a separate Express server. BitGo doesn't decrypt your private keys.

Path Parameters

  • coinstringRequired
    A cryptocurrency or token ticker symbol.
    Example: "btc"
  • walletIdstringRequired
    Example: "59cd72485007a239fb00282ed480da1f"
    Pattern: ^[0-9a-f]{32}$

Request Body

keychain object
The user's keychain object with an "encryptedPrv" property. The "walletPassphrase" parameter is required when using "keychain". Any request must include either "keychain" or "prv".
encryptedPrv string
Encrypted user private key
prv string
User private key Note: The request must include either "prv" or "keychain"
Example: xprv9s21ZrQH143K3xQwj4yx3fHjDieEdqFDweBvFxn28qGvfQGvweUWuUuDRpepDu6opq3jiWHU9h3yYTKk5vvu4ykRuGA4i4Kz1vmFMPLTsoC
txPrebuild object
The transaction description object as created by 'Build Transaction'
wallet string
Example: 59cd72485007a239fb00282ed480da1f
Match pattern: ^[0-9a-f]{32}$
txHex string
Serialized transaction hex
txBase64 string
Serialized transaction base64 (applies to XLM only). <br/> The request must include this or a txHex
txInfoOne of
txInfo (UTXO)
feeInfoOne of
feeInfo (UTXO)
coldDerivationSeed string
A seed used to create a deterministic BIP-32 path which is then used to derive a private key. This is useful when one wants to create multiple BitGo cold wallets but only protect a single master private key. Using the seed one can create a child key for a specific wallet, for instance an Ethereum wallet could use the "eth" seed while an XRP wallet could use "xrp" as a seed. Both of these child keys would be derived from a single master key and so only the master key needs to be stored and protected.
walletPassphrase string
Passphrase to decrypt the user keychain. "walletPassphrase" is a required parameter when the parameter "keychain" is provided.
recipients array[object]
Array of objects describing the recipients. See buildTransaction for more detail. Required on ETH.
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 let params = { txPrebuild: { txHex: '010000000179b0b5ad6641de8fed13270395e52515236c922d1dd5bee3a9dae68c3cbbf57d0100000000ffffffff0240420f000000000017a914f600974688ccdf5e72ce3f2b187afabbf4f1d3ec878e7835000000000017a9140c0a513cb9d8e46113c57aa46ae42d1bad29063d8700000000', txInfo: { nP2SHInputs: 1, nSegwitInputs: 0, nOutputs: 2, unspents: [ { chain: 1, index: 10, redeemScript: '52210208906f13de98b88bc9f83886c39a1555ada816b12de6f029626af2ef9413708b2102bca01320026604530fc47068ce015b39b91bd72d8964b0c5023697645b1441ab210336d8e968990c8a5b2bad83a237c37957ce70586ed507b155941ea28ec953860153ae', id: '7df5bb3c8ce6daa9e3bed51d2d926c231525e595032713ed8fde4166adb5b079:1', address: '2MvevrYxML8NkRng4avXz7oMCgs5qxR7Mef', value: 4508000, }, ], changeAddresses: ['2MtLtTSsC98dF4zriFGvCfmce3A17Zz1McK'], }, feeInfo: { size: 373, fee: 3730, feeRate: 10000, payGoFee: 0, payGoFeeString: '0', }, }, prv: 'xprvmysecretprivatekey', }; wallet.signTransaction(params).then(function (transaction) { // print half-signed transaction hex console.dir(transaction); });

200 Response

txInfoOne of
txHex string
Serialized transaction hex
Example: 01000000000101d58f82d996dd872012675adadf4606734906b25a413f6e2ee535c0c10aef96020000000000ffffffff028de888000000000017a914c91aa24f65827eecec775037d886f2952b73cbe48740420f000000000017a9149304d18497b9bfe9532778a0f06d9fff3b3befaf870500473044022023d7210ba6d8bbd7a28b8af226f40f7235caab79156f93f9c9969fc459ea7f73022050fbdca788fba3de686b66b3501853695ff9d6f375867470207d233b099576e001000069522103d4788cda52f91c1f6c82eb91491ca76108c9c5f0839bc4f02eccc55fedb3311c210391bcef9dcc89570a79ba3c7514e65cd48e766a8868eca2769fa9242fdcc796662102ef3c5ebac4b54df70dea1bb2655126368be10ca0462382fcb730e55cddd2dd6a53aec8b11400

400 Response

One of
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