curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_preimage",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}curl --request POST \
--url https://nd-954-882-037.p2pify.com/66f812de2a6724a75a51f60dd6f2a154 \
--header 'Content-Type: application/json' \
--data '
{
"id": 1,
"jsonrpc": "2.0",
"method": "debug_preimage",
"params": [
"0x0000000000000000000000000000000000000000000000000000000000000000"
]
}
'{
"jsonrpc": "<string>",
"id": 123,
"result": "<string>"
}arbtrace_* methods instead.--cache.preimages). If preimages are not stored, this method returns an error.hash — the Keccak-256 hash to look up the preimage for, encoded as a hex string.data — the raw preimage bytes as a hex string. Returns an error if the preimage is not found.debug_preimage code examplesconst ethers = require('ethers');
const NODE_URL = "YOUR_CHAINSTACK_ENDPOINT";
const provider = new ethers.JsonRpcProvider(NODE_URL);
const debugPreimage = async (hash) => {
const result = await provider.send("debug_preimage", [hash]);
console.log(result);
};
debugPreimage("0x0000000000000000000000000000000000000000000000000000000000000000");
debug_preimage method is useful for resolving Keccak-256 hashes back to their original values. In the state trie, account addresses and storage keys are stored as hashes. This method allows developers building state analysis tools to reverse-lookup hashes to their original addresses or data, which is essential for tools like state diff visualizers and trie explorers.Was this page helpful?