Build on Tenhertz
Everything here reads the Practice Field, the HertzMiner contract running on Elysium (chain id 99901). The $HZ miner will use the same contract and the same calls at a new address.
Quickstart
eth_call. No key, nothing sent.submit from your own code.curl -s https://10hz.xyz/api/roundmkdir tenhertz && cd tenhertz
curl -sO https://10hz.xyz/miner/core.js -sO https://10hz.xyz/miner/tenhertz-miner.mjs
echo '{"type":"module"}' > package.json && npm i viem
node tenhertz-miner.mjs --dry-run --onceContracts and ABIs
| Contract | Address on Elysium | ABI |
|---|---|---|
| HertzMiner (Practice Field) | 0x1CC87a4D72500EF0E30957e75f7fd5837B361a01 | HertzMiner.json |
| PracticeHZ (points) | 0x09A4322b9857FC53a6035D35C009d752E4F575D9 | PracticeHZ.json |
| Interface | Solidity, the calls a miner, relayer or reader needs | IHertzMiner.sol |
| HertzMiner ($HZ) | Next. Deployed after the token, same ABI | HertzMiner.json |
Both contracts are verified on the Elysium explorer. RPC https://rpc.elysium.kinetiq.xyz, gas in HYPE. The contracts are unaudited.
The hash
A solution for round r is a nonce such that:
uint256(keccak256(abi.encode(seed, miner, r, nonce))) < target| Input | Type | Bytes | Where it comes from |
|---|---|---|---|
| seed | bytes32 | 0 to 31 | challengeFor(r), fixed for an epoch of 600 rounds |
| miner | address | 32 to 63 | the address credited, left-padded to 32 bytes |
| r | uint256 | 64 to 95 | the round: an Elysium block number |
| nonce | uint256 | 96 to 127 | anything you choose |
The 128 bytes are hashed with keccak256 (Ethereum's, not SHA3-256) and compared as a big-endian integer. target also comes from challengeFor(r). It moves every 600 rounds toward two solutions a round, by at most ×4 or ÷4.
The round number is ArbSys(100).arbBlockNumber(), the same number eth_blockNumberreturns on the Elysium RPC. Round r accepts a submission while r <= block <= r + 32. The lowest hash wins. challengeFor answers for future rounds too, including the next epoch, so a miner can work ahead and submit when the round opens.
Command-line miner
Two files, plain JavaScript, worker threads. It mines a round about 120 blocks ahead, waits for it to open, checks the best hash so far and submits inside the window.
mkdir tenhertz && cd tenhertz
curl -sO https://10hz.xyz/miner/core.js -sO https://10hz.xyz/miner/tenhertz-miner.mjs
echo '{"type":"module"}' > package.json && npm i viem
node tenhertz-miner.mjs --dry-run --onceMINER_PRIVATE_KEY=0x... node tenhertz-miner.mjs --threads 8
# --miner 0x... credit another address (the work is bound to it)
# --once stop after the first submission
# --dry-run check each solution with eth_call and send nothingSource: tenhertz-miner.mjs and core.js, the same keccak core the browser miner runs.
Solidity
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import {IHertzMiner} from "./IHertzMiner.sol"; // https://10hz.xyz/abi/IHertzMiner.sol
contract RoundReader {
IHertzMiner constant MINER = IHertzMiner(0x1CC87a4D72500EF0E30957e75f7fd5837B361a01);
/// The open round, its challenge, and whether a nonce solves it for `miner`.
function check(address miner, uint256 nonce) external view returns (uint256 round, bool solves) {
round = MINER.currentRound();
(bytes32 seed, uint256 target) = MINER.challengeFor(round);
solves = uint256(keccak256(abi.encode(seed, miner, round, nonce))) < target;
}
}viem
import { createPublicClient, http, defineChain, encodeAbiParameters, keccak256 } from "viem";
const elysium = defineChain({
id: 99901,
name: "Elysium",
nativeCurrency: { name: "HYPE", symbol: "HYPE", decimals: 18 },
rpcUrls: { default: { http: ["https://rpc.elysium.kinetiq.xyz"] } },
});
const MINER = "0x1CC87a4D72500EF0E30957e75f7fd5837B361a01"; // HertzMiner, Practice Field
const abi = await (await fetch("https://10hz.xyz/abi/HertzMiner.json")).json();
const client = createPublicClient({ chain: elysium, transport: http() });
// 1. read the open round, its challenge and the best hash of the round before
const round = await client.readContract({ address: MINER, abi, functionName: "currentRound" });
const [seed, target] = await client.readContract({ address: MINER, abi, functionName: "challengeFor", args: [round] });
const [winner, best] = await client.readContract({ address: MINER, abi, functionName: "bestOf", args: [round - 1n] });
console.log({ round, seed, target, previous: { winner, best } });
// 2. the rule the contract checks: keccak256(abi.encode(seed, miner, round, nonce)) < target
const hashOf = (seed, miner, round, nonce) =>
BigInt(keccak256(encodeAbiParameters(
[{ type: "bytes32" }, { type: "address" }, { type: "uint256" }, { type: "uint256" }],
[seed, miner, round, nonce],
)));
// 3. a nonce from your miner: check it with eth_call, then send the same call from any funded key
async function check(miner, round, nonce) {
const [s, t] = await client.readContract({ address: MINER, abi, functionName: "challengeFor", args: [round] });
if (hashOf(s, miner, round, nonce) >= t) return "above target";
const { result } = await client.simulateContract({
account: miner, address: MINER, abi, functionName: "submit", args: [miner, round, nonce],
});
return "accepted, hash 0x" + result.toString(16).padStart(64, "0");
// walletClient.writeContract({ address: MINER, abi, functionName: "submit", args: [miner, round, nonce] })
}Read API
Plain JSON, no key, CORS open to every origin. Each response is cached at the edge for the time shown, then read again from the contract.
| Endpoint | Returns | Cache |
|---|---|---|
| GET /api/head | the Elysium block number, which is the open round | 1 s |
| GET /api/round | round, seed, target, reward, window, previous round's best | 1 s |
| GET /api/epoch | epoch, target, settled rounds, solutions-a-round estimate, points mined | 5 s |
| GET /api/board | rounds won per miner, and the last 50 winning hashes | 20 s |
| GET /api/miner/{address} | settled rounds won and points credited | 5 s |
A read that finds the RPC busy answers {"status":"busy","retryAfter":1} with status 200. Retry after a second.
MCP server
A Model Context Protocol server over Streamable HTTP at https://10hz.xyz/api/mcp. Tools: current_challenge, best_of, submit_calldata, miner_stats. It never signs: an agent sends the calldata from its own funded account.
{
"mcpServers": {
"tenhertz": { "type": "http", "url": "https://10hz.xyz/api/mcp" }
}
}claude mcp add --transport http tenhertz https://10hz.xyz/api/mcpcurl -s -X POST https://10hz.xyz/api/mcp \
-H 'content-type: application/json' \
-d '{"jsonrpc":"2.0","id":1,"method":"tools/call","params":{"name":"current_challenge","arguments":{}}}'llms.txt
/llms.txt sums up the protocol, the addresses and every endpoint in one plain-text file for AI agents. The chapters behind it start at the docs overview.