---
title: "Sign a Bitcoin PSBT with a scoped agent wallet"
method: POST
path: "/vault/{agentId}/sign-bitcoin-psbt"
tags: ["Vault"]
---

# Sign a Bitcoin PSBT with a scoped agent wallet

`POST /vault/{agentId}/sign-bitcoin-psbt`

## Request

- Base URL: `http://localhost:3200`
- URL: `http://localhost:3200/vault/{agentId}/sign-bitcoin-psbt`
- Auth: one of:
  - HTTP bearer
  - API key in header `X-Steward-API-Key`
- TypeScript: <https://skmtc.dev/steward-fi/apis/steward-api/docs/vault/:agentId/sign-bitcoin-psbt/post.ts> (a function with typed inputs; its response is checked against the schema)

Requires agent access plus owner/admin recent MFA or delegated signer credentials with `sign_transaction`. The route decodes standard Bitcoin PSBT destination outputs, computes input/output/fee totals before signing, rejects excessive fees, evaluates both destination outputs and aggregate destination+fee spend against the agent policy set, and records the signed spend for future policy counters. It also requires an enabled `raw-signing-chain` policy that explicitly allows `bitcoin` and `secp256k1`.

## Headers

- `X-Steward-Request-Timestamp` string
- `X-Steward-Request-Expires-At` string
- `X-Steward-Signature` string
- `X-Steward-Signing-Key-Id` string
- `Idempotency-Key` string

## Request body

- object
  - `walletScope` string, required
  - `psbtBase64` string, required: Base64-encoded PSBT
  - `finalize` boolean: When true, finalize the signed PSBT and return raw transaction hex plus txid/fee metadata. No broadcast is performed.
  - `referenceId` string

## Response `200`

JSON response

- object
  - `ok` true, required
  - `data` object, required
    - `signedPsbtBase64` string, required
    - `signedInputs` integer, required
    - `addressType` 'p2wpkh' | 'p2tr', required
    - `network` 'mainnet' | 'testnet', required
    - `walletScope` string, required
    - `walletAddress` string, required
    - `transactionId` string, required
    - `finalizedTxHex` string
    - `txId` string
    - `vsize` integer
    - `feeSats` string

## Other responses

- `400`: JSON response
- `401`: JSON response
- `403`: JSON response
- `404`: JSON response
- `408`: JSON response
- `409`: JSON response

## Changes

- **2026-08-17** `261a7c8070b2`: 1 info
  - endpoint added

[Operation history](https://skmtc.dev/steward-fi/apis/steward-api/changes/vault/:agentId/sign-bitcoin-psbt/post.md)

---

[API](https://skmtc.dev/steward-fi/apis/steward-api.md) - [All operations](https://skmtc.dev/steward-fi/apis/steward-api/llms.txt) - [OpenAPI document](https://skmtc.dev/steward-fi/apis/steward-api/revisions/b88b4b97a664?raw)
