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

> To complete any operation on Tron, sign the unsigned transaction provided by the Staking API and broadcast it to the network.

## 1. Prepare the transaction

Obtain the `unsignedTransaction` object provided by a transaction builder or the relevant API endpoint, e.g., `/staking/delegate`, `/staking/vote`, `/staking/undelegate`.

## 2. Sign the transaction

Use the [P2P Signer SDK](/docs/signer-sdk-overview) to sign the unsigned data following protocol specific configuration.

## 3. Send the transaction

Broadcast the signed transaction to the Celestia network by making a POST request to [/api/v1/tron/\{network}/transaction/send](/reference/tron-transaction-send).

Example request:

<CodeGroup>
  ```bash curl theme={null}
  curl --request POST \
    --url 'https://api-test.p2p.org/api/v1/tron/testnet-nile/transaction/send' \
    --header 'accept: application/json' \
    --header 'Authorization: Bearer <token>' \
    --header 'Content-Type: application/json' \
    --data '{
      "signedTransaction": "0x7b2276697369626c65223a66616c73652c2274784944223a22..."
  }'
  ```

  ```typescript TypeScript theme={null}
  const response = await fetch("https://api-test.p2p.org/api/v1/tron/testnet-nile/transaction/send", {
    method: "POST",
    headers: {
      "Authorization": "Bearer <token>",
      "Content-Type": "application/json",
    },
    body: JSON.stringify({
      signedTransaction: "0x7b2276697369626c65223a66616c73652c2274784944223a22...",
    }),
  });
  const data = await response.json();
  console.log(data);
  ```

  ```python Python theme={null}
  import requests

  response = requests.post(
      "https://api-test.p2p.org/api/v1/tron/testnet-nile/transaction/send",
      headers={
          "Authorization": "Bearer <token>",
          "Content-Type": "application/json",
      },
      json={
          "signedTransaction": "0x7b2276697369626c65223a66616c73652c2274784944223a22...",
      },
  )
  print(response.json())
  ```

  ```go Go theme={null}
  package main

  import (
  	"bytes"
  	"encoding/json"
  	"fmt"
  	"io"
  	"net/http"
  )

  func main() {
  	payload := map[string]interface{}{
  		"signedTransaction": "0x7b2276697369626c65223a66616c73652c2274784944223a22...",
  	}
  	body, _ := json.Marshal(payload)
  	req, _ := http.NewRequest("POST", "https://api-test.p2p.org/api/v1/tron/testnet-nile/transaction/send", bytes.NewBuffer(body))
  	req.Header.Set("Authorization", "Bearer <token>")
  	req.Header.Set("Content-Type", "application/json")
  	resp, _ := http.DefaultClient.Do(req)
  	defer resp.Body.Close()
  	respBody, _ := io.ReadAll(resp.Body)
  	fmt.Println(string(respBody))
  }
  ```
</CodeGroup>

* `signedTransaction` — signed transaction in the hexadecimal which needs to be broadcasted to the network.

Example response:

<CodeGroup>
  ```json theme={null}
  {
      "error": null,
      "result": {
        "transactionHash": "c8e47301ca1d4a56120e6f13f0ce5f8a680e2fda221b3d8bc423cc355f924a70",
        "createdAt": "2025-07-04T09:01:10.000Z",
        "network": "testnet-nile",
        "senderAddress": "41da53d324a354aa5924c7117caff3ead97910a5e1",
        "block": null,
        "status": "PENDING",
        "gas": {
          "bandwidthUsed": 0,
          "energyUsed": 0
        }
      }
    }
  ```
</CodeGroup>

* `transactionHash` — hash of the transaction.

* `createdAt` — timestamp of the transaction in the ISO 8601 format.

* `network` — identifier of the TRON network (e.g., `mainnet`, `testnet-nile`).

* `senderAddress` — address of the transaction sender in the base58 format.

* `block` — unique identifier of the block in which the transaction has been included. `null`, if still pending.

* `status` — transaction status: `PENDING`, `FAILED` or `CONFIRMED`.

* `gas` — resources consumed by the transaction depending on their type:

  * `bandwidthUsed` — amount of bandwidth points consumed by the transaction.
  * `energyUsed` — amount of energy points consumed by the transaction.

To check the transaction status, use the transaction hash in explorers like [Tronscan](https://nile.tronscan.org/).


## Related topics

- [Staking API reference](/reference/tron-staking-delegate.md)
- [Unified API](/docs/unified-api-overview.md)
