queryLedgerState_nonces - Cardano

This method returns the epoch nonce values used by the consensus protocol, which seed leader election.

Parameters

This method does not require parameters.

Request

bashcurl --location --request POST 'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/' \
--header 'Content-Type: application/json' \
--data-raw '{
    "jsonrpc": "2.0",
    "method": "queryLedgerState/nonces",
    "id": "getblock.io"
}'

example.js

javascriptconst response = await fetch(
    'https://shared.eu-central-1.getblock.io/<ACCESS-TOKEN>/',
    {
        method: 'POST',
        headers: { 'Content-Type': 'application/json' },
        body: JSON.stringify({"jsonrpc": "2.0", "method": "queryLedgerState/nonces", "id": "getblock.io"})
    }
);
console.log(await response.json());

example.py

pythonimport requests

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

print(response.json())

Response

json{
    "jsonrpc": "2.0",
    "method": "queryLedgerState/nonces",
    "result": {
        "epochNonce": "bb5d68f96f32e55a140e9de9520ee98ba6a630b87580a6c5917e51eee436da55",
        "candidateNonce": "57a71679914e97740054b821f438f955ebb9a1bd4f530cbd83e35072deb17179",
        "evolvingNonce": "57a71679914e97740054b821f438f955ebb9a1bd4f530cbd83e35072deb17179",
        "lastEpochLastAncestor": "d4d0f950488bfbec0e859c27de458ee54160d58e21c3627339854500903d38a4"
    },
    "id": "getblock.io"
}

Response Parameters

FieldTypeDescription
epochintegerEpoch the nonces apply to
candidateNoncestringThe candidate nonce for the next epoch
evolvingNoncestringThe nonce evolving over the current epoch

Use Cases

  • Consensus Research: Study leader-election seeding
  • Verification: Independently verify slot leader schedules
  • Analytics: Track nonce evolution across epochs
  • Auditing: Confirm nonce values against block headers

Error Handling

Error CodeMessageDescription
-32602Invalid paramsA required field is missing or has the wrong type
-32000Query unavailableThe query is not available in the current ledger era
-32603Internal errorThe node failed to answer the query