The sendrawtransaction RPC validates a transaction and broadcasts it to the peer-to-peer network.

Parameter #1—a serialized transaction to broadcast

Name Type Presence Description
Transaction string (hex) Required
(exactly 1)
The serialized transaction to broadcast encoded as hex

*Parameter #2–whether to allow high fees**

Name Type Presence Description
Allow High Fees bool Optional
(0 or 1)
Set to true to allow the transaction to pay a high transaction fee. Set to false (the default) to prevent Pai Core from broadcasting the transaction if it includes a high fee. Transaction fees are the sum of the inputs minus the sum of the outputs, so this high fees check helps ensures user including a change address to return most of the difference back to themselves

Result—a TXID or error message

Name Type Presence Description
result null/string (hex) Required
(exactly 1)
If the transaction was accepted by the node for broadcast, this will be the TXID of the transaction encoded as hex in RPC byte order. If the transaction was rejected by the node, this will set to null, the JSON-RPC error field will be set to a code, and the JSON-RPC message field may contain an informative error message


Broadcast a signed transaction:

pai-cli -testnet sendrawtransaction 01000000011da9283b4ddf8d\



See also

  • CreateRawTransaction: creates an unsigned serialized transaction that spends a previous output to a new output with a P2PKH or P2SH address. The transaction is not stored in the wallet or transmitted to the network.
  • DecodeRawTransaction: decodes a serialized transaction hex string into a JSON object describing the transaction.
  • SignRawTransaction: signs a transaction in the serialized transaction format using private keys stored in the wallet or provided in the call.