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.

FieldDescription

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

This field always has the value 0xe8d4a50fff(=999999999999 in decimal), which is an arbitrary figure since Klaytn has no GasLimit. At the time of writing, this figure is 30 times higher than the block gas limit of Ethereum. Please refer to Computation Cost for more details.

miner

This field returns the block proposer's address, because Klaytn's consensus mechanism is PBFT, which has a block proposer instead of miners.

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.

FieldDescription

gasPrice

Also known as Unit Price in Klaytn's context, this value is determined in the system via the governance processes.

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.

FieldDescription

effectiveGasPrice

Since Klaytn uses a fixed gas price policy, the gasPrice value is returned. gasPrice(also called Unit Price) is set in the system by the governance.

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