Docs
Supported ChainsXDC NetworkJSON-RPC APIMining Methods

eth_coinbase - XDC Network RPC Method

Check the legacy eth_coinbase compatibility method on XDC Network. Public endpoints may return an address, `unimplemented`, or another unsupported-method response depending on the client.

Checks the legacy eth_coinbase compatibility method on XDC Network. Public endpoints may return an address, unimplemented, or another unsupported-method response depending on the client behind the endpoint.

Why XDC Network? Build on the enterprise-grade blockchain for trade finance with 2-second finality and ISO 20022 compliance with ISO 20022 messaging, ITFA membership, Contour Network acquisition, 801M+ transactions, and partnerships with Circle and Deutsche Telekom.

Note: Treat eth_coinbase as a legacy compatibility probe. On shared infrastructure, this method may return unimplemented or another unsupported-method error, so it is not a dependable production signal.

When to Use This Method

eth_coinbase is relevant for trade finance developers, enterprise blockchain teams, and RWA tokenization builders when you need to:

  • Check client compatibility — Confirm whether the connected client still exposes eth_coinbase
  • Audit migration assumptions — Remove Ethereum-era assumptions that every endpoint reports an etherbase address
  • Harden integrations — Fall back to supported identity or chain-status methods when eth_coinbase is unavailable

Request Parameters

Request

This method accepts no parameters.

Response Body

Response
resultDATA (20 bytes)

The reported compatibility address when the client exposes eth_coinbase

Code Examples

Bash
curl -X POST https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY \
  -H "Content-Type: application/json" \
  -d '{
    "jsonrpc": "2.0",
    "method": "eth_coinbase",
    "params": [],
    "id": 1
  }'
JavaScript
// Using fetch
const response = await fetch('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY', {
  method: 'POST',
  headers: { 'Content-Type': 'application/json' },
  body: JSON.stringify({
    jsonrpc: '2.0',
    method: 'eth_coinbase',
    params: [],
    id: 1
  })
});

const { result, error } = await response.json();

if (error) {
  console.log('No coinbase configured:', error.message);
} else {
  console.log('XDC Network coinbase:', result);
}

// Using ethers.js
import { JsonRpcProvider } from 'ethers';

const provider = new JsonRpcProvider('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY');
try {
  const coinbase = await provider.send('eth_coinbase', []);
  console.log('XDC Network coinbase:', coinbase);
} catch (err) {
  console.log('Coinbase not configured on this node');
}
Python
import requests

def get_coinbase():
    response = requests.post(
        'https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY',
        json={
            'jsonrpc': '2.0',
            'method': 'eth_coinbase',
            'params': [],
            'id': 1
        }
    )
    data = response.json()
    if 'error' in data:
        return None
    return data['result']

coinbase = get_coinbase()
if coinbase:
    print(f'XDC Network coinbase: {coinbase}')
else:
    print('No coinbase configured on this node')

# Using web3.py
from web3 import Web3

w3 = Web3(Web3.HTTPProvider('https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY'))
try:
    print(f'XDC Network coinbase: {w3.eth.coinbase}')
except Exception:
    print('Coinbase not available')
Go
package main

import (
    "context"
    "fmt"
    "log"

    "github.com/ethereum/go-ethereum/common"
    "github.com/ethereum/go-ethereum/rpc"
)

func main() {
    client, err := rpc.Dial("https://api-xdc-mainnet.n.dwellir.com/YOUR_API_KEY")
    if err != nil {
        log.Fatal(err)
    }

    var coinbase common.Address
    err = client.CallContext(context.Background(), &coinbase, "eth_coinbase")
    if err != nil {
        fmt.Println("Coinbase not configured:", err)
        return
    }

    fmt.Printf("XDC Network coinbase: %s\n", coinbase.Hex())
}

Common Use Cases

1. Validator Configuration Verification

Verify that a node's coinbase matches the expected reward address:

JavaScript
async function verifyCoinbase(provider, expectedAddress) {
  try {
    const coinbase = await provider.send('eth_coinbase', []);

    if (coinbase.toLowerCase() === expectedAddress.toLowerCase()) {
      console.log('Coinbase address verified');
      return true;
    } else {
      console.warn(`Coinbase mismatch: expected ${expectedAddress}, got ${coinbase}`);
      return false;
    }
  } catch {
    console.error('Could not retrieve coinbase — may not be configured');
    return false;
  }
}

2. Block Producer Identification

Identify the coinbase address alongside block production details:

JavaScript
async function getProducerInfo(provider) {
  const [coinbase, mining, hashrate] = await Promise.allSettled([
    provider.send('eth_coinbase', []),
    provider.send('eth_mining', []),
    provider.send('eth_hashrate', [])
  ]);

  return {
    coinbase: coinbase.status === 'fulfilled' ? coinbase.value : 'not configured',
    isMining: mining.status === 'fulfilled' ? mining.value : false,
    hashrate: hashrate.status === 'fulfilled' ? parseInt(hashrate.value, 16) : 0
  };
}

3. Multi-Node Coinbase Audit

Audit coinbase addresses across a fleet of XDC Network nodes:

JavaScript
async function auditCoinbases(endpoints) {
  const results = await Promise.all(
    endpoints.map(async (endpoint) => {
      const provider = new JsonRpcProvider(endpoint);
      try {
        const coinbase = await provider.send('eth_coinbase', []);
        return { endpoint, coinbase, configured: true };
      } catch {
        return { endpoint, coinbase: null, configured: false };
      }
    })
  );

  const unique = new Set(results.filter(r => r.configured).map(r => r.coinbase));
  console.log(`Found ${unique.size} unique coinbase address(es) across ${endpoints.length} nodes`);

  return results;
}

Error Handling

Common errors and solutions:

Error CodeDescriptionSolution
-32000Etherbase must be explicitly specifiedNode has no coinbase configured — set via client CLI flag
-32601Method not foundNode client may not support this method
-32603Internal errorNode may be initializing — retry after delay
-32005Rate limit exceededReduce request frequency