📜 eth_getRawTransactionByHash - Base Chain JSON-RPC Method
📝 Overview
The eth_getRawTransactionByHash
method retrieves the complete raw, RLP-encoded transaction data for a given transaction hash on the Base blockchain. This low-level method provides access to the transaction in its serialized binary format exactly as it exists on-chain, including all signature components.
💡 Power of Raw Transactions: Access to raw transaction data enables independent verification of signatures, detailed analysis of transaction encoding, and advanced transaction processing capabilities without relying on higher-level abstractions.
⚙️ Parameters
Parameter | Type | Description |
---|---|---|
transactionHash | String | The 32-byte hash of the transaction to retrieve |
🔄 Returns
Raw Transaction Data - Hex-encoded string containing the complete RLP-serialized transaction bytes
🌐 Request
POST https://base-mainnet.chainnodes.org/YOUR-API-KEY
🧪 Example
- HTTPS POST Request with a JSON RPC call in the body
- Replace YOUR-API-KEY with the API key from your Chainnodes.org Dashboard
- You can use a different supported network by replacing
base-mainnet
curl https://base-mainnet.chainnodes.org/YOUR-API-KEY \
-X POST \
-H "Content-Type: application/json" \
-d '{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0x5d8a05bab34ef196b2c8eb8c1f1fbc644a0d9a5799a2591e72eeeeab134350c7"],"id":1}'
📊 Response
{
"jsonrpc": "2.0",
"id": 1,
"result": "0x02f902e401827735940085215b6afe008301fc9494c02aaa39b223fe8d0a0e5c4f27ead9083c756cc280b902c43593564c000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000642f1f1f00000000000000000000000000000000000000000000000000000000000000020b080000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000000000000000004000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000002000000000000000000000000000000000000000000000000016345785d8a0000000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000c080a0792f85f2a8d0324ee866ed5fe2cda17f4b3b31fda94e81ed95be5fc19d64f0eca061fe50954b4b6aa9cfe5d283bd92fc9dbcf8bcf953f27d0111d2560440b45103"
}
🚀 Use Cases
1️⃣ Transaction Signature Verification
Independently verify transaction signatures without trusting an RPC provider by extracting the signature components (v, r, s) from the raw transaction.
// Get a transaction for verification
{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0x5d8a05bab34ef196b2c8eb8c1f1fbc644a0d9a5799a2591e72eeeeab134350c7"],"id":1}
2️⃣ Advanced Transaction Debugging
Debug complex transaction issues by examining the exact binary representation of the transaction on the Base chain.
// Retrieve raw transaction data for debugging
{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0xProblemTransactionHash"],"id":1}
3️⃣ Cross-Chain Transaction Analysis
Compare transaction formats between Ethereum mainnet and Base to understand L2-specific encoding differences.
// First get the transaction on Base
{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0xBaseTransactionHash"],"id":1}
// Then compare with the same method on Ethereum mainnet
4️⃣ Transaction Broadcasting & Recovery
Recover a pending or dropped transaction and rebroadcast it to the network with the exact same data.
// Get raw transaction for rebroadcasting
{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0xPendingTxHash"],"id":1}
// Then use eth_sendRawTransaction with the result to rebroadcast
5️⃣ Security Auditing & Compliance
Capture and store the exact transaction data for security audits or regulatory compliance requirements.
// Archive the exact binary transaction data
{"jsonrpc":"2.0","method":"eth_getRawTransactionByHash","params":["0xImportantTransactionHash"],"id":1}
🔐 Transaction Structure in Base
Base transactions follow the same RLP encoding format as Ethereum transactions, but may include Base-specific fields. The raw format typically includes:
- Transaction Type (first bytes, e.g.,
0x02
for EIP-1559 transactions) - Chain ID (Base mainnet chain ID is 8453)
- Nonce, Gas Price/Max Fee, Gas Limit fields
- To Address (recipient)
- Value (ETH amount)
- Data (contract interaction data)
- Access List (for type 1/2 transactions)
- Signature Components (v, r, s values)
🔗 Related Methods
- eth_getTransactionByHash - Get decoded transaction by hash
- eth_getRawTransactionByBlockHashAndIndex - Get raw transaction by block hash and index
- eth_sendRawTransaction - Send a raw transaction to the network
📚 Learn More
🧩 RLP Encoding: Recursive Length Prefix (RLP) is Ethereum's serialization format used to encode transaction data efficiently. The raw transaction bytes returned by this method are in RLP format, which can be decoded using Ethereum libraries.
🔍 Transaction Types: Base supports multiple transaction types including legacy (pre-EIP-1559), Type 1 (EIP-2930 with access lists), and Type 2 (EIP-1559) transactions. The first bytes of the raw transaction indicate its type.
🌉 Bridge Transactions: For transactions involving the Base-Ethereum bridge, raw transaction data can be especially valuable for verifying cross-chain operations and deposit/withdrawal proofs.
⚡ Quick Tip: When working with raw transactions on Base, remember that the chain ID (8453 for mainnet, 84531 for testnet) is embedded in the transaction data and is important for signature verification.
JSON-RPC Base API Documentation by CHAINNODES is based on Reth node client. Contact us if you are interested in specific methods that are only available on geth, besu, Nethermind or Erigon