Klaytn Docs Archive
Getting StartedBuild a dAppNode OperationDeveloper Hub
  • Klaytn Docs
  • -
    • Klaytn Overview
      • Why Klaytn
      • Klaytn Design
        • Consensus Mechanism
        • Accounts
        • Transactions
          • Basic
          • Fee Delegation
          • Partial Fee Delegation
          • Ethereum
        • Computation
          • Klaytn Smart Contract
          • Execution Model
          • Computation Cost
            • Computation Cost (Previous docs)
          • Klaytn Virtual Machine
            • Klaytn Virtual Machine (Previous docs)
        • Storage
          • State Migration
          • StateDB Live Pruning
        • Transaction Fees
          • Transaction Fees (Previous docs)
        • Klaytn native coin - KLAY
        • Token Economy
        • Governance
        • Multi-Channel
        • KNI
      • Scaling Solutions
    • Getting Started
      • Deploying Smart Contract Using Foundry
      • Deploying Smart Contract Using Hardhat
      • Deploying Smart Contract Using Thirdweb
      • Deploying Smart Contract Using KEN
        • Launch an Endpoint Node
        • Top up your Account
        • Install Development Tools
        • Deploy a Smart Contract
        • Check the Deployment
        • Account Management
          • Creating Accounts
          • Managing Accounts
      • Development Environment
      • Getting KLAY
    • Smart Contract
      • Solidity - Smart Contract Language
      • Precompiled Contracts
        • Precompiled Contracts (Previous docs)
      • IDE and Tools
        • Truffle
      • Sample Contracts
        • KlaytnGreeter
        • ERC-20
          • 1. Writing ERC-20 Smart Contract
          • 2. Deploying Smart Contract
          • 3. Interacting with ERC-20 token from Klaytn Wallet
        • ERC-721
          • 1. Writing ERC-721 Smart Contract
          • 2. Deploying Smart Contract
      • Testing Guide
      • Deployment Guide
      • Klaytn Compatible Tokens
      • Porting Ethereum Contract
    • Run a Node
      • Deployment
        • Endpoint Node
          • System Requirements
          • Installation Guide
            • Download
            • Installation Guide
            • Configuration
            • Startup the EN
            • Testing the Installation
          • ken CLI commands
          • JSON-RPC APIs
        • Core Cell
          • System Requirements
          • Network Configuration
          • Installation Guide
            • Download
            • Before You Install
            • Consensus Node Setup
              • Installation Guide
              • Configuration
              • Startup the CN
            • Proxy Node Setup
              • Installation Guide
              • Configuration
              • Startup the PN
            • Testing the Core Cell
          • Monitoring Setup
          • H/A Setup
        • Service Chain
          • Getting Started
            • Setting up a 4-node Service Chain
            • Connecting to Baobab
            • Cross-Chain Value Transfer
            • HA(High Availability) for ServiceChain
            • Nested ServiceChain
            • Value Transfer between Sibling ServiceChains
          • Reference Manuals
            • System Requirements
            • Download
            • SCN User Guide
              • Installation
              • Configuration
              • Starting/Stopping SCN
              • Checking Node Status
              • kscn commands
              • homi commands
            • SPN/SEN User Guide
              • Installation
              • Configuration
              • Starting/Stopping Node
              • Checking Node Status
            • Bridge Configuration
            • Anchoring
            • KAS Anchoring
            • Value Transfer
            • Configuration Files
            • Log Files
            • Genesis JSON
            • Upgrade & Hard Fork
          • How-To Guides
        • Download Node Packages
          • v1.12.0
          • v1.11.1
          • v1.11.0
          • v1.10.2
          • v1.10.1
          • v1.10.0
          • v1.9.1
          • v1.9.0
          • v1.8.4
          • v1.8.3
          • v1.8.2
          • v1.8.1
          • v1.8.0
          • v1.7.3
          • v1.7.2
          • v1.7.1
          • v1.7.0
          • v1.6.4
          • v1.6.3
          • v1.6.2
          • v1.6.1
          • v1.6.0
          • v1.5.3
          • v1.5.2
          • v1.5.1
          • v1.5.0
          • v1.4.2
          • v1.4.1
          • v1.4.0
          • v1.3.0
          • v1.2.0
          • v1.1.1
          • v1.0.0
          • v0.9.6
          • v0.8.2
    • Operation Guide
      • Configuration
      • Node Log
      • Log operation
      • Errors & Troubleshooting
      • Klaytn Command
      • Chaindata Change
      • Chaindata Migration
    • dApp Developers
      • JSON-RPC APIs
        • API references
          • eth
            • Caution
            • Account
            • Block
            • Transaction
            • Config
            • Filter
            • Gas
            • Miscellaneous
          • klay
            • Account
            • Block
            • Transaction
              • Working with Klaytn Transaction Types
            • Configuration
            • Filter
            • Gas
            • Miscellaneous
          • net
          • debug
            • Logging
            • Profiling
            • Runtime Tracing
            • Runtime Debugging
            • VM Tracing
            • VM Standard Tracing
            • Blockchain Inspection
          • admin
          • personal
          • txpool
          • governance
        • Service Chain API references
          • mainbridge
          • subbridge
        • Transaction Error Codes
      • RPC Service Providers
        • Public Endpoints
      • SDK & Libraries for interacting with Klaytn Node
        • caver-js
          • Getting Started
          • Sending a sample transaction
          • API references
            • caver.account
            • caver.wallet
              • caver.wallet.keyring
            • caver.transaction
              • Basic
              • Fee Delegation
              • Partial Fee Delegation
            • caver.rpc
              • caver.rpc.klay
              • caver.rpc.net
              • caver.rpc.governance
            • caver.contract
            • caver.abi
            • caver.kct
              • caver.kct.kip7
              • caver.kct.kip17
              • caver.kct.kip37
            • caver.validator
            • caver.utils
            • caver.ipfs
          • caver-js ~v1.4.1
            • Getting Started (~v1.4.1)
            • API references
              • caver.klay
                • Account
                • Block
                • Transaction
                  • Legacy
                  • Value Transfer
                  • Value Transfer Memo
                  • Account Update
                  • Smart Contract Deploy
                  • Smart Contract Execution
                  • Cancel
                • Configuration
                • Filter
                • Miscellaneous
              • caver.klay.net
              • caver.klay.accounts
              • caver.klay.Contract
              • caver.klay.KIP7
              • caver.klay.KIP17
              • caver.klay.abi
              • caver.utils (~v1.4.1)
            • Porting from web3.js
        • caver-java
          • Getting Started
          • API references
          • caver-java ~v1.4.0
            • Getting Started (~v1.4.0)
            • Porting from web3j
        • ethers.js
        • web3.js
      • Tutorials
        • Klaytn Online Toolkit
        • Fee Delegation Example
        • Count DApp
          • 1. Environment Setup
          • 2. Clone Count DApp
          • 3. Directory Structure
          • 4. Write Smart Contract
          • 5. Frontend Code Overview
            • 5-1. Blocknumber Component
            • 5-2. Auth Component
            • 5-3. Count Component
          • 6. Deploy Contract
          • 7. Run App
        • Klaystagram
          • 1. Environment Setup
          • 2. Clone Klaystagram DApp
          • 3. Directory Structure
          • 4. Write Klaystagram Smart Contract
          • 5. Deploy Contract
          • 6. Frontend Code Overview
          • 7. FeedPage
            • 7-1. Connect Contract to Frontend
            • 7-2. UploadPhoto Component
            • 7-3. Feed Component
            • 7-4. TransferOwnership Component
          • 8. Run App
        • Building a Buy Me a Coffee dApp
          • 1. Project Setup
          • 2. Creating a BMC Smart Contract
          • 3. Testing the contract using scripts
          • 4. Deploying BMC Smart contract
          • 5. Building the BMC Frontend with React and Web3Onboard
          • 6. Deploying Frontend code on IPFS using Fleek
          • 7. Conclusion
        • Migrating Ethereum App to Klaytn
        • Connecting MetaMask
        • Connecting Remix
        • Verifying Smart Contracts Using Block Explorers
      • Developer Tools
        • Wallets
          • Kaikas
          • Klaytn Wallet
          • Klaytn Safe
            • Klaytn Safe Design
            • Create a Safe
            • Add assets
            • Send assets
            • Contract Interaction
            • Transaction Builder
            • Points to Note
            • Frequently Asked Questions
          • SafePal S1
          • Wallet Libraries
            • Web3Auth
            • Web3Modal
            • Web3-Onboard
            • Particle Network
        • Oracles
          • Orakl Network
          • Witnet
          • SupraOracles
        • Indexers
          • SubQuery
        • Cross-chain
          • LayerZero
        • Block Explorers
          • Klaytnscope
          • Klaytnfinder
        • Klaytn Contracts Wizard
    • Glossary
  • ---
    • Klaytn Hard Fork History
    • Klaytn 2.0
      • Metaverse Package
      • Finality and Improvements
      • Ethereum Compatibility
      • Decentralizing Governance
      • Massive Eco Fund
    • FAQ
    • Open Source
    • Terms of Use
    • Languages
  • ℹ️Latest Klaytn Docs
