Withdraw - Self-Custody MPC (Manual)
Request, approve, sign, and send withdrawals with granular control. See the Guide.
-
Request the transaction by specifying the transaction details and sending them to BitGo. BitGo uses the data to build an unsigned transaction.
-
If you have policy rules requiring approval, another admin must approve the transaction — you cannot approve your own transactions. Once approved, BitGo rebuilds the transaction with current fees.
-
Sign the transaction using your private key and send it to BitGo. BitGo applies the final signature and broadcasts the transaction to the blockchain.
// 1. Request Transaction
export WALLET_ID="<WALLET_ID>"
export ACCESS_TOKEN="<YOUR_ACCESS_TOKEN>"
curl -X POST \
https://app.bitgo-test.com/api/v2/wallet/$WALLET_ID/txrequests \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"intent": {
"intentType": "payment",
"recipients": [
{
"address": { "address": "<DESTINATION_ADDRESS>" },
"amount": { "value": "100", "symbol": "gteth" }
}
]
},
"apiVersion": "full"
}'
// 2. Approve Transaction (Optional)
export BITGO_EXPRESS_HOST="<YOUR_LOCAL_HOST>"
export COIN="<ASSET_ID>"
export APPROVAL_ID="<APPROVAL_ID>"
export WALLET_PASSPHRASE="<YOUR_WALLET_PASSPHRASE>"
curl -X PUT \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/pendingApprovals/$APPROVAL_ID \
-H 'Content-Type: application/json' \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"state": "approved",
"walletPassphrase": "'"$WALLET_PASSPHRASE"'"
}'
// 3. Sign and Send Transaction
export COIN="<ASSET_ID>"
export WALLET_ID="<YOUR_WALLET_ID>"
export TX_REQUEST_ID="<TX_REQUEST_ID>"
curl -X POST \
http://$BITGO_EXPRESS_HOST/api/v2/$COIN/wallet/$WALLET_ID/signtxtss \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"txRequestId": "'"$TX_REQUEST_ID"'",
"walletPassphrase": "<YOUR_WALLET_PASSPHRASE>"
}'
// 1. Request Transaction
let params = {
recipients: [
{
amount: 0.01 * 1e8,
address: '2NFfxvXpAWjKng7enFougtvtxxCJ2hQEMo4',
},
],
};
wallet.prebuildTransaction(params).then(function (transaction) {
console.dir(transaction);
});
// 2. Approve Transaction (Optional)
const baseCoin = bitgo.coin(initialPendingApproval.coin);
const pendingApproval = await baseCoin.pendingApprovals().get({ id: initialPendingApproval.id });
const result = await pendingApproval.approve(params);
// 3. Sign and Send Transaction
const signParams = {
txRequestId: "string",
walletPassphrase: "password to decrypt the encryptedPrv"
};
wallet.signTransaction(signParams).then(function (result) {
console.dir(result);
});
Response
// 1. Request Transaction Response
{
"txRequestId": "string",
"walletId": "string",
"walletType": "hot",
"state": "initialized",
"intent": {
"intentType": "payment",
"recipients": [
{
"address": { "address": "string" },
"amount": { "value": "100", "symbol": "gteth" }
}
]
},
"transactions": [
{
"state": "initialized",
"unsignedTx": {
"serializedTxHex": "string",
"signableHex": "string"
}
}
]
}
// 2. Approve Transaction Response
{
"id": "66b66201c45ab3125fc2d8a77b541d12",
"state": "approved"
}
// 3. Sign and Send Transaction Response
{
"txRequestId": "ed50bf41-cbc2-454e-81f5-840a024f802e",
"walletId": "6695838af64d6e4dadf93838d29e78d3",
"state": "delivered",
"transactions": [
{
"state": "delivered",
"txHash": "5K5k73S8hCZhMMzEMkxoVwMefB7JYgEtb8bGvDx5uSt5bc6ZP9CbnDiFLDfpePhUrDCLvQGq7sCD4t9Pe5rJKCVY"
}
]
}