---
title: "Build a transaction"
method: POST
path: "/api/v2/{coin}/wallet/{walletId}/tx/build"
tags: ["Wallet"]
---

# Build a transaction

`POST /api/v2/{coin}/wallet/{walletId}/tx/build`

Build a transaction from the wallet using provided options. Use only with multisignature wallets. For MPC wallets, use [Create transaction request](/reference/v2wallettxrequestcreate). If you want to build, sign, and send all in one call, use [Send transaction](/reference/expresswalletsendcoins).

## Path parameters

- `coin` string, required — A cryptocurrency or token ticker symbol.
- `walletId` string, required

## Query parameters

- `destinationTag` string

## Request body

- union
  - TransactionBuildRequest
    - `type` string — Required for transactions from MPC wallets. "acceleration" speeds up transactions with a certain nonce by adjusting the gas setting. "accountSet" is for XRP AccountSet transactions. "consolidate" combines multiple UTXO inputs into fewer outputs. "enabletoken" is for SOL. "fanout" splits UTXO inputs into many smaller outputs (UTXO coins only). "stakingLock" and "stakingUnlock" are for Stacks delegations. "transfer" is for native-asset transfers. "trustline" is for Stellar trustline transactions. Possible types include: [acceleration, accountSet, consolidate, enabletoken, fanout, stakingLock, stakingUnlock, transfer, transfertoken, trustline] For AVAX, possible types include: `addValidator`, `export`, and `import`. For XRP, possible types include: `payment` and `accountSet`. The default is `payment`. For STX, type is required.
    - `messages` object[] — [UTXO only] An array of messages that you sign with the wallet keys using the BIP322 format. If passed, the `recipients` array must be empty.
      - `address` string — The address for which you're proving ownership. This address must belong to the wallet.
      - `message` string — Message that is being signed.
    - `numBlocks` integer — (BTC only) The number of blocks required to confirm a transaction. You can use `numBlocks` to estimate the fee rate by targeting confirmation within a given number of blocks. If both `feeRate` and `numBlocks` are absent, the transaction defaults to 2 blocks for confirmation. Note: The `maxFeeRate` limits the fee rate generated by `numBlocks`.
    - `feeRate` union
      - string — Custom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. If the `feeRate` is less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee. Note: The `feeRate` overrides the `maxFeeRate` and `minFeeRate`.
      - integer — Custom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. If the `feeRate` is less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee. Note: The `feeRate` overrides the `maxFeeRate` and `minFeeRate`.
    - `maxFeeRate` union
      - string — (BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The `maxFeeRate` limits the fee rate generated by both `feeMultiplier` and `numBlocks`. Note: The `feeRate` overrides the `maxFeeRate`.
      - integer — (BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The `maxFeeRate` limits the fee rate generated by both `feeMultiplier` and `numBlocks`. Note: The `feeRate` overrides the `maxFeeRate`.
    - `feeMultiplier` union
      - string — (UTXO only) Custom multiplier to the `feeRate`. The resulting fee rate is limited by the `maxFeeRate`. For replace-by-fee (RBF) transactions (that include `rbfTxIds`), the `feeMultiplier` must be greater than 1, since it's an absolute fee multiplier to the transaction being replaced. Note: The `maxFeeRate` limits the fee rate generated by `feeMultiplier`.
      - number — (UTXO only) Custom multiplier to the `feeRate`. The resulting fee rate is limited by the `maxFeeRate`. For replace-by-fee (RBF) transactions (that include `rbfTxIds`), the `feeMultiplier` must be greater than 1, since it's an absolute fee multiplier to the transaction being replaced. Note: The `maxFeeRate` limits the fee rate generated by `feeMultiplier`.
    - `minConfirms` integer — The unspent selection for the transaction will only consider unspents with at least this many confirmations to be used as inputs. Does not apply to change outputs unless used in combination with `enforceMinConfirmsForChange`.
    - `enforceMinConfirmsForChange` boolean — When set to true, will enforce minConfirms for change outputs. Defaults to false.
    - `gasPrice` union
      - string
      - integer
    - `eip1559` object
      - `maxPriorityFeePerGas` union
        - string — Max priority tip price for EIP1559 transactions. Only for ETH and ERC20 tokens.
        - integer — Max priority tip price for EIP1559 transactions. Only for ETH and ERC20 tokens.
      - `maxFeePerGas` union
        - string
        - integer
    - `gasLimit` union
      - string
      - integer
    - `targetWalletUnspents` integer — Specifies the minimum count of good-sized unspents to maintain in the wallet. Change splitting ceases when the wallet has `targetWalletUnspents` good-sized unspents. **Note**: Wallets that continuously send a high count of transactions will automatically split large change amounts into multiple good-sized change outputs while they have fewer than `targetWalletUnspents` good-sized unspents in their unspent pool. Breaking up large unspents helps to reduce the amount of unconfirmed funds in flight in future transactions, and helps to avoid long chains of unconfirmed transactions. This is especially useful for newly funded wallets or recently refilled send-only wallets.
    - `minValue` union
      - string
      - integer
    - `maxValue` union
      - string
      - integer
    - `sequenceId` string — A `sequenceId` is a unique and arbitrary wallet identifier applied to transfers and transactions at creation. It is optional but highly recommended. With a `sequenceId` you can easily reference transfers and transactions&mdash;for example, to safely retry sending. Because the system only confirms one send request per `sequenceId` (and fails all subsequent attempts), you can retry sending without the risk of double spending. The `sequenceId` is only visible to users on the wallet and is not shared publicly.
    - `nonce` string
    - `noSplitChange` boolean — Set `true` to disable automatic change splitting. Also see: `targetWalletUnspents`
    - `unspents` string[] — Used to explicitly specify the unspents to be used in the input set in the transaction. Each unspent should be in the form `prevTxId:nOutput`.
    - `changeAddress` string
    - `txFormat` 'legacy' | 'psbt' | 'psbt-lite' — [UTXO only] Format of the returned transaction hex serialization. `legacy` for serialized transaction in custom bitcoinjs-lib format. `psbt` for BIP174 serialized transaction
    - `instant` boolean — (DASH only) Specifies whether or not to use Dash's "InstantSend" feature when sending a transaction.
    - `memo` object — Extra transaction information for CSPR, EOS, HBAR, RUNE, STX, TON, XLM, and XRP. Required for XLM transactions. Note: For XRP this is the destination tag (DT), for CSPR this is the transfer ID and for ALGO this is the message field.
      - `type` string
      - `value` string
    - `comment` string — Optional metadata (only persisted in BitGo) to be applied to the transaction. Use this to add transaction-specific information such as the transaction's purpose or another identifier that you want to reference later. The value is shown in the UI in the transfer listing page.
    - `destinationChain` string — (AVAXC and AVAXP only) Destination chain for an AVAX import/export transaction. One of [P, C].
    - `sourceChain` string — (AVAXC and AVAXP only) Source chain for an AVAX import/export transaction. One of [P, C].
    - `addressType` string — DEPRECATED - use `changeAddressType`. The type of address to create for change. One of `p2sh`, `p2shP2wsh`, `p2wsh`, or `p2tr`.
    - `changeAddressType` union — The address type for the change address. One of `p2sh`, `p2shP2wsh`, `p2wsh`, `p2tr` or `p2trMusig2`.
      - 'p2sh' | 'p2shP2wsh' | 'p2wsh' | 'p2tr' | 'p2trMusig2'
      - AddressType1[] — The address types for the change address. Order by preference and BitGo uses the first available. Any subset of `p2sh`, `p2shP2wsh`, `p2wsh`, `p2tr` or `p2trMusig2`.
    - `startTime` string — Unix timestamp in seconds.nanoseconds format, denoting the start of the validity window. Only for HBAR transactions.
    - `consolidateId` string
    - `lastLedgerSequence` integer — (XRP only) Absolute max ledger the transaction should be accepted in, whereafter it will be rejected
    - `ledgerSequenceDelta` integer — (XRP only) Relative ledger height (in relation to the current ledger) that the transaction should be accepted in, whereafter it will be rejected
    - `rbfTxIds` string[] — The list of transactions to accelerate using Replace-By-Fee (RBF) for UTXO coins (currently accelerating only one tx is supported).
    - `isReplaceableByFee` boolean — It is used to mark an UTXO transaction eligible for Replace-By-Fee (RBF) later.
    - `validFromBlock` integer — Optional block this transaction is valid from
    - `validToBlock` integer — Optional block this transaction is valid until
    - `trustlines` Trustline[] — List of trustlines to manage on the account. Available for Stellar.
      - `token` string — One of the supported coin types for Stellar tokens listed in [Coin-specific-implementation](#tag/Coin-specific-implementation)
      - `action` 'add' | 'remove'
      - `limit` string
    - `stakingOptions` union — Required object for staking. Only for CSPR and STX.
      - CSPRStakingOptions
        - `amount` union
          - string
          - integer
        - `validator` string
      - STXStakingOptions
        - `contractName` string — The STX staking contract name. Use pox-3.
        - `functionName` union — STX staking contract function.
          - string — Function name used to delegate funds.
          - string — Function name used to revoke delegated funds.
        - `functionArgs` union[] — The 4 Objects are required and in the order expressed.
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
    - `messageKey` string — Optional parameter that takes a hexadecimal value to set `messagekey` for an XRP `accountSet` transaction. Recipients field should be empty when `messageKey` is set.
    - `reservation` object — Optional parameter for UTXO coins to automatically reserve the unspents that are used in the build. Useful for Cold wallets. If using, must set expireTime.
      - `expireTime` string, date-time — Required. The time that the unspent reservations should expire.
    - `recipients` object[], required — A list of recipient addresses and amounts. Must be present but empty for Child-Pays-For-Parent transactions and for ERC-7984 token enablement transactions (use `enableTokens` in that case — the server derives the delegation calldata and overrides this field internally).
      - `amount` union
        - string
        - integer
      - `address` string
      - `memo` union
        - string — A memo for this specific transaction. This format is only available for Stacks.
        - MemoObject — Extra transaction information for CSPR, EOS, HBAR, RUNE, STX, TON, XLM, and XRP. Required for XLM transactions. Note: For XRP this is the destination tag (DT), for CSPR this is the transfer ID and for ALGO this is the message field.
          - `type` string
          - `value` string
    - `enableTokens` object[] — Tokens to enable decryption delegation for (ERC-7984 / Zama confidential tokens, ETH family only). When present, `recipients` must be an empty array — the server derives delegation calldata from this field and overrides `recipients` internally.
      - `name` string, required — Token coin name (e.g. "hteth:cusdt")
      - `address` string, required — Wallet address that will delegate decryption rights (the owner address — must be registered to this wallet)
  - NonParticipationTransactionBuildRequest
    - `type` string — Required for transactions from MPC wallets. "acceleration" speeds up transactions with a certain nonce by adjusting the gas setting. "accountSet" is for XRP AccountSet transactions. "consolidate" combines multiple UTXO inputs into fewer outputs. "enabletoken" is for SOL. "fanout" splits UTXO inputs into many smaller outputs (UTXO coins only). "stakingLock" and "stakingUnlock" are for Stacks delegations. "transfer" is for native-asset transfers. "trustline" is for Stellar trustline transactions. Possible types include: [acceleration, accountSet, consolidate, enabletoken, fanout, stakingLock, stakingUnlock, transfer, transfertoken, trustline] For AVAX, possible types include: `addValidator`, `export`, and `import`. For XRP, possible types include: `payment` and `accountSet`. The default is `payment`. For STX, type is required.
    - `messages` object[] — [UTXO only] An array of messages that you sign with the wallet keys using the BIP322 format. If passed, the `recipients` array must be empty.
      - `address` string — The address for which you're proving ownership. This address must belong to the wallet.
      - `message` string — Message that is being signed.
    - `numBlocks` integer — (BTC only) The number of blocks required to confirm a transaction. You can use `numBlocks` to estimate the fee rate by targeting confirmation within a given number of blocks. If both `feeRate` and `numBlocks` are absent, the transaction defaults to 2 blocks for confirmation. Note: The `maxFeeRate` limits the fee rate generated by `numBlocks`.
    - `feeRate` union
      - string — Custom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. If the `feeRate` is less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee. Note: The `feeRate` overrides the `maxFeeRate` and `minFeeRate`.
      - integer — Custom fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. If the `feeRate` is less than the minimum required network fee, then the minimum fee applies. For example, 1000 sat/kvByte, a flat 1000 microAlgos, or a flat 10 drops of xrp. For XRP, the actual fee is usually 4.5 times the open ledger fee. Note: The `feeRate` overrides the `maxFeeRate` and `minFeeRate`.
    - `maxFeeRate` union
      - string — (BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The `maxFeeRate` limits the fee rate generated by both `feeMultiplier` and `numBlocks`. Note: The `feeRate` overrides the `maxFeeRate`.
      - integer — (BTC only) The maximum fee rate (in base units) per kilobyte (or virtual kilobyte). For example, satoshis per kvByte. The `maxFeeRate` limits the fee rate generated by both `feeMultiplier` and `numBlocks`. Note: The `feeRate` overrides the `maxFeeRate`.
    - `feeMultiplier` union
      - string — (UTXO only) Custom multiplier to the `feeRate`. The resulting fee rate is limited by the `maxFeeRate`. For replace-by-fee (RBF) transactions (that include `rbfTxIds`), the `feeMultiplier` must be greater than 1, since it's an absolute fee multiplier to the transaction being replaced. Note: The `maxFeeRate` limits the fee rate generated by `feeMultiplier`.
      - number — (UTXO only) Custom multiplier to the `feeRate`. The resulting fee rate is limited by the `maxFeeRate`. For replace-by-fee (RBF) transactions (that include `rbfTxIds`), the `feeMultiplier` must be greater than 1, since it's an absolute fee multiplier to the transaction being replaced. Note: The `maxFeeRate` limits the fee rate generated by `feeMultiplier`.
    - `minConfirms` integer — The unspent selection for the transaction will only consider unspents with at least this many confirmations to be used as inputs. Does not apply to change outputs unless used in combination with `enforceMinConfirmsForChange`.
    - `enforceMinConfirmsForChange` boolean — When set to true, will enforce minConfirms for change outputs. Defaults to false.
    - `gasPrice` union
      - string
      - integer
    - `eip1559` object
      - `maxPriorityFeePerGas` union
        - string — Max priority tip price for EIP1559 transactions. Only for ETH and ERC20 tokens.
        - integer — Max priority tip price for EIP1559 transactions. Only for ETH and ERC20 tokens.
      - `maxFeePerGas` union
        - string
        - integer
    - `gasLimit` union
      - string
      - integer
    - `targetWalletUnspents` integer — Specifies the minimum count of good-sized unspents to maintain in the wallet. Change splitting ceases when the wallet has `targetWalletUnspents` good-sized unspents. **Note**: Wallets that continuously send a high count of transactions will automatically split large change amounts into multiple good-sized change outputs while they have fewer than `targetWalletUnspents` good-sized unspents in their unspent pool. Breaking up large unspents helps to reduce the amount of unconfirmed funds in flight in future transactions, and helps to avoid long chains of unconfirmed transactions. This is especially useful for newly funded wallets or recently refilled send-only wallets.
    - `minValue` union
      - string
      - integer
    - `maxValue` union
      - string
      - integer
    - `sequenceId` string — A `sequenceId` is a unique and arbitrary wallet identifier applied to transfers and transactions at creation. It is optional but highly recommended. With a `sequenceId` you can easily reference transfers and transactions&mdash;for example, to safely retry sending. Because the system only confirms one send request per `sequenceId` (and fails all subsequent attempts), you can retry sending without the risk of double spending. The `sequenceId` is only visible to users on the wallet and is not shared publicly.
    - `nonce` string
    - `noSplitChange` boolean — Set `true` to disable automatic change splitting. Also see: `targetWalletUnspents`
    - `unspents` string[] — Used to explicitly specify the unspents to be used in the input set in the transaction. Each unspent should be in the form `prevTxId:nOutput`.
    - `changeAddress` string
    - `txFormat` 'legacy' | 'psbt' | 'psbt-lite' — [UTXO only] Format of the returned transaction hex serialization. `legacy` for serialized transaction in custom bitcoinjs-lib format. `psbt` for BIP174 serialized transaction
    - `instant` boolean — (DASH only) Specifies whether or not to use Dash's "InstantSend" feature when sending a transaction.
    - `memo` object — Extra transaction information for CSPR, EOS, HBAR, RUNE, STX, TON, XLM, and XRP. Required for XLM transactions. Note: For XRP this is the destination tag (DT), for CSPR this is the transfer ID and for ALGO this is the message field.
      - `type` string
      - `value` string
    - `comment` string — Optional metadata (only persisted in BitGo) to be applied to the transaction. Use this to add transaction-specific information such as the transaction's purpose or another identifier that you want to reference later. The value is shown in the UI in the transfer listing page.
    - `destinationChain` string — (AVAXC and AVAXP only) Destination chain for an AVAX import/export transaction. One of [P, C].
    - `sourceChain` string — (AVAXC and AVAXP only) Source chain for an AVAX import/export transaction. One of [P, C].
    - `addressType` string — DEPRECATED - use `changeAddressType`. The type of address to create for change. One of `p2sh`, `p2shP2wsh`, `p2wsh`, or `p2tr`.
    - `changeAddressType` union — The address type for the change address. One of `p2sh`, `p2shP2wsh`, `p2wsh`, `p2tr` or `p2trMusig2`.
      - 'p2sh' | 'p2shP2wsh' | 'p2wsh' | 'p2tr' | 'p2trMusig2'
      - AddressType1[] — The address types for the change address. Order by preference and BitGo uses the first available. Any subset of `p2sh`, `p2shP2wsh`, `p2wsh`, `p2tr` or `p2trMusig2`.
    - `startTime` string — Unix timestamp in seconds.nanoseconds format, denoting the start of the validity window. Only for HBAR transactions.
    - `consolidateId` string
    - `lastLedgerSequence` integer — (XRP only) Absolute max ledger the transaction should be accepted in, whereafter it will be rejected
    - `ledgerSequenceDelta` integer — (XRP only) Relative ledger height (in relation to the current ledger) that the transaction should be accepted in, whereafter it will be rejected
    - `rbfTxIds` string[] — The list of transactions to accelerate using Replace-By-Fee (RBF) for UTXO coins (currently accelerating only one tx is supported).
    - `isReplaceableByFee` boolean — It is used to mark an UTXO transaction eligible for Replace-By-Fee (RBF) later.
    - `validFromBlock` integer — Optional block this transaction is valid from
    - `validToBlock` integer — Optional block this transaction is valid until
    - `trustlines` Trustline[] — List of trustlines to manage on the account. Available for Stellar.
      - `token` string — One of the supported coin types for Stellar tokens listed in [Coin-specific-implementation](#tag/Coin-specific-implementation)
      - `action` 'add' | 'remove'
      - `limit` string
    - `stakingOptions` union — Required object for staking. Only for CSPR and STX.
      - CSPRStakingOptions
        - `amount` union
          - string
          - integer
        - `validator` string
      - STXStakingOptions
        - `contractName` string — The STX staking contract name. Use pox-3.
        - `functionName` union — STX staking contract function.
          - string — Function name used to delegate funds.
          - string — Function name used to revoke delegated funds.
        - `functionArgs` union[] — The 4 Objects are required and in the order expressed.
          - union
            - object
              - …
            - object
              - …
            - object
              - …
            - object
              - …
    - `messageKey` string — Optional parameter that takes a hexadecimal value to set `messagekey` for an XRP `accountSet` transaction. Recipients field should be empty when `messageKey` is set.
    - `reservation` object — Optional parameter for UTXO coins to automatically reserve the unspents that are used in the build. Useful for Cold wallets. If using, must set expireTime.
      - `expireTime` string, date-time — Required. The time that the unspent reservations should expire.
    - `nonParticipation` boolean, required

## Response `200`

OK

- TransactionBuildResult
  - `keyDerivationPath` string

## Other responses

- `400` — Bad Request

---

[API](https://skmtc.net/bitgo/apis/bitgo-api.md) · [All operations](https://skmtc.net/bitgo/apis/bitgo-api/llms.txt) · [OpenAPI document](https://skmtc-service-staging.skmtc.workers.dev/v1/apis/bitgo/bitgo-api/revisions/e445c15e5bee/schema)
