> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign a PSBT

> Sign one or more Partially Signed Bitcoin Transactions (PSBTs).

`DynamicSDK.instance.bitcoin.signPsbt` signs a PSBT with the connected wallet. For batch signing, use `signPsbts` instead — same semantics, but takes a list of PSBT requests.

## Sign a single PSBT

```dart theme={"system"}
import 'package:dynamic_sdk/dynamic_sdk.dart';

final sdk = DynamicSDK.instance;
final wallet = sdk.wallets.userWallets.firstWhere(
  (w) => w.chain == 'BTC',
);

final signedPsbt = await sdk.bitcoin.signPsbt(
  walletId: wallet.id,
  request: {
    'unsignedPsbtBase64': unsignedPsbt,
  },
);
print('Signed PSBT: $signedPsbt');
```

### Parameters

| Parameter  | Type                   | Description                                      |
| ---------- | ---------------------- | ------------------------------------------------ |
| `walletId` | `String`               | The id of a wallet whose `chain == 'BTC'`.       |
| `request`  | `Map<String, dynamic>` | PSBT request. Must include `unsignedPsbtBase64`. |

### Returns

`Future<String>` — the signed PSBT, base64-encoded. Pass it to [`sendRawTransaction`](/flutter/wallets/bitcoin/send-raw-transaction) to broadcast.

## Sign multiple PSBTs

Batch-sign in a single call when you have several PSBTs to authorize at once:

```dart theme={"system"}
final signedPsbts = await sdk.bitcoin.signPsbts(
  walletId: wallet.id,
  requests: [
    {'unsignedPsbtBase64': psbt1},
    {'unsignedPsbtBase64': psbt2},
  ],
);
print('Signed ${signedPsbts.length} PSBTs');
```

### Parameters

| Parameter  | Type                         | Description                                            |
| ---------- | ---------------------------- | ------------------------------------------------------ |
| `walletId` | `String`                     | The id of a wallet whose `chain == 'BTC'`.             |
| `requests` | `List<Map<String, dynamic>>` | List of PSBT requests, each with `unsignedPsbtBase64`. |

### Returns

`Future<List<String>>` — base64-encoded signed PSBTs, in the same order as `requests`.
