eea_sendRawTransaction
POST http://{{rpc-http-host}}:{{rpc-http-port}}
Distributes the private transaction, generates the privacy marker transaction and submits it to the transaction pool, and returns the transaction hash of the privacy marker transaction.
The signed transaction passed as an input parameter includes the privateFrom
,
privateFor
or privacyGroupId
,
and restriction
fields.
The gas
and gasPrice
are used by the privacy marker transaction
not the private transaction itself.
To avoid exposing your private key, create signed transactions offline and send the signed
transaction data using eea_sendRawTransaction
.
Important
For production systems requiring private transactions, use a network with a consensus mechanism supporting transaction finality to make sure the private state does not become inconsistent with the chain. For example, IBFT 2.0 provides the required finality.
Using private transactions with pruning or fast sync is not supported.
Besu does not implement
eea_sendTransaction
.EthSigner provides transaction signing and implements
eea_sendTransaction
.
Parameters
data
- Signed RLP-encoded private transaction. For example:
params: ["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"]
Returns
result
: data
- 32-byte transaction hash of the
Privacy Marker Transaction.
Tip
If creating a contract, use priv_getTransactionReceipt to retrieve the contract address after the transaction is finalized.
Request Body
{"jsonrpc"=>"2.0", "method"=>"eea_sendRawTransaction", "params"=>["0xf869018203e882520894f17f52151ebef6c7334fad080c5704d77216b732881bc16d674ec80000801ba02da1c48b670996dcb1f447ef9ef00b33033c48a4fe938f420bec3e56bfd24071a062e0aa78a81bf0290afbc3a9d8e9a068e6d74caa66c5e0fa8a46deaae96b0833"], "id"=>1}