Caution
Cautions when using eth namespace apis in Klaytn.
Klaytn supports eth
namespace APIs, so developers using Ethereum based SDKs or tools now can easily migrate their existing projects to Klaytn. (e.g. You can replace the endpoint URL in the Ethereum tools to point to a Klaytn node.)
But due to the fundamental design differences existing between Klaytn and Ethereum, some APIs cannot be fully supported. (e.g. some fields have always zero value)
This document describes the limitations of those APIs.
Block Header
Related APIs: eth_getHeaderByNumber, eth_getHeaderByHash.
Please read the description ⚠️ carefully.
The ✅ icon in the description denotes that the field used in the same way as in Ethereum.
baseFeePerGas
(added)
⚠️ This field always has the value 0x0
because Klaytn does not have a baseFeePerGas scheme.
difficulty
(added)
⚠️ 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
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
(added)
⚠️ 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.
gasUsed
gasUsed
✅ A scalar value equal to the total gas used in transactions in this block.
governanceData(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Block Header.
hash
hash
✅ A hash of the block.
logsBloom
logsBloom
✅ The bloom filter for the logs of the block. null
when it is pending block.
miner
(added)
⚠️ This field returns the block proposer's address, because Klaytn's consensus mechanism is PBFT, which has a block proposer instead of miners.
mixHash
(added)
⚠️ This field always has zeroHash (0x00...
) because Klaytn's consensus mechanism is not based on PoW.
nonce
(added)
⚠️ This field always has zeroNonce (0x00...
) because Klaytn's consensus mechanism is not based on PoW.
number
number
✅ The block number.
parentHash
parentHash
✅ The hash of the parent block.
receiptsRoot
receiptsRoot
✅ the root of the receipts trie of the block.
reward(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Block Header.
sha3Uncles
(added)
⚠️ 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.
size
size
✅ The size of this block in bytes.
stateRoot
stateRoot
✅ The root of the final state trie of the block.
timestamp
timestamp
✅ The unix timestamp for when the block was collated.
timestampFoS(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Block Header.
totalDifficulty
(added)
⚠️ The total difficulty of the chain until the querying block.
transactionsRoot
transactionsRoot
✅ The root of the transaction trie of the block.
Block
Related APIs: eth_getBlockByHash, eth_getBlockByNumber, eth_getUncleByBlockHashAndIndex, eth_getUncleByBlockNumberAndIndex.
Since Block contains fields of Header and header has already been covered above, this section describes the remaining fields of the block except for header.
Please read the description ⚠️ carefully.
The ✅ icon in the description denotes that the field used in the same way as in Ethereum.
voteData(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Block.
uncles
(added)
⚠️ This field always has the value []
because there is no technical concept of uncles block in Klaytn core.
transactions
transactions
✅ Array of transaction objects, or 32 Bytes transaction hashes depending on the last given parameter.
Transaction
Related APIs: eth_getTransactionByHash, eth_getTransactionByBlockHashAndIndex, eth_getTransactionByBlockNumberAndIndex, eth_pendingTransactions.
There are lots of transaction types in Klaytn, and fields of data structure vary based on the type.
So you have to check how various types of Klaytn transaction are converted as Ethereum transaction because during converting process some fields are omitted or added with zero or dummy values. That means Some important information(in terms of Klaytn) will be lost during converting.
Please note that we define EthereumLegacyTransaction in this document as the Ethereum transaction format before EIP-2718.
When you try to query Klaytn transactions via eth namespace JSON-RPC apis, Klaytn transactions will be return as Ethereum Legacy Transaction type.
This document describes the details of converting process (Klaytn transactions -> Ethereum Legacy Transaction).
Please read the description ⚠️ carefully.
The ✅ icon in the description denotes that the field used in the same way as in Ethereum.
Common Fields
Regardless of various Klaytn transaction type, there are common fields. This section describes how that common fields are served as Ethereum Legacy Transaction.
blockHash
blockHash
✅ Block hash.
blockNumber
blockNumber
✅ Block number.
from
from
✅ Address of the sender.
gas
gas
✅ Gas provided by the sender.
gasPrice
gasPrice
⚠️ Also known as Unit Price in Klaytn's context, this value is determined in the system via the governance processes.
hash
hash
✅ Transaction hash.
input
(covered in below sections)
The description of this field is covered in the detailed transaction items below.
nonce
nonce
✅ The number of transactions made by the sender prior to this one.
senderTxHash(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
signatures(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
to
(covered in below sections)
The description of this field is covered in the detailed transaction items below.
transactionIndex
transactionIndex
⚠️ Almost same with Ethereum but unlike Ethereum, Klaytn returns integer as it is when its pending.
value
(covered in below sections)
The description of this field is covered in the detailed transaction items below.
type
type(converted)
⚠️ 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
.
typeInt(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
v
(added)
⚠️ Klaytn supports MultiSig so transaction in Klaytn can have more than one signature. signatures[0].V
is used as the value of the field v
.
r
(added)
⚠️ Klaytn supports MultiSig so transaction in Klaytn can have more than one signature. signatures[0].R
is used as the value of the field r
.
s
(added)
⚠️ Klaytn supports MultiSig so transaction in Klaytn can have more than one signature. signatures[0].S
is used as the value of the field s
.
Common Fields For FeeDelegation
Regardless of various Klaytn FeeDelegation transaction type, there are common fields. This section describes how that common fields for feeDelegation(except for the common fields covered above) are served as Ethereum Legacy Transaction.
feePayer(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
feePayerSignatures(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
Common Fields For PartialFeeDelegation
Regardless of various Klaytn PartialFeeDelegation transaction type, there are common fields. This section describes how that common fields for partialFeeDelegation(except for the common fields covered above) are served as Ethereum Legacy Transaction.
feeRatio(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
Different fields for each transaction type
LegacyTransaction
input
input
✅ The data sent along with the transaction.
to
to
✅ Address of the receiver. null
when its a contract creation transaction.
value
value
✅ Value transferred in Peb.
Klaytn LegacyTransaction is served as Ethereum Legacy Transaction like below.
ValueTransfer
input
(added)
⚠️ This field always has value 0x
which means empty input because this field does not exist in Klaytn ValueTransfer transaction.
to
to
✅ Address of the receiver.
value
value
✅ Value transferred in Peb.
Klaytn ValueTransfer Transaction is served as Ethereum Legacy Transaction like below.
ValueTransferMemo
input
input
✅ The data sent along with the transaction.
to
to
✅ Address of the receiver.
value
value
✅ Value transferred in Peb.
Klaytn ValueTransferMemo Transaction is served as Ethereum Legacy Transaction like below.
SmartContractDeploy
codeFormat(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
humanReadable(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
input
input
✅ The data sent along with the transaction.
to
to
✅ Address of the receiver. This field always has value null
because this transaction is a contract creation transaction.
value
value
✅ Value transferred in Peb.
Klaytn SmartContractDeploy Transaction is served as Ethereum Legacy Transaction like below.
SmartContractExecution
input
input
✅ The data sent along with the transaction.
to
to
✅ Address of the smart contract.
value
value
✅ Value transferred in Peb.
Klaytn SmartContractExecution Transaction is served as Ethereum Legacy Transaction like below.
AccountUpdate
key(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
input
(added)
⚠️ This field always has value 0x
which means empty input because this field does not exist in Klaytn AccountUpdate transaction.
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn AccountUpdate transaction and giving a value of this field as from
address is most meaningful.
value
(added)
⚠️ This field always has value 0x0
because this field does not exist in Klaytn AccountUpdate transaction.
Klaytn AccountUpdate Transaction is served as Ethereum Legacy Transaction like below.
Cancel
input
(added)
⚠️ This field always has value 0x
which means empty input because this field does not exist in Klaytn Cancel transaction.
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn Cancel transaction and giving a value of this field as from
address is most meaningful.
value
(added)
⚠️ This field always has value 0x0
because this field does not exist in Klaytn Cancel transaction.
Klaytn Cancel Transaction is served as Ethereum Legacy Transaction like below.
ChainDataAnchoring
input
input
✅ The data sent along with the transaction.
inputJSON(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Legacy Transaction.
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn ChainDataAnchoring transaction and giving a value of this field as from
address is most meaningful.
value
(added)
⚠️ This field always has value 0x0
because this field does not exist in Klaytn ChainDataAnchoring transaction.
Klaytn ChainDataAnchoring Transaction is served as Ethereum Legacy Transaction like below.
Transaction Receipt
Related APIs: eth_getTransactionReceipt.
By default, the fields in the Klaytn Transaction Receipt are different depending on the transaction type. Because there are lots of transaction types in Klaytn, fields of transaction receipt vary based on the transaction type.
When you try to query Klaytn transaction receipts via eth namespace JSON-RPC apis, Klaytn TransactionReceipt will be returned as Ethereum Transaction Receipt.
This document describes the details of converting process (Klaytn Transaction Receipt -> Ethereum Transaction Receipt).
Please read the description ⚠️ carefully.
The ✅ icon in the description denotes that the field used in the same way as in Ethereum.
Common Fields
Regardless of various Klaytn transaction type, there are common fields. (Please remind that fields of Klaytn Transaction Receipt are various based on transaction types.)
This section describes how that common fields are served as Ethereum Transaction Receipt.
blockHash
blockHash
✅ Block hash.
blockNumber
blockNumber
✅ Block number.
contractAddress
contractAddress
✅ The contract address created, if the transaction was a contract creation, otherwise - null
.
cumulativeGasUsed
(added)
⚠️ The total amount of gas used when this transaction was executed in the block. It is provided with the same meaning as the Ethereum field.
effectiveGasPrice
(added)
⚠️ 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.
from
from
✅ Address of the sender.
gas(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
gasUsed
gasUsed
✅ the amount of gas used by this specific transaction alone.
gasPrice(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
logs
logs
✅ Array of log objects generated by transactions.
logsBloom
logsBloom
✅ Bloom filter for light clients to quickly retrieve related logs.
nonce(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
senderTxHash(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
signatures(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
status
status
✅ Either 1(success) or 0(failure).
to
(covered in below sections)
The description of this field is covered in the detailed transaction items below.
transactionHash
transactionHash
✅ The transaction hash.
transactionIndex
transactionIndex
⚠️ Almost same with Ethereum but unlike Ethereum, Klaytn returns integer as it is when its pending.
type
type(converted)
⚠️ Value and data type of this field is converted. The type of this field is a string(e.g. "LegacyTransaction"
) in Klaytn but it is converted and served as hexadecimal(e.g. 0x
) just like Ethereum Transaction Receipt.
typeInt(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Common Fields For FeeDelegation
Regardless of various Klaytn FeeDelegation transaction type, there are common fields. (Please remind that fields of Klaytn Transaction Receipt are various based on transaction types.)
This section describes how that common fields for feeDelegation(except for the common fields covered above) are served as Ethereum Transaction Receipt.
feePayer(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
feePayerSignatures(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Common Fields For PartialFeeDelegation
Regardless of various Klaytn PartialFeeDelegation transaction type, there are common fields. (Please remind that fields of Klaytn Transaction Receipt are various based on transaction types.)
This section describes how that common fields for partialFeeDelegation(except for the common fields covered above) are served as Ethereum Transaction Receipt.
feeRatio(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Different fields for each transaction type
LegacyTransaction Receipt
input(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
to
to
✅ Address of the receiver. null
when its a contract creation transaction.
value(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Klaytn LegacyTransaction Receipt is served as Ethereum Transaction Receipt like below.
ValueTransfer Transaction Receipt
to
to
✅ Address of the receiver.
value(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Klaytn ValueTransfer Transaction Receipt is served as Ethereum Transaction Receipt like below.
ValueTransferMemo Transaction Receipt
input(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
to
to
✅ Address of the receiver.
value(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Klaytn ValueTransferMemo Transaction is served as Ethereum Transaction Receipt like below.
SmartContractDeploy Transaction Receipt
codeFormat(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
humanReadable(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
input
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt
to
to
✅ Address of the receiver. This field always has value null
because this transaction is a contract creation transaction.
value
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt
Klaytn SmartContractDeploy Transaction Receipt is served as Ethereum Transaction Receipt like below.
SmartContractExecution Transaction Receipt
input
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
to
to
✅ Address of the smart contract.
value
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
Klaytn SmartContractExecution Transaction Receipt is served as Ethereum Transaction Receipt like below.
AccountUpdate Transaction Receipt
key(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn AccountUpdate transaction receipt and giving a value of this field as from
address is most meaningful.
Klaytn AccountUpdate Transaction Receipt is served as Ethereum Transaction Receipt like below.
Cancel Transaction Receipt
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn Cancel transaction receipt and giving a value of this field as from
address is most meaningful.
Klaytn Cancel Transaction Receipt is served as Ethereum Transaction Receipt like below.
ChainDataAnchoring Transaction Receipt
input(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
inputJSON(omitted)
⚠️ This field is omitted because this field does not exist in Ethereum Transaction Receipt.
to
(added)
⚠️ This field always has same address with from
because this field does not exist in Klaytn ChainDataAnchoring transaction receipt and giving a value of this field as from
address is most meaningful.
Klaytn ChainDataAnchoring Transaction Receipt is served as Ethereum Transaction Receipt like below.
Last updated