For the complete documentation index, see llms.txt. This page is also available as Markdown.

JSON-RPC API Methods

Pharos Network is a fully EVM-equivalent Layer 1 blockchain, supporting a JSON-RPC interface for seamless blockchain interactions. This RPC API is fully compatible with existing Ethereum JSON-RPC API while also providing richer semantics and enhanced services.

Standard Ethereum Methods

eth_gasPrice

Returns the current gas price in Wei.

  • Input: None

  • Output: String - Gas price in Wei

Example:

// Request
{
  "jsonrpc": "2.0",
  "method": "eth_gasPrice",
  "params": [],
  "id": 1
}

// Response
{
  "jsonrpc": "2.0",
  "id": 1,
  "result": "0x2540be400"
}

eth_maxPriorityFeePerGas

Returns the priority fee needed to be included in a block (EIP-1559).

  • Input: None

  • Output: String - Priority fee in Wei

Example:

eth_feeHistory

Returns historical gas information for fee estimation (EIP-1559).

  • Input:

    • String - Number of blocks in the requested range

    • String - Highest block of the requested range

    • Array - Reward percentiles to sample from each block

  • Output: Object - Fee history data including baseFeePerGas, gasUsedRatio, and reward

Example:

eth_blockNumber

Returns the number of the most recent block.

  • Input: None

  • Output: String - Block number in hexadecimal

Example:

eth_chainId

Returns the chain ID of the current network.

  • Input: None

  • Output: String - Chain ID as a hexadecimal string

Example:

eth_syncing

Returns the sync status of the node.

  • Input: None

  • Output: Object|Boolean - Sync status object, or false if not syncing

Example:

eth_getBalance

Returns the balance of an address at a given block.

  • Input:

    • String - Address to query

    • String - Block number or tag (latest, earliest, pending, safe, finalized)

  • Output: String - Balance in Wei as hexadecimal

Example:

eth_getTransactionCount

Returns the number of transactions sent from an address (nonce).

  • Input:

    • String - Address to query

    • String - Block number or tag

  • Output: String - Transaction count as hexadecimal

Example:

eth_getStorageAt

Returns the value from a storage position at a given address.

  • Input:

    • String - Address of the contract

    • String - Position in storage

    • String - Block number or tag

  • Output: String - Storage value as hexadecimal

Example:

eth_getCode

Returns the contract code at a given address.

  • Input:

    • String - Address to query

    • String - Block number or tag

  • Output: String - Contract bytecode as hexadecimal

Example:

eth_getProof

Returns the account and storage values with Merkle proof (EIP-1186). Pharos supports Simplified Payment Verification (SPV) using these proofs.

  • Input:

    • String - Address

    • Array - Array of storage keys

    • String - Block number or tag

  • Output: Object - Account proof including balance, codeHash, nonce, storageHash, and proofs

Example:

eth_sendRawTransaction

Submits a signed transaction to the network. Supports legacy, EIP-2930 (access list), and EIP-1559 transaction types.

  • Input:

    • String - Signed transaction data

  • Output: String - Transaction hash

Example:

eth_call

Executes a message call without creating a transaction. Useful for reading contract state.

  • Input:

    • Object - Transaction call object (from, to, gas, gasPrice, value, data)

    • String - Block number or tag

  • Output: String - Return data as hexadecimal

Example:

eth_estimateGas

Estimates the gas needed to execute a transaction.

  • Input:

    • Object - Transaction call object

    • String - Block number or tag (optional)

  • Output: String - Estimated gas as hexadecimal

Example:

eth_createAccessList

Creates an EIP-2930 access list for a transaction.

Note: This method is still under debugging and may return null values.

  • Input:

    • Object - Transaction call object

    • String - Block number or tag

  • Output: Object - Access list and estimated gas

Example:

eth_getBlockByHash

Returns information about a block by its hash.

  • Input:

    • String - Block hash

    • Boolean - If true, returns full transaction objects; if false, returns transaction hashes

  • Output: Object - Block information

Example:

eth_getBlockByNumber

Returns information about a block by its number.

  • Input:

    • String - Block number or tag

    • Boolean - If true, returns full transaction objects

  • Output: Object - Block information

Example:

eth_getBlockReceipts

Returns all transaction receipts for a given block.

  • Input:

    • String - Block number or tag

  • Output: Array - List of transaction receipts

Example:

eth_getBlockTransactionCountByHash

