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

# Sign a Partially Signed Bitcoin Transaction (PSBT)

> [card] Recommended: JavaScript SDK with React Hooks
>
> For new React apps, we recommend the JavaScript SDK with React Hooks (`@dynamic-labs-sdk/react-hooks`) instead of the legacy React SDK documented here. The JS SDK comes with many benefits such as a much smaller bundle size and other optimizations. Use the [React quickstart (JavaScript SDK)](https://docs.dynamic.xyz/docs/javascript/reference/react-quickstart.md) to get started.

In this example, we are going to sign a PBST with a Bitcoin wallet.

```tsx theme={"system"}
      import { 
        type BitcoinSignPsbtRequest,
        isBitcoinWallet, 
      } from '@dynamic-labs/bitcoin';

      // the wallet object is the wallet you want to send from
      // you can access the available wallets via the `useUserWallets` hook
      // or get the primaryWallet via the `useDynamicContext` hook
      const SignPsbtButton = ({ wallet }) => {
        const onSignPsbt = async () => {
          if (!isBitcoinWallet(wallet)) {
            return;
          }

          const request: BitcoinSignPsbtRequest = {
            // The PSBT request to sign
          };

          const { signedPsbt } = await wallet.signPsbt(request);

          console.log('signedPsbt', signedPsbt);
        };

        return <button onClick={onSignPsbt}>Sign PSBT</button>;
      };
```

You can also sign multiple PSBTs at once, as shown below:

```tsx theme={"system"}
      import { 
        type BitcoinSignPsbtRequest,
        isBitcoinWallet, 
      } from '@dynamic-labs/bitcoin';

      // the wallet object is the wallet you want to send from
      // you can access the available wallets via the `useUserWallets` hook
      // or get the primaryWallet via the `useDynamicContext` hook
      const SignPsbtsButton = ({ wallet }) => {
        const onSignPsbts = async () => {
          if (!isBitcoinWallet(wallet)) {
            return;
          }

          const requests: BitcoinSignPsbtRequest[] = [
            // The list of PSBT requests to sign
          ];

          const signedPsbts = await wallet.signPsbts(requests);

          console.log('signedPsbts', signedPsbts);
        };

        return <button onClick={onSignPsbts}>Sign PSBTs</button>;
      };
```

You can see an example of how to create PSBTs for testing in the [Create a PSBT](https://docs.dynamic.xyz/docs/react/wallets/using-wallets/bitcoin/create-a-psbt.md) guide.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.