Powered by GitBook
On this page
  • Account
  • Block
  • Transaction
  • Configuration
  • Filter
  • Gas
  • Miscellaneous
  • Differences Overview from Ethereum
  • Block
  • Transaction
  • Transaction Receipt
  1. -
  2. dApp Developers
  3. JSON-RPC APIs
  4. API references

eth

eth namespace APIs.

PreviousAPI referencesNextCaution

Last updated 1 year ago

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 . 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 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

Block

Field
Description

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

Due to the fundamental design differences between Klaytn and Ethereum, Klaytn transactions cannot be fully supported via eth namespace APIs.

Field
Description

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

Due to the fundamental design differences existing between Klaytn and Ethereum, Klaytn transaction receipt cannot be fully supported when served via Ethereum namespace APIs.

Field
Description

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.

Please check the section which describes the differences between Klaytn and Ethereum when serving eth namespace APIs in more detail.

Related APIs: , , , , , .

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 . Please refer to for more details.

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

Related APIs: , , , .

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

Related APIs: .

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

Transaction
Configuration
Filter
Gas
Miscellaneous
Caution
eth_getHeaderByNumber
eth_getHeaderByHash
eth_getBlockByHash
eth_getBlockByNumber
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getTransactionByHash
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_pendingTransactions
eth_getTransactionReceipt
block gas limit of Ethereum
Computation Cost
Ethereum's JSON-RPC API
Account
Block
Differences Overview from Ethereum
consensus mechanism
eth_coinbase
eth_etherbase
eth_chainId
eth_gasPrice
eth_accounts
eth_getBalance
eth_getCode
eth_getTransactionCount
eth_sign
eth_getFilterChanges
eth_getFilterLogs
eth_getLogs
eth_newBlockFilter
eth_newFilter
eth_newPendingTransactionFilter
eth_subscribe
eth_uninstallFilter
eth_unsubscribe
PBFT
eth_call
eth_estimateGas
eth_getTransactionByBlockHashAndIndex
eth_getTransactionByBlockNumberAndIndex
eth_getTransactionByHash
eth_getTransactionReceipt
eth_sendRawTransaction
eth_sendTransaction
eth_signTransaction
eth_fillTransaction
eth_pendingTransactions
eth_resend
Unit Price
Unit Price
eth_feeHistory
eth_maxPriorityFeePerGas
eth_blockNumber
eth_getHeaderByNumber
eth_getHeaderByHash
eth_getBlockByNumber
eth_getBlockByHash
eth_getUncleByBlockHashAndIndex
eth_getUncleByBlockNumberAndIndex
eth_getBlockTransactionCountByNumber
eth_getBlockTransactionCountByHash
eth_getUncleCountByBlockNumber
eth_getUncleCountByBlockHash
eth_getStorageAt
eth_mining
eth_syncing
eth_hashrate
eth_getWork
eth_submitWork
eth_submitHashrate