Skip to main content

Purpose and Scope

This document describes the JSON-RPC API architecture of StableNet, including available API namespaces, service implementations, and the backend abstraction layer that connects API services to core blockchain components.
The API system provides external access to node functionality via HTTP, WebSocket, and IPC transports.
For information on event filtering and subscriptions, refer to Event Filtering and Subscriptions.

API Architecture Overview

The StableNet RPC API follows a layered architecture in which API service implementations depend on a Backend interface.
This design enables access to core blockchain functionality without tight coupling to the Ethereum backend.

API Namespace Structure

StableNet organizes its APIs into multiple namespaces, each with a clearly defined responsibility and purpose.
Namespaces are registered via internal/ethapi.GetAPIs, eth.Ethereum.APIs(), node-level apis(), and the consensus engine (WBFT) APIs(), and are exposed externally through the RPC handler.

API Namespace Mapping

NamespaceService ImplementationPurpose
ethEthereumAPI, BlockChainAPI, TransactionAPI, EthereumAccountAPI, DownloaderAPICore protocol, blocks, transactions, synchronization
txpoolTxPoolAPITransaction pool inspection
personalPersonalAccountAPIPassword-based account management and fee-delegated signing
debugDebugAPI (ethapi·eth·node)Debugging and diagnostics
adminAdminAPI (node·eth)Node and peer management
minerMinerAPIBlock production control
netNetAPINetwork information
web3web3APIWeb3 utilities
istanbulWBFT APIWBFT consensus validators, signers, and status

eth Namespace

The eth namespace provides core Ethereum protocol functionality and is composed of multiple API service classes.

EthereumAPI Service

EthereumAPI handles network state and fee-related queries.
MethodDescription
GasPrice()Returns gas price for legacy transactions
MaxPriorityFeePerGas()Returns priority fee for EIP-1559 transactions
FeeHistory()Returns historical fee data
Syncing()Returns node synchronization status
In StableNet with Anzeon enabled, MaxPriorityFeePerGas does not use a gas price oracle and instead returns the gas tip value enforced by the GovValidator contract.

BlockChainAPI Service

BlockChainAPI provides interfaces for querying blockchain state and data.
MethodDescriptionRPC Method
ChainId()Returns chain IDeth_chainId
BlockNumber()Returns current block numbereth_blockNumber
GetBalance()Queries account balanceeth_getBalance
GetCode()Queries contract codeeth_getCode
GetStorageAt()Queries a storage sloteth_getStorageAt
GetProof()Returns Merkle proofeth_getProof
GetBlockByNumber()Fetch block by numbereth_getBlockByNumber
GetBlockByHash()Fetch block by hasheth_getBlockByHash
GetTransactionByHash()Fetch transactioneth_getTransactionByHash
GetTransactionReceipt()Fetch transaction receipteth_getTransactionReceipt

TransactionAPI Service

TransactionAPI is responsible for transaction creation, signing, and submission.
MethodDescriptionRPC Method
SendTransaction()Signs and submits a transactioneth_sendTransaction
SendRawTransaction()Submits a signed transactioneth_sendRawTransaction
SignTransaction()Signs a transaction onlyeth_signTransaction
FillTransaction()Fills default transaction fieldseth_fillTransaction
EstimateGas()Estimates gas usageeth_estimateGas
Call()Executes a call without state changeseth_call

txpool Namespace

TxPoolAPI provides read-only access to transaction pool state.
MethodDescriptionRPC Method
Content()Lists all transactions in the pooltxpool_content
ContentFrom()Lists transactions for a specific addresstxpool_contentFrom
Status()Returns pending/queued countstxpool_status
Inspect()Human-readable summarytxpool_inspect
Transactions are classified into two states:
  • pending: Eligible for inclusion in the next block
  • queued: Waiting due to nonce gaps or insufficient balance

personal Namespace

PersonalAccountAPI provides password-based account management.
For security reasons, it is typically disabled on external RPC endpoints.
MethodDescriptionRPC Method
NewAccount()Create a new accountpersonal_newAccount
ListAccounts()List accountspersonal_listAccounts
UnlockAccount()Unlock an accountpersonal_unlockAccount
LockAccount()Lock an accountpersonal_lockAccount
SendTransaction()Password-based transaction sendingpersonal_sendTransaction
SignTransaction()Password-based signingpersonal_signTransaction
Sign()Sign arbitrary datapersonal_sign
ImportRawKey()Import a private keypersonal_importRawKey

debug Namespace

DebugAPI provides advanced functionality for development and operational diagnostics.

Major Feature Categories

Transaction and Block Tracing
  • TraceTransaction()
  • TraceBlock()
  • TraceBlockByNumber()
  • TraceBlockByHash()
  • TraceCall()
State Inspection
  • DumpBlock()
  • AccountRange()
  • StorageRangeAt()
Database Management
  • DbGet()
  • DbAncient()
  • ChaindbProperty()
  • ChaindbCompact()
Profiling
  • CpuProfile()
  • BlockProfile()
  • MemStats()
  • GcStats()

web3 Namespace

web3API provides basic Web3 utility functions.
MethodDescriptionRPC Method
ClientVersion()Returns client versionweb3_clientVersion
Sha3()Computes Keccak-256 hashweb3_sha3

istanbul Namespace

Exposed only when WBFT consensus is enabled.
MethodDescriptionRPC Method
NodeAddress()Returns signer node addressistanbul_nodeAddress
GetCommitSignersFromBlock()Returns proposer and commit signersistanbul_getCommitSignersFromBlock
GetCommitSignersFromBlockByHash()Query by block hashistanbul_getCommitSignersFromBlockByHash
GetValidators()Returns validator lististanbul_getValidators
GetValidatorsAtHash()Validators at a given hashistanbul_getValidatorsAtHash
Status()Round and sealer statisticsistanbul_status

StableNet Fee Delegation Extensions

For fee-delegated transactions, StableNet provides the following extended APIs in the personal and eth namespaces.
RPC MethodDescription
personal_signRawFeeDelegateTransactionAuthenticates the fee payer using a password and appends a fee-payer signature to an already signed transaction, returning RLP-encoded bytes.
eth_signRawFeeDelegateTransactionPerforms the same fee-delegation signing using an already unlocked fee-payer account.
The resulting signed transaction is submitted via eth_sendRawTransaction, and gas costs are paid by the fee payer.

API Test Infrastructure

The codebase includes the following test infrastructure:
  • Unit tests based on a mock backend
  • Genesis- and key-based integration tests
  • RPC serialization and response validation tests