Multisig Withdrawal
On-chain multisig withdrawal flow: fetch signing data, build a PSBT, and broadcast it once co-signed.
Get withdrawal parameters
https://api.gobtcpay.com/public/api/v1.2/multisig/onchain/get-data-to-withdrawReturns everything needed to build a withdrawal PSBT client-side: the multisig descriptor (m/n, witness script), spendable UTXOs, recommended fee rates (low / medium / high), change script details, and virtual-size parameters for fee estimation.
Authorization: walletAuth
Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/multisig/onchain/get-data-to-withdraw" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN"{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"multisig": {
"m": 2,
"n": 3,
"witnessScript": "0014751e76e8199196d454941c45d1b3a323f1433bd6"
},
"utxos": [
{
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"vout": 0,
"value": 50000,
"scriptPubKey": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc"
}
],
"feeRateSatVb": {
"law": 12,
"medium": 12,
"high": 12
},
"change": {
"scriptPubKeyHex": "02a1633cafcc01ebfb6d78e39f687a1f0995c62fc95f51ead10a02ee0be551b5dc",
"dustThreshold": 546
},
"params": {
"vSizeP2wsh20f3In": 140,
"vSizeP2wpkhOut": 140,
"vSizeP2wshOut": 140,
"txOverhead": 140
}
}
}
}Build withdrawal transaction
https://api.gobtcpay.com/public/api/v1.2/multisig/onchain/build-psbt-to-withdrawBuilds an unsigned withdrawal PSBT to toAddress. Provide either amountSats or sendMax, plus a fee.feeRateSatVb. Optionally pin inputs with selectUtxos and enable replace-by-fee with rbf. Returns the jobId, psbtBase64, and a summary (fee, vsize, change, inputs). Co-sign, then submit via Broadcast withdrawal.
Authorization: walletAuth
Body required
application/jsontoAddressstringrequiredDestination Bitcoin address for the funds.
bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdqamountSatsstring | numberAmount in satoshis.
sendMaxbooleanIf true, sweeps the entire spendable balance to toAddress and ignores the amount.
truefeeobjectrequiredselectUtxosobject[]Optional list of specific UTXOs to spend. If omitted, coins are selected automatically.
rbfbooleanEnable Replace-By-Fee (BIP-125) so the transaction can be fee-bumped later.
trueResponses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/multisig/onchain/build-psbt-to-withdraw" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"toAddress": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
"amountSats": "string",
"sendMax": true,
"fee": {
"feeRateSatVb": 50000
},
"selectUtxos": [
{
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"vout": 0
}
],
"rbf": true
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"psbtBase64": "cHNidP8BAHECAAAAAfYI0kF1pQ0i3xL0AAAAAAD9////AsBdAQAAAAAAFgAUdR5",
"summary": {
"toAddress": "bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq",
"amountSats": "string",
"feeSats": "string",
"feeRateSatVb": 50000,
"vsize": 140,
"change": {
"valueSats": "string"
},
"inputs": [
{
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"vout": 0,
"value": 50000
}
]
}
}
}
}Broadcast withdrawal
https://api.gobtcpay.com/public/api/v1.2/multisig/onchain/confirm-withdrawBroadcasts a co-signed withdrawal. Submit the jobId from Build withdrawal PSBT and the signedPsbtBase64. Returns the broadcast txid (and txHex when available).
Authorization: walletAuth
Body required
application/jsonjobIdstringrequiredThe jobId from Build withdrawal transaction (/multisig/onchain/build-psbt-to-withdraw).
3fa85f64-5717-4562-b3fc-2c963f66afa6signedPsbtBase64stringrequiredThe withdrawal PSBT, co-signed, base64-encoded.
cHNidP8BAHECAAAAAfYI0kF1pQ0i3xL0AAAAAAD9////AsBdAQAAAAAAFgAUdR5Responses
idstringrequired3fa85f64-5717-4562-b3fc-2c963f66afa6resultobjectrequiredcurl -X POST "$BASE_URL/multisig/onchain/confirm-withdraw" \
-H "Content-Type: application/json" \
-H "Authorization: Bearer $ACCESS_TOKEN" \
-d '{
"jobId": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"signedPsbtBase64": "cHNidP8BAHECAAAAAfYI0kF1pQ0i3xL0AAAAAAD9////AsBdAQAAAAAAFgAUdR5"
}'{
"id": "3fa85f64-5717-4562-b3fc-2c963f66afa6",
"result": {
"$case": "success",
"success": {
"txid": "4a5e1e4baab89f3a32518a88c31bc87f618f76673e2cc77ab2127b7afdeda33b",
"txHex": "02000000000101a1b2c3d4e5f60718293a4b5c6d7e8f90a1b2c3d4e5f6071829ffffffff"
}
}
}