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

# Tezos Transaction Signing

> Sign and broadcast Tezos transactions built with the P2P.org Unified API.

To sign and broadcast the transaction to the Tezos network, follow these steps:

1. Prepare <Tooltip tip="A transaction that must be signed and broadcasted to the blockchain network.">unsigned transaction</Tooltip> as a hex-encoded string. You obtain this from the `unsignedTransactionData` field in the Unified API staking/unstaking response.

2. Sign the transaction using the following code:

<CodeGroup>
  ```javascript theme={null}
  import { InMemorySigner } from '@taquito/signer';

  const MNEMONIC = "<YOUR_MNEMONIC>";
  const UNSIGNED_TX = "<UNSIGNED_TX_HEX>";

  async function main() {
      // Create a signer instance from mnemonic
      const signer = await InMemorySigner.fromMnemonic({ mnemonic: MNEMONIC });

      // Sign the unsigned transaction (hex string)
      const signed = await signer.sign(UNSIGNED_TX, new Uint8Array([3]));

      // The result contains: bytes, sig, prefixSig, sbytes
      console.log("✅ Signed Tezos Tx (JSON):");
      console.log(JSON.stringify(signed, null, 2));
  }

  main().catch(console.error);

  ```
</CodeGroup>

Upon successful execution, the script prints the signed transaction as a JSON object, ready to be broadcasted:

<CodeGroup>
  ```bash theme={null}
  ✅ Signed Tezos Tx (JSON):
  {
    "bytes": "...",
    "sig": "...",
    "prefixSig": "...",
    "sbytes": "..."
  }

  ```
</CodeGroup>

3. Broadcast the transaction to the Tezos network by sending a POST request to [/api/v1/unified/transaction/broadcast](/reference/unified-transaction-send).


## Related topics

- [Networks Supported](/docs/unified-api-networks.md)
- [Getting Started](/docs/unified-api-getting-started.md)
- [Unified API Reference](/reference/unified-create-stake-transaction.md)
