Mining enforcement and Stratum replacement for POW communitycoins
Find a file
2026-06-21 10:23:31 +00:00
src Single file procedure; 2026-06-20 18:41:29 +00:00
LICENSE Initial commit 2026-05-31 10:15:20 +00:00
README.md README.md bijwerken 2026-06-21 10:23:31 +00:00

Canonical source: https://git.communitycoins.org/Communitycoins.Rooty/CC-MINE
Mirrors (GitLab/GitHub) may be read-only and may lag behind.

CC-MINE

CC-MINE is a lightweight mining gateway for CommunityCoins and other small UTXO-based blockchains. It is built from scratch in PHP and speaks enough of the Stratum mining protocol to work with common miners, mining proxies and rental-hash services, while keeping the actual block-validation authority inside the coin daemon.

The project is designed for small chains that need access to modern hash power without giving that hash power uncontrolled influence over the chain. It is not a traditional multi-user payout pool. It is closer to a solo-mining Stratum bridge with operational safety controls.

Motivation

Many smaller Proof-of-Work blockchains have compatible mining algorithms but fragile network conditions. A single rented rig can be useful for restoring chain movement or lowering difficulty, but it can also overwhelm the daemon or produce blocks too aggressively for the surrounding network.

CC-MINE was created to explore a more conservative model: let miners use the familiar Stratum protocol, but let the coin daemon remain the source of truth and add explicit controls between miner shares and submitblock().

A longer motivation article is published on Medium

What CC-MINE is

CC-MINE is:

  • a PHP-based Stratum-compatible mining server;
  • a solo-mining bridge to a coin Core daemon;
  • a block-construction and submitblock() gateway;
  • a practical tool for CommunityCoins-style UTXO chains;
  • intentionally simple enough to audit, fork and adapt per coin.

CC-MINE is not:

  • a full public mining pool with account balances and payout accounting;
  • a share-payment engine;
  • a replacement for the coin daemons consensus checks;
  • a local Proof-of-Work hash validator.

The daemon validates blocks. CC-MINE builds candidate blocks, serves Stratum work, receives mining.submit, reconstructs the block and submits it to Core.

Stratum compatibility

CC-MINE implements the parts of Stratum that are needed for practical mining:

  • mining.subscribe
  • mining.authorize
  • mining.submit
  • mining.suggest_difficulty
  • mining.configure with unsupported extensions returned as false
  • mining.extranonce.subscribe returned as false
  • mining.set_difficulty
  • mining.notify

Miner-preferred difficulty can also be supplied through the authorize password using common rental/proxy conventions such as:

x;d=4482
d=4482
x;diff=4482

Where CC-MINE differs from a standard pool

Solo-mining orientation

CC-MINE does not maintain user balances or distribute rewards. Blocks are built for a configured reward address or script. If the daemon accepts a block, the reward belongs to the configured destination in conf.php.

Core remains the validation authority

CC-MINE does not perform algorithm-specific local hashing to decide whether a block is valid. The server reconstructs the block and calls the daemons submitblock() RPC. Core decides whether the block is accepted, stale, duplicate or invalid.

Big-miner throttling

Large rented miners can submit block candidates far faster than a small chain should accept. CC-MINE therefore supports Core-submit throttling:

  • minimum time between submitblock() attempts;
  • cooldown after an accepted block;
  • per-worker cooldown tracking;
  • miner-facing success responses for throttled high-hash submits, so proxies do not immediately mark the pool as broken.

This lets a large miner keep working while CC-MINE limits how aggressively blocks are pushed into the daemon and the wider network.

Periodic notify keepalive

Some miners and rental proxies close a connection if the server is silent for too long, even when the current job is still valid. CC-MINE supports optional periodic mining.notify messages with clean_jobs=false to keep the Stratum dialogue alive without forcing a chain reset.

This has proven important for some MRR/GodMiner-style X11 rentals.

Optional VARDIFF

CC-MINE supports VARDIFF, but it is optional. For rental-hash testing it can be cleaner to use a fixed difficulty supplied by the renter, for example d=4482, and disable VARDIFF.

VARDIFF is useful when miners do not provide a suitable difficulty or when CC-MINE should adapt share frequency automatically.

Coin-specific configuration

Coin-specific settings belong in conf.php, not in the generic CC-MINE source file. The usual pattern is:

<?php
$config['meta']['coin'] = 'boli';

$config['coins']['boli'] = [
    'name' => 'bolivarcoin',
    'symbol' => 'BOLI',

    'rpcHost' => '127.0.0.1',
    'rpcPort' => 3891,
    'rpcUser' => 'ccuser',
    'rpcPassword' => 'ccpass',

    'stratumPort' => 3894,

    'poolRewardAddress' => 'yourRewardAddressHere',
    'rewardScriptPubKey' => '',
    'coinbaseTag' => 'https://communitycoins.org/CC-MINE|',

    'addressVersions' => [
        'p2pkh' => [85],
        'p2sh' => [],
    ],

    'algo' => 'x11',
    'targetBlockSeconds' => 3 * 60,

    'periodicNotify' => [
        'enabled' => true,
        'seconds' => 30,
        'cleanJobs' => false,
    ],

    'vardiff' => [
        'enabled' => true,
    ],

    'coreSubmitThrottle' => [
        'enabled' => true,
        'minSecondsBetweenCoreSubmits' => 10,
        'acceptedBlockCooldownSeconds' => 2 * 60, 
    ],
];

Important coin-specific settings include:

  • daemon RPC host, port, user and password;
  • Stratum listen port;
  • reward address or raw reward script;
  • address-version bytes for local Base58 decoding;
  • coinbase tag;
  • target block spacing;
  • VARDIFF policy;
  • periodic notify policy;
  • Core submit throttling policy.

Running

Start the coin daemon first and make sure RPC is reachable. Then start CC-MINE directly:

php src/CC_MINE.php

The server performs startup checks, verifies daemon synchronization, obtains an initial block template and then starts accepting Stratum connections.

Logs and monitoring

CC-MINE writes operational logs under logs/. The most useful files are:

  • stratum.log — connection lifecycle and general server events;
  • stratumDebug.log — detailed Stratum/debug output when enabled;
  • mining_stats.log — interval summaries for submits, accepted blocks and estimated hashrate;
  • mining_events.log — non-summary mining events;
  • achievements.log — accepted blocks and important block-finding events.

For normal monitoring, the important signals are:

  • SUMMARY interval lines;
  • SUBMIT ok;
  • SUBMITBLOCK classification=accepted;
  • SUBMITBLOCK_THROTTLED;
  • PERIODIC_NOTIFY;
  • disconnect reasons such as read_eof;
  • accepted-block entries in achievements.log.

Operational notes

  • Keep the coin daemon RPC interface private.
  • Do not expose RPC credentials in the repository.
  • Treat high-rental-hash experiments carefully on small chains.
  • Use Core submit throttling when a miner is much larger than the normal network.
  • Use periodic notify when a miner or proxy disconnects after a fixed period of server silence.
  • Use fixed password difficulty for rental tests when VARDIFF causes confusing feedback in the rental dashboard.

Project status

CC-MINE is experimental but functional. It has been used to connect Stratum miners, reconstruct submitted work, submit blocks to Core and throttle large miners on a small-chain setup.

The code is intentionally kept compact and explicit. The priority is auditability and operational control, not feature completeness as a public mining pool.