Returns the number of transactions in a block by block hash.

  • Input:

    • String - Block hash

  • Output: String - Transaction count as hexadecimal

Example:

eth_getBlockTransactionCountByNumber

Returns the number of transactions in a block by block number.

  • Input:

    • String - Block number or tag

  • Output: String - Transaction count as hexadecimal

Example:

eth_getTransactionByHash

Returns information about a transaction by its hash.

  • Input:

    • String - Transaction hash

  • Output: Object - Transaction details

Example:

eth_getTransactionByBlockHashAndIndex

Returns a transaction by block hash and index position.

  • Input:

    • String - Block hash

    • String - Transaction index (hexadecimal)

  • Output: Object - Transaction details

Example:

eth_getTransactionByBlockNumberAndIndex

Returns a transaction by block number and index position.

  • Input:

    • String - Block number or tag

    • String - Transaction index (hexadecimal)

  • Output: Object - Transaction details

Example:

eth_getTransactionReceipt

Returns the receipt of a transaction by transaction hash.

  • Input:

    • String - Transaction hash

  • Output: Object - Transaction receipt

Example:

eth_getLogs

Returns logs matching a given filter object.

  • Input:

    • Object - Filter parameters (fromBlock, toBlock, address, topics)

  • Output: Array - List of log entries

Note: Block range is limited to 100 blocks when rate limiting is enabled, or 10,000 blocks as a fallback cap.

Example:

eth_subscribe

Creates a subscription for real-time events (WebSocket only).

  • Input:

    • String - Subscription type: newHeads or logs

    • Object - Filter parameters (for logs type only)

  • Output: String - Subscription ID

Note: Only available over WebSocket connections. HTTP calls will fail.

Example:

eth_unsubscribe

Cancels an existing subscription (WebSocket only).

  • Input:

    • String - Subscription ID

  • Output: Boolean - true if successfully unsubscribed

Example:


Network Methods

net_version

Returns the current network ID.

  • Input: None

  • Output: String - Network ID

Example:

net_listening

Returns whether the node is actively listening for network connections.

  • Input: None

  • Output: Boolean - Returns true if the node is listening for connections (hardcoded to true in current implementation)

Note: This method is not available on the public RPC endpoint.

net_peerCount

Returns the number of connected peers.

  • Input: None

  • Output: String - Number of peers as hexadecimal

Note: This method is not available on the public RPC endpoint.


Web3 Methods

web3_clientVersion

Returns the current client version.

  • Input: None

  • Output: String - Client version string

Example:

web3_sha3

Returns the Keccak-256 hash of the given data.

  • Input:

    • String - Data to hash (hexadecimal)

  • Output: String - Keccak-256 hash

Note: This method is not available on the public RPC endpoint.


Debug Methods

debug_traceTransaction

Returns the execution trace of a transaction.

  • Input:

    • String - Transaction hash

    • Object - Tracer options (optional). Currently only "callTracer" is supported.

  • Output: Object - Execution trace

Example:

debug_traceCall

Executes a call and returns the execution trace without creating a transaction.

  • Input:

    • Object - Transaction call object

    • String - Block number or tag

    • Object - Tracer options (optional). Currently only "callTracer" is supported.

  • Output: Object - Execution trace

Example:

debug_traceBlockByHash

Returns traces for all transactions in a block by block hash.

  • Input:

    • String - Block hash

    • Object - Tracer options (optional). Currently only "callTracer" is supported as the tracer type.

  • Output: Array - Array of execution traces

Example:

debug_traceBlockByNumber

Returns traces for all transactions in a block by block number.

  • Input:

    • String - Block number or tag

    • Object - Tracer options (optional). Currently only "callTracer" is supported as the tracer type.

  • Output: Array - Array of execution traces

Example:

debug_getRawBlock

Returns the RLP-encoded block data.

  • Input:

    • String - Block number, block hash, or tag

  • Output: String - RLP-encoded block data

Example:

debug_getRawHeader

Returns the RLP-encoded block header.

  • Input:

    • String - Block number, block hash, or tag

  • Output: String - RLP-encoded header data

Example:

debug_getRawReceipts

Returns the raw receipts for a block.

  • Input:

    • String - Block number, block hash, or tag

  • Output: Array - Raw receipt data

Example:

debug_getRawTransaction

Returns the raw transaction data by hash.

  • Input:

    • String - Transaction hash

  • Output: String - Raw transaction data

Example:

debug_protocolVersion

Returns detailed protocol and version information.

  • Input: None

  • Output: Object - Version information including:

    • binaryVersion - Node binary version

    • currentSpecVersion - Current spec version

    • currentStableBlock - Current stable block number

    • higherSpecVersions - Available higher spec versions

    • protocolVersion - Protocol version string

Note: This method is not available on the public RPC endpoint.


Trace Methods

trace_filter

Returns traces matching a given filter.

  • Input:

    • Object - Filter parameters:

      • fromBlock - Start block (hexadecimal)

      • toBlock - End block (hexadecimal)

      • fromAddress - Array of sender addresses (optional)

      • toAddress - Array of receiver addresses (optional)

      • count - Maximum number of traces to return (optional)

      • after - Offset for pagination (optional)

  • Output: Array - Matching traces

Note: Block range is limited to 500 blocks.

Example:


Transaction Pool Methods

txpool_nonceFrom

Returns the next nonce for an address from the transaction pool.

  • Input:

    • String - Address

  • Output: String - Nonce as hexadecimal

Note: This method is not available on the public RPC endpoint.


Pharos Extension Methods

eth_getAccount

Returns account information at a given address (EIP-7587).

  • Input:

    • String - Address to query

    • String - Block number or tag

  • Output: Object - Account details including balance, nonce, codeHash, and storageRoot

Example:

eth_getProposerByTxHash

Returns the block proposer for a given transaction.

  • Input:

    • String - Transaction hash

  • Output: Object - Proposer information

Note: This method is not available on the public RPC endpoint.

eth_getProposersByBlockNumber

Returns the list of proposers for a given block.

  • Input:

    • String - Block number or tag

  • Output: Array - List of proposer addresses

Note: This method is not available on the public RPC endpoint.


Pharos Debug Extensions

These are Pharos-specific debug methods that extend the standard debug namespace.

debug_getValidatorInfo

Returns validator information for the consensus layer.

  • Input:

    • String - Block number or tag (optional)

  • Output: Object - Validator details

Example:

debug_getBlockProof

Returns the block proof data for BLS signature verification. See the BLS Verification Demo for usage examples.

  • Input:

    • String - Block number or tag

  • Output: Object - Block proof including BLS signatures

Example:

debug_getBlockReadStates

Returns the read state set for a block.

  • Input:

    • String - Block number or tag

  • Output: Object - Read state data

Note: This method is only available on internal debug endpoints.

debug_getBlockWriteStates

Returns the write state set for a block.

  • Input:

    • String - Block number or tag

  • Output: Object - Write state data

Note: This method is only available on internal debug endpoints.

debug_getBlockWriteSetKeys

Returns the write set keys for a block.

  • Input:

    • String - Block number or tag

  • Output: Array - Write set keys

Note: This method is only available on internal debug endpoints.


PoW Compatibility Methods (Deprecated)

These methods exist for Ethereum compatibility but return placeholder values since Pharos uses PoS consensus.

Method
Returns
Note

eth_coinbase

"0x0"

No mining reward address in PoS

eth_mining

false

Validators produce blocks, not miners

eth_hashrate

"0x0"

No hashrate in PoS

eth_accounts

[]

Node does not manage accounts

eth_pendingTransactions

[]

Returns empty array

eth_getCompilers

[]

Deprecated

eth_getUncleCountByBlockHash

null

Uncles are a PoW concept

eth_getUncleCountByBlockNumber

null

Uncles are a PoW concept

eth_getUncleByBlockHashAndIndex

null

Uncles are a PoW concept

eth_getUncleByBlockNumberAndIndex

null

Uncles are a PoW concept


Not Implemented Methods

The following methods are declared but not implemented. Calling them returns METHOD_NOT_FOUND:

  • eth_batchGetBlockByNumber

  • eth_batchGetTransactionByHash

  • eth_batchGetTransactionReceipt

  • eth_batchGetBlockReceipts


Notes

  • WebSocket: eth_subscribe and eth_unsubscribe require a WebSocket connection. Supported subscription types: newHeads, logs.

  • Block Tags: Supported values: latest, earliest, pending, safe, finalized, or a specific block number in hexadecimal.

  • EIP Support: EIP-1559 (fee market), EIP-2930 (access lists), EIP-1186 (eth_getProof) are fully supported.

  • Rate Limiting: eth_getLogs range is limited to 100 blocks (with rate limiting) or 10,000 blocks (fallback). trace_filter is limited to 500 blocks.

Last updated

Was this helpful?