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

# Sign and Broadcast Transaction

> In the Unified API, transaction signing logic varies depending on the specific blockchain network. Nevertheless, a unified method to broadcast a signed transaction to the network is used.

To sign and broadcast a transaction to the Unified API supported network, follow these steps:

1. Prepare unsigned transactions in Base64 encrypted or hex-encoded format (`unsignedTransactionData` by default).
2. Sign the transaction using the [Signer SDK](/docs/signer-sdk-overview), configured to the specific protocol.
3. Broadcast the signed transaction to the network by sending a POST request to [/api/v1/unified/transaction/broadcast](/reference/unified-transaction-send).

Example request (for `solana` chain and `testnet` network):

<CodeGroup>
  ```bash bash theme={null}
  curl --request POST \
       --url https://api-test.p2p.org/api/v1/unified/transaction/broadcast \
       --header 'Content-Type: application/json' \
       --header 'Authorization: Bearer <token>' \
       --data '{
      "chain": "solana",
      "network": "testnet",
      "stakerAddress": "9FfyCk9kqgfpg1gYMw8rhksZcAg4JiD9xhuMvkFVdjQY",
      "signedTransaction": "AdtQhLeM0eOMdV7rvagYx3V8mra6CMaiVgeNTcgTds8ltjDUwJi3LMGhZ+Txqj26nJMJa7MxFWe5lmIxAnjKsQUBAAIEep+wazhVDEf2XiuHusgypzGMGyd4WaFZ6lzpHIypRJ3qFo72gQoaoUsCAJcUGGTQGdOONNYMBdVbIhEKwGitMwah2BeRN1QqmDQ3vf4qerJVf1NcinhyK2ikncAAAAAABqfVFxjHdMkoVmOYaR1etoteuKObS21cc1VbIQAAAABojzQ55lMuIXx6AWTccH48p4L12JlvUuCfHkOik1nJLAECAwEDAAQFAAAA"
  }'
  ```
</CodeGroup>

* `chain` — blockchain network.
* `network` — environment in which the transaction is processed.
* `stakerAddress` — staking account address keeping the staked tokens.
* `signedTransaction` — signed transaction in Base64 encrypted format, which contains all transaction details (e.g., accounts, instructions, and signatures) required to broadcast the transaction to the network.

Example response (for `solana` chain and `testnet` network):

<CodeGroup>
  ```json JSON theme={null}
  {
      "error": null,
      "result": {
          "extraData": {
              "transactionId": "2Bno5j3tex8VmcCR2M6JQnjtPxDuqAvSAUjSDpd6gaasRfEQeoWH9MRQdU7ANNtFFbG9UQAGByG1UwPS1qersmyd",
              "slot": 307375529,
              "signerAccounts": [
                  "9i5cTqci1W6DHdYfT7WbiNhP5DXvnPNTXvS9fTBFfuSw",
                  "6GtymMn8cDTy3xHH9AitwP6skbKvBkD53XBE2xSu1tCR",
                  "11111111111111111111111111111111",
                  "A93XLdBKfc4pwEMAvdFeyxnF6HauN5erNDFbUsemWiaB",
                  "Stake11111111111111111111111111111111111111",
                  "StakeConfig11111111111111111111111111111111",
                  "SysvarC1ock11111111111111111111111111111111",
                  "SysvarRent111111111111111111111111111111111",
                  "SysvarStakeHistory1111111111111111111111111"
              ],
              "createdAt": "2024-12-17T19:41:27.450Z"
          }
      }
  }
  ```
</CodeGroup>

* `extraData` — additional transaction details specific to the network:

  * `transactionId` — block hash in which the transaction has been included.
  * `slot` — period of time during which each leader collects transactions and creates a block in the Solana network.
  * `signerAccounts` — account addresses that signed the transaction.
  * `createdAt` — timestamp of the transaction in the ISO 8601 format.


## Related topics

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