> ## 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.

# Build a PSBT

> Construct an unsigned Partially Signed Bitcoin Transaction (PSBT) for later signing.

`DynamicSDK.instance.bitcoin.buildPsbt` constructs an unsigned PSBT without broadcasting it. Use it when you need to inspect, modify, batch, or co-sign a transaction before sending. See [What is a PSBT?](/flutter/wallets/bitcoin/overview#what-is-a-psbt) in the overview for context.

## Example

```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 unsignedPsbt = await sdk.bitcoin.buildPsbt(
  walletId: wallet.id,
  recipientAddress: 'bc1qxy2kgdygjrsqtzq2n0yrf2493p83kkfjhx0wlh',
  amount: '10000',         // satoshis
  feePriority: 'medium',
);
print('Unsigned PSBT (base64): $unsignedPsbt');
```

## Parameters

| Parameter          | Type      | Description                                                        |
| ------------------ | --------- | ------------------------------------------------------------------ |
| `walletId`         | `String`  | The id of a wallet whose `chain == 'BTC'`.                         |
| `recipientAddress` | `String`  | Destination address.                                               |
| `amount`           | `String`  | Amount **in satoshis**, encoded as a string to preserve precision. |
| `feePriority`      | `String?` | Fee tier: `'high'`, `'medium'`, or `'low'`.                        |

## Returns

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

## Build → sign → broadcast

```dart theme={"system"}
final unsignedPsbt = await sdk.bitcoin.buildPsbt(
  walletId: wallet.id,
  recipientAddress: 'bc1q...',
  amount: '5000',
);

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

final txId = await sdk.bitcoin.sendRawTransaction(
  walletId: wallet.id,
  rawTransaction: signedPsbt,
);
print('Sent: $txId');
```
