A stratum mining proxy for Kylacoin with optional Lyncoin merged mining (AuxPoW).
- ✅ Merged Mining (AuxPoW): Mine both KylaCoin and LynCoin simultaneously
- ✅ ZMQ Support: Instant new block notifications for both chains
- ✅ Parallel Block Submission: Submit to both chains simultaneously for optimal speed
- ✅ Notifications: Discord and Telegram alerts for blocks found and miner connections
- ✅ Web Dashboard (optional): Real-time monitoring of miners, hashrates, and blocks
- ✅ SQLite Database (optional): Historical statistics and block history
- ✅ Docker Ready: Complete docker compose setup with health checks
- ✅ Flexible Difficulty: Configurable share difficulty for any hashrate
Choose your setup method:
Prerequisites: Docker and Docker Compose installed
-
Place Linux binaries:
# Copy Linux x86_64 binaries (NOT Windows/macOS) binaries/kylacoin/kylacoind binaries/kylacoin/kylacoin-cli binaries/lyncoin/lyncoind binaries/lyncoin/lyncoin-cli -
Configure environment:
cp .env.example .env # Edit .env - set passwords and optionally LCN_WALLET_ADDRESS for merged mining -
Start services:
docker compose up -d docker compose logs -f stratum-proxy # Watch logs -
Connect miner:
- Server:
localhost:54321 - Username: Your Kylacoin address
- Password: anything
- Server:
Prerequisites: Python 3.8+, running kylacoind and lyncoind nodes
-
Configure blockchain nodes:
- Copy
config/kylacoin.confto your Kylacoin data directory - Copy
config/lyncoin.confto your Lyncoin data directory (optional, for merged mining) - Edit both files with secure passwords
- Start both daemons
- Copy
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure proxy:
cp .env.example .env # Edit .env to match your node RPC settings -
Run proxy:
python -m kcn_proxy.run
-
Connect miner: Same as Docker method above
| Variable | Description | Default |
|---|---|---|
KCN_RPC_PORT |
Kylacoin RPC port | 5110 |
KCN_RPC_USER / KCN_RPC_PASS |
Kylacoin RPC credentials | - |
LCN_RPC_PORT |
Lyncoin RPC port | 5053 |
LCN_RPC_USER / LCN_RPC_PASS |
Lyncoin RPC credentials | - |
LCN_WALLET_ADDRESS |
Lyncoin address for merged mining | (blank = KCN only) |
STRATUM_PORT |
Port for miners to connect | 54321 |
SHARE_DIFFICULTY_DIVISOR |
Share difficulty (higher = easier) | 1000.0 |
USE_EASIER_TARGET |
Use LCN target if easier | true |
ENABLE_ZMQ |
Enable ZMQ block notifications | true |
DISCORD_WEBHOOK_URL |
Discord webhook for notifications | (blank = disabled) |
TELEGRAM_BOT_TOKEN |
Telegram bot token | (blank = disabled) |
TELEGRAM_CHAT_ID |
Telegram chat ID | (blank = disabled) |
ENABLE_DASHBOARD |
Enable web dashboard | false |
DASHBOARD_PORT |
Web dashboard port | 8080 |
ENABLE_DATABASE |
Enable statistics database | false |
See NOTIFICATIONS.md for notification setup and DASHBOARD.md for dashboard configuration.
SHARE_DIFFICULTY_DIVISOR controls how often miners submit shares:
- Higher (e.g., 2000): Easier shares, more frequent, better for home mining
- Lower (e.g., 500): Harder shares, less traffic, better for pools
- Default (1000): Good balance
When LCN_WALLET_ADDRESS is set, the proxy enables merged mining. Here's how it works:
Both Kylacoin (KCN) and Lyncoin (LCN) use the same Flex PoW hash for difficulty validation:
Block Header (80 bytes)
↓
Flex PoW hash → Compare with both KCN and LCN targets
↓
├─→ Meets KCN target? → Submit to KCN → Earn KCN
└─→ Meets LCN target? → Submit AuxPoW to LCN → Earn LCN
Example at typical difficulties (KCN: 0.008, LCN: 0.007):
Flex PoW: 0x00000065...
Compare: 0x00000065... < 0x0000007e... (KCN target) → ✗ No
Compare: 0x00000065... < 0x00000080... (LCN target) → ✓ Yes!
Result: Submit to LCN only, earn LCN rewards
When submitting to LCN, the proxy creates an AuxPoW proof containing:
- Parent (KCN) coinbase transaction
- Parent block hash (SHA3d) - for block identification
- Merkle proofs
- Parent block header (80 bytes)
Important: While SHA3d is used for the block hash in the AuxPoW structure (what appears on block explorers), both chains validate difficulty using the Flex PoW hash.
At typical difficulties (KCN: ~0.008, LCN: ~0.007):
- LCN only: Flex PoW meets LCN target → Submit AuxPoW → Earn LCN (most common, easier target)
- KCN only: Flex PoW meets KCN target → Submit block → Earn KCN (less common, harder target)
- Both chains: Flex PoW meets BOTH targets → Submit to both → Double rewards! (rare)
Why LCN blocks are more common:
- LCN typically has an easier target (~0.007 vs ~0.008)
- Both chains check the same Flex PoW hash
- The easier target means more shares qualify for LCN
- Result: You'll find more LCN blocks than KCN blocks
Note: The proxy automatically uses whichever target is easier when USE_EASIER_TARGET=true.
Block submissions are logged to ./submit_history/:
KCN_<height>_<job>_<time>.txt- Kylacoin blocksLCN_<height>_<job>_<time>.txt- Lyncoin AuxPoW blocks
Check logs:
# Docker
docker compose logs -f stratum-proxy
# Native
# Watch console output"Coinbase parts not ready": Nodes still syncing, wait for full sync
"LCN aux job is stale": Normal when LCN finds blocks, proxy auto-refreshes
Miner can't connect: Check firewall, verify STRATUM_PORT is correct
Binary format error: Must use Linux ELF x86_64 binaries for Docker
Low hashrate: Increase SHARE_DIFFICULTY_DIVISOR for more frequent feedback
The proxy uses ZMQ for instant block notifications instead of polling:
- KCN: Port 28332
- LCN: Port 28433
Both conf files include ZMQ settings. Disable with ENABLE_ZMQ=false if needed.
Job IDs are Unix timestamps (e.g., 66fb8a10), updated:
- On new blocks (via ZMQ)
- Every 30 seconds (nTime rolls)
- When LCN creates new template
kcn_proxy/
├── consensus/ # Block/transaction building
├── rpc/ # RPC client implementations
├── state/ # Template state management
├── stratum/ # Stratum protocol server
├── utils/ # Hashing and encoding
└── zmq/ # ZMQ block listeners
MIT License - See LICENSE file
| Variable | Description | Default |
|---|---|---|
KCN_RPC_USER |
Kylacoin RPC username | kylacoin_user |
KCN_RPC_PASS |
Kylacoin RPC password | - |
KCN_RPC_PORT |
Kylacoin RPC port | 5110 |
KCN_P2P_PORT |
Kylacoin P2P port | 5111 |
LCN_RPC_USER |
Lyncoin RPC username | lyncoin_user |
LCN_RPC_PASS |
Lyncoin RPC password | - |
LCN_RPC_PORT |
Lyncoin RPC port | 5053 |
LCN_P2P_PORT |
Lyncoin P2P port | 5054 |
LCN_WALLET_ADDRESS |
Lyncoin wallet address (blank = primary-only mode) | (blank - disables AuxPoW) |
STRATUM_PORT |
Stratum proxy port | 54321 |
PROXY_SIGNATURE |
Custom coinbase signature | /kcn-lcn-stratum-proxy/ |
USE_EASIER_TARGET |
Enable easier target selection | true |
SHARE_DIFFICULTY_DIVISOR |
Share difficulty divisor (higher = easier/more shares) | 1000.0 |
TESTNET |
Use testnet | false |
VERBOSE |
Enable verbose logging | true |
SHOW_JOBS |
Show job updates in logs | true |
This setup uses local binaries instead of pre-built Docker images, giving you complete control over the cryptocurrency node versions.
Place the following files in their respective directories:
Kylacoin (binaries/kylacoin/):
kylacoind- The main daemonkylacoin-cli- CLI client
Lyncoin (binaries/lyncoin/):
lyncoind- The main daemonlyncoin-cli- CLI client
- Platform: Linux x86_64 ELF binaries (NOT Windows .exe or macOS binaries)
- Base System: Ubuntu 24.04 compatible
- glibc Version: 2.36+ support (Ubuntu 24.04 provides glibc 2.39)
- Executable permissions: Set automatically by Docker
- Dependencies: Must be included or statically linked
- Download releases from official repositories
- Build from source for your specific needs
- Extract from existing installations
Check if binaries are correct format:
file binaries/kylacoin/kylacoind
file binaries/lyncoin/lyncoindExpected Output:
binaries/kylacoin/kylacoind: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
binaries/lyncoin/lyncoind: ELF 64-bit LSB executable, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, stripped
❌ Wrong formats (will NOT work):
- Windows:
PE32+ executable (console) x86-64, for MS Windows - macOS:
Mach-O 64-bit executable x86_64
- kylacoin: Kylacoin daemon (parent chain)
- RPC:
localhost:5110 - P2P:
localhost:5111
- RPC:
- lyncoin: Lyncoin daemon (auxiliary chain)
- RPC:
localhost:5053 - P2P:
localhost:5054
- RPC:
- stratum-proxy: Mining proxy
- Stratum:
localhost:54321
- Stratum:
The proxy includes a customizable signature in coinbase transactions to identify your mining setup. This appears in the blockchain and helps identify blocks found by your proxy.
Configuration Options:
-
Environment Variable (recommended for Docker):
# In .env file PROXY_SIGNATURE=/your-pool-name/ -
Command Line Argument:
python kcn-lcn-stratum-proxy.py --proxy-signature="/my-custom-signature/" [other args...]
Guidelines:
- Keep it short (max 32 bytes recommended)
- Use forward slashes or other characters to make it recognizable
- Examples:
/MyPool/,/Solo-Miner-2025/,/KCN-LCN-Proxy/
Default: /kcn-lcn-stratum-proxy/
If you prefer to run the proxy directly with Python instead of using Docker:
- Python 3.8+ installed on your system
- Kylacoin and Lyncoin nodes running separately (either locally or remotely)
- Python dependencies installed
-
Install Python dependencies:
pip install -r requirements.txt
-
Configure your blockchain nodes (optional):
For convenience, you can use the provided configuration templates:
- Kylacoin: Copy
kylacoin.confto your Kylacoin data directory - Lyncoin: Copy
lyncoin.confto your Lyncoin data directory
Data directory locations:
- Windows:
%APPDATA%\Kylacoin\and%APPDATA%\Lyncoin\ - Linux:
~/.kylacoin/and~/.lyncoin/ - macOS:
~/Library/Application Support/Kylacoin/and~/Library/Application Support/Lyncoin/
- Kylacoin: Copy
-
Ensure your nodes are running:
- Kylacoin node accessible via RPC (default:
localhost:5110) - Lyncoin node accessible via RPC (default:
localhost:5053)
- Kylacoin node accessible via RPC (default:
-
Run the proxy:
For localhost testing only:
python -m kcn_proxy.run \ --ip=127.0.0.1 \ --port=54321 \ --rpcuser=your_kcn_rpc_user \ --rpcpass=your_kcn_rpc_password \ --rpcip=127.0.0.1 \ --rpcport=5110 \ --aux-rpcuser=your_lcn_rpc_user \ --aux-rpcpass=your_lcn_rpc_password \ --aux-rpcip=127.0.0.1 \ --aux-rpcport=5053 \ --aux-address=your_lyncoin_address \ --use-easier-target \ --verbose
For HiveOS rigs or remote miners:
python -m kcn_proxy.run \ --ip=0.0.0.0 \ --port=54321 \ --rpcuser=your_kcn_rpc_user \ --rpcpass=your_kcn_rpc_password \ --aux-address=your_lyncoin_address \ --use-easier-target \ --verbose
You can also use environment variables (create a .env file or export them):
# Set environment variables
export KCN_RPC_USER=your_kcn_user
export KCN_RPC_PASS=your_kcn_password
export LCN_RPC_USER=your_lcn_user
export LCN_RPC_PASS=your_lcn_password
export LCN_WALLET_ADDRESS=your_lyncoin_address
export PROXY_SIGNATURE=/my-custom-proxy/
# Run with minimal arguments (reads from environment)
python -m kcn_proxy.run \
--rpcuser=$KCN_RPC_USER \
--rpcpass=$KCN_RPC_PASS \
--aux-rpcuser=$LCN_RPC_USER \
--aux-rpcpass=$LCN_RCP_PASS \
--aux-address=$LCN_WALLET_ADDRESS \
--use-easier-target \
--verboseThe --ip parameter controls which network interface the proxy binds to:
| IP Address | Use Case | Security | Description |
|---|---|---|---|
127.0.0.1 |
Testing/Development | High | Localhost only - miners must run on same machine |
0.0.0.0 |
Production Mining | Medium | All interfaces - HiveOS rigs, remote miners can connect |
192.168.1.100 |
Specific Network | Medium | Bind to specific IP - only that network interface |
Security Considerations:
127.0.0.1: Safest, only local access0.0.0.0: Requires firewall rules to restrict access- Specific IP: Good compromise between accessibility and security
Run python -m kcn_proxy.run --help to see all available options:
--ip: IP address to bind proxy server on (default: 127.0.0.1)--port: Stratum port (default: 54321)--rpcip/--rpcport: Kylacoin RPC connection--aux-rpcip/--aux-rpcport: Lyncoin RPC connection--proxy-signature: Custom coinbase signature--use-easier-target: Enable easier target selection--testnet: Use testnet mode--verbose: Enable debug logging--jobs: Show job updates
For a complete containerized setup:
docker compose up -d# All services
docker compose logs -f
# Specific service
docker compose logs -f stratum-proxy
docker compose logs -f kylacoin
docker compose logs -f lyncoindocker compose down# Edit environment
nano .env
# Restart services
docker compose down && docker compose up -d| Aspect | Native Python | Docker Compose |
|---|---|---|
| Setup Complexity | Medium - requires manual node setup | Easy - everything automated |
| Resource Usage | Lower - no container overhead | Higher - container isolation |
| Development | Easier debugging and development | More isolated but harder to debug |
| Dependencies | Manual Python dependency management | Fully contained environment |
| Node Management | Manual - you manage nodes separately | Automatic - nodes included |
| Platform | Any OS with Python support | Any OS with Docker support |
| Customization | Full control over all components | Limited to configuration files |
| Production | Requires more system administration | Better for deployment and scaling |
Choose Native Python if:
- You're developing or debugging the proxy
- You already have Kylacoin/Lyncoin nodes running
- You want minimal resource usage
- You need fine-grained control
Choose Docker Compose if:
- You want a complete, easy setup
- You're deploying to production
- You prefer isolated environments
- You don't want to manage nodes manually
Connect your miner to the stratum proxy:
- Host: Your server IP
- Port: 54321 (or your configured STRATUM_PORT)
- Username: Your Kylacoin address (e.g.,
KYourKylacoinAddress.worker1) - Password: Any value
The first address that connects becomes the payout address for Kylacoin rewards. If LCN_WALLET_ADDRESS is configured, Lyncoin rewards go to that address. If LCN_WALLET_ADDRESS is blank, only Kylacoin will be mined (primary-only mode).
SRBMiner-MULTI (Recommended for Flex algorithm):
# For localhost testing
SRBMiner-MULTI.exe --algorithm flex --pool localhost:54321 --wallet kc1qcyahs89p6lmjtecdnf7lxv9sv2aa9z9s8yrcs9
# For remote server
SRBMiner-MULTI.exe --algorithm flex --pool 192.168.1.100:54321 --wallet kc1qcyahs89p6lmjtecdnf7lxv9sv2aa9z9s8yrcs9.worker1HiveOS Configuration:
# Miner: SRBMiner-MULTI
# Algorithm: flex
# Pool: stratum+tcp://YOUR_SERVER_IP:54321
# Wallet: kc1qcyahs89p6lmjtecdnf7lxv9sv2aa9z9s8yrcs9.%WORKER_NAME%
# Password: xNote: Replace kc1qcyahs89p6lmjtecdnf7lxv9sv2aa9z9s8yrcs9 with your actual Kylacoin address.
The Docker containers automatically generate configuration files (kylacoin.conf and lyncoin.conf) from your .env file settings. This ensures that CLI tools work properly and all settings are consistent.
Generated configuration includes:
- RPC credentials and port settings
- Network and connection parameters
- Optimized settings for proxy operation
You can interact with the blockchain nodes using RPC commands for monitoring, debugging, and management. Here are examples for both Docker and native setups:
Kylacoin Commands:
# Get mining information
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getmininginfo
# Get blockchain info
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getblockchaininfo
# Get wallet info
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getwalletinfo
# Generate new address
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getnewaddress
# Get network connections
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getconnectioncount
# Alternative: Switch to kylacoin user first
docker compose exec -it kylacoin /bin/bash
su - kylacoin
kylacoin-cli getmininginfoLyncoin Commands:
# Get mining information
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getmininginfo
# Get blockchain info
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getblockchaininfo
# Get wallet info
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getwalletinfo
# Generate new address
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getnewaddress
# Get AuxPoW information
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getauxblock
# Alternative: Switch to lyncoin user first
docker compose exec -it lyncoin /bin/bash
su - lyncoin
lyncoin-cli getmininginfoKylacoin Commands:
# Using configuration file (recommended)
kylacoin-cli getmininginfo
# Using explicit RPC parameters
kylacoin-cli -rpcuser=kylacoin_user -rpcpassword=kylacoin_password -rpcport=5110 getmininginfoLyncoin Commands:
# Using configuration file (recommended)
lyncoin-cli getmininginfo
# Using explicit RPC parameters
lyncoin-cli -rpcuser=lyncoin_user -rpcpassword=lyncoin_password -rpcport=5053 getmininginfoMonitor Mining Status:
# Check if mining is active
getmininginfo
# Get current block height
getblockcount
# Get network hash rate
getnetworkhashps
# Check wallet balance
getbalance
# List recent transactions
listtransactionsDebug Network Issues:
# Check peer connections
getconnectioncount
getpeerinfo
# Check sync status
getblockchaininfo
# Verify daemon is responsive
uptimeAuxPoW Specific (Lyncoin):
# Get auxiliary block for mining
getauxblock
# Submit auxiliary proof of work
getauxblock <hash> <auxpow>If you encounter RPC authentication errors:
- Verify credentials match your
.envfile - For Docker: Use the
-datadirparameter or switch to the correct user - For native: Ensure the configuration file exists in the expected location
- Check the daemon is running: Look for the process in
docker compose psor system processes
Important: Before generating addresses, you must first create and load wallets for both nodes.
-
Create Kylacoin Wallet:
# Create a new wallet named "default" docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" createwallet "default" # Load the wallet and set it to load on startup docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" loadwallet "default" true
-
Create Lyncoin Wallet (optional, for dual-chain mining):
# Create a new wallet named "default" docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" createwallet "default" # Load the wallet and set it to load on startup docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" loadwallet "default" true
-
Generate Kylacoin Address:
docker compose exec -it kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getnewaddress
-
Generate Lyncoin Address (optional, for dual-chain mining):
docker compose exec -it lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getnewaddress
-
Update .env file with your addresses (optional - leave
LCN_WALLET_ADDRESSblank for Kylacoin-only mining)
Test that CLI tools are working correctly:
# Linux/macOS
./test-cli.sh
# Windows
test-cli.bat
# Or manually test individual commands
docker compose exec kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getblockchaininfo
docker compose exec lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getblockchaininfoCheck blockchain sync status:
# Kylacoin
docker compose exec kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getblockchaininfo
# Lyncoin
docker compose exec lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getblockchaininfoCheck mining info:
# Kylacoin
docker compose exec kylacoin kylacoin-cli -datadir="/home/kylacoin/.kylacoin" getmininginfo
# Lyncoin
docker compose exec lyncoin lyncoin-cli -datadir="/home/lyncoin/.lyncoin" getmininginfo- Check Docker logs:
docker compose logs [service-name] - Verify
.envfile configuration - Ensure ports aren't already in use
- Verify both daemons are synced
- Check RPC connectivity
- Review proxy logs for errors
- Ensure miner is pointing to correct host:port
- Verify wallet address format
- Check proxy logs for submission details
- Change default RPC passwords in
.env - Consider using firewall rules for RPC ports
- Keep wallet backups secure
- Monitor for unauthorized access
kylacoin-stratum-proxy/
├── docker-compose.yml # Main compose file
├── .env.example # Example environment configuration
├── .gitignore # Git ignore rules
├── Dockerfile # Proxy container build
├── Dockerfile.kylacoin # Kylacoin daemon container
├── Dockerfile.lyncoin # Lyncoin daemon container
├── entrypoint.sh # Docker entrypoint script
├── requirements.txt # Python dependencies
├── setup.sh / setup.bat # Setup scripts for different platforms
├── health-check.sh # Health check scripts
├── binaries/ # Cryptocurrency binaries directory
│ ├── kylacoin/ # Kylacoin binaries
│ └── lyncoin/ # Lyncoin binaries
├── config/ # Configuration templates directory
│ ├── kylacoin.conf # Kylacoin daemon config template
│ └── lyncoin.conf # Lyncoin daemon config template
├── kcn_proxy/ # Proxy application package
│ ├── consensus/ # Block/transaction building
│ ├── rpc/ # RPC client implementations
│ ├── state/ # Template state management
│ ├── stratum/ # Stratum protocol server
│ ├── utils/ # Hashing and encoding
│ └── zmq/ # ZMQ block listeners
└── submit_history/ # Block submission logs