eth
eth namespace APIs.
The namespace eth
provides functions related to accounts, blocks, transactions, configurations of networks or nodes, filters, and so on.
Klaytn now supports the namespace eth
of Ethereum's JSON-RPC API. Please note that some return values have been adjusted to match the Ethereum's API response body.
And due to the fundamental design differences between Klaytn and Ethereum, Klaytn's data structure (Transaction, Block, and TransactionReceipt) cannot be fully supported via eth
namespace APIs.
Please check the Differences Overview from Ethereum in this document.
NOTE: eth
namespace APIs are supported from Klaytn v1.8.0.
The list below enumerates the API functions. All eth
namespace APIs are supported on Klaytn.
Differences Overview from Ethereum
Please check the Caution section which describes the differences between Klaytn and Ethereum when serving eth namespace APIs in more detail.
Block
Related APIs: eth_getHeaderByNumber, eth_getHeaderByHash, eth_getBlockByHash, eth_getBlockByNumber, eth_getUncleByBlockHashAndIndex, eth_getUncleByBlockNumberAndIndex.
baseFeePerGas
This field always has the value 0x0
because Klaytn does not have a baseFeePerGas scheme.
difficulty
This field corresponds to blockScore
in the Klaytn header, which is fixed to 0x1
. This is because Klaytn's consensus mechanism is not based on PoW, indicating the technical concept of block difficulty is not applicable to Klaytn core.
extraData
This field always has the value 0x
indicating the empty value. Owing to the fact that Klaytn's extraData
contains consensus data such as validators addresses, validators signatures, and proposer signature, it is not applicable to eth
namespace API.
gasLimit
miner
mixHash
This field always has zeroHash (0x00...
) because Klaytn's consensus mechanism is not based on PoW.
nonce
This field always has zeroNonce (0x00...
) because Klaytn's consensus mechanism is not based on PoW.
sha3Uncles
This field always has 0x1dcc4de8dec75d7aab85b567b6ccd41ad312451b948a7413f0a142fd40d49347
, which is the Keccak256 hash of the RLP-encoded bytes of the list containing empty block header because there are no uncles blocks on Klaytn.
totalDifficulty
The total difficulty of the chain until the querying block.
uncles
This field always has the value []
because there is no technical concept of uncles block in Klaytn core.
Fields not covered here will stick to the block fields of Ethereum.
Transaction
Related APIs: eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, eth_pendingTransactions.
Due to the fundamental design differences between Klaytn and Ethereum, Klaytn transactions cannot be fully supported via
eth
namespace APIs.
gasPrice
type
In Klaytn, type
returns the transaction type in string (e.g. "LegacyTransaction"
), but it has been converted to hexadecimal (e.g. 0x0
) to match Ethereum. Transaction types that are only valid in Klaytn always return 0x0
.
Klaytn transactions can have more than one signature because Klaytn supports MultiSig (Ethereum transactions only have one signature field (= v, r, s)) even on protocol-level. In that context, fields related to signature (v, r, s) will match tx.signatures[0].V
, tx.signatures[0].R
, and tx.signatures[0].S
.
Fields not covered here will stick to the transaction fields of Ethereum.
Transaction Receipt
Related APIs: eth_getTransactionReceipt.
Due to the fundamental design differences existing between Klaytn and Ethereum, Klaytn transaction receipt cannot be fully supported when served via Ethereum namespace APIs.
effectiveGasPrice
transactionIndex
Almost same with Ethereum but unlike Ethereum, Klaytn returns integer as it is when its pending.
Fields not covered here will stick to Ethereum's suggested fields of transaction_receipt.
Last updated