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

eth_coinbase - Ethereum Classic

Example code for the eth_coinbase JSON-RPC method. Complete guide to using eth_coinbase JSON-RPC in GetBlock Web3 documentation.

This method returns the client's coinbase address — the account that receives mining rewards. It requires the node to have a coinbase configured.

Parameters

This method does not require any parameters. Send the request with an empty params array.

Request

curl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "eth_coinbase",
    "params": [],
    "id": "getblock.io"
}'
example.js
const axios = require('axios');

const response = await axios.post('https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/', {
    jsonrpc: '2.0',
    method: 'eth_coinbase',
    params: [],
    id: 'getblock.io'
}, {
    headers: { 'Content-Type': 'application/json' }
});

console.log(response.data.result);
example.py
import requests

response = requests.post(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    headers={'Content-Type': 'application/json'},
    json={
        'jsonrpc': '2.0',
        'method': 'eth_coinbase',
        'params': [],
        'id': 'getblock.io'
    }
)

print(response.json())

Response

{
    "jsonrpc": "2.0",
    "id": "getblock.io",
    "result": "0x82A618305706B14e7bcf2592D4B9324A366b6dAd"
}

Response Parameters

Parameter
Type
Description

jsonrpc

string

JSON-RPC version ("2.0")

id

string

Request identifier

result

string

20-byte coinbase address

Use Cases

  • Reward Routing: Read where block rewards are paid

  • Node Config: Confirm the configured coinbase

  • Diagnostics: Audit miner setup

Error Handling

Error Code
Message
Description

-32000 / etherbase must be explicitly specified

No coinbase

The node has no coinbase configured

403 / RBAC: access denied

Access denied

The GetBlock access token is missing or incorrect

Last updated

Was this helpful?