diff --git a/.github/ISSUE_TEMPLATE/bug_report.md b/.github/ISSUE_TEMPLATE/bug_report.md index 6061aeec..570169f6 100644 --- a/.github/ISSUE_TEMPLATE/bug_report.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -17,9 +17,9 @@ Steps to reproduce the behavior. A clear and concise description of what you expected to happen. **Required data** - - XMRig version - - Either the exact link to a release you downloaded from https://github.com/xmrig/xmrig/releases - - Or the exact command lines that you used to build XMRig + - XMRig-HAC version + - Either the exact link to a release you downloaded from https://git.hush.is/dragonx/xmrig-hac/releases + - Or the exact command lines that you used to build XMRig-HAC - Miner log as text or screenshot - Config file or command line (without wallets) - OS: [e.g. Windows] diff --git a/.gitignore b/.gitignore index 9687ec69..0b818c78 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,6 @@ /build +/build-windows +/deps-windows scripts/build scripts/deps /CMakeLists.txt.user diff --git a/CHANGELOG.md b/CHANGELOG.md index dc25c1b9..52712ae3 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,11 @@ +# XMRig-HAC Fork +- Added **DragonX** coin support +- Added **rx/hush** algorithm (RandomX-HUSH variant for HUSH/DragonX) +- Customized RandomX configuration for HUSH/DragonX mining +- Based on XMRig v6.25.0 + +--- + # v6.25.0 - [#3680](https://github.com/xmrig/xmrig/pull/3680) Added `armv8l` to the list of 32-bit ARM targets. - [#3708](https://github.com/xmrig/xmrig/pull/3708) Minor Aarch64 JIT changes (better instruction selection, don't emit instructions that add 0, etc). diff --git a/CMakeLists.txt b/CMakeLists.txt index 4b36a8df..30fea744 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -162,7 +162,7 @@ if (XMRIG_OS_WIN) src/crypto/common/VirtualMemory_win.cpp ) - set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv dbghelp) + set(EXTRA_LIBS ws2_32 psapi iphlpapi userenv dbghelp bcrypt) elseif (XMRIG_OS_APPLE) list(APPEND SOURCES_OS src/App_unix.cpp diff --git a/README.md b/README.md index 7b6e66c5..bfa3fc39 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,17 @@ -# XMRig +# XMRig-HAC -[![Github All Releases](https://img.shields.io/github/downloads/xmrig/xmrig/total.svg)](https://github.com/xmrig/xmrig/releases) -[![GitHub release](https://img.shields.io/github/release/xmrig/xmrig/all.svg)](https://github.com/xmrig/xmrig/releases) -[![GitHub Release Date](https://img.shields.io/github/release-date/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/releases) -[![GitHub license](https://img.shields.io/github/license/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/blob/master/LICENSE) -[![GitHub stars](https://img.shields.io/github/stars/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/stargazers) -[![GitHub forks](https://img.shields.io/github/forks/xmrig/xmrig.svg)](https://github.com/xmrig/xmrig/network) +XMRig-HAC is a fork of [XMRig](https://github.com/xmrig/xmrig) with added support for **DragonX** coin mining using the **rx/hush** (RandomX-HUSH) algorithm. -XMRig is a high performance, open source, cross platform RandomX, KawPow, CryptoNight and [GhostRider](https://github.com/xmrig/xmrig/tree/master/src/crypto/ghostrider#readme) unified CPU/GPU miner and [RandomX benchmark](https://xmrig.com/benchmark). Official binaries are available for Windows, Linux, macOS and FreeBSD. +**Repository:** [git.hush.is/dragonx/xmrig-hac](https://git.hush.is/dragonx/xmrig-hac) + +## Fork Changes + +This fork adds: +- **DragonX** coin support +- **rx/hush** algorithm (RandomX-HUSH variant) +- Customized RandomX configuration for HUSH/DragonX + +Based on XMRig v6.25.0. ## Mining backends - **CPU** (x86/x64/ARMv7/ARMv8/RISC-V) @@ -15,7 +19,7 @@ XMRig is a high performance, open source, cross platform RandomX, KawPow, Crypto - **CUDA** for NVIDIA GPUs via external [CUDA plugin](https://github.com/xmrig/xmrig-cuda). ## Download -* **[Binary releases](https://github.com/xmrig/xmrig/releases)** +* **[Binary releases](https://git.hush.is/dragonx/xmrig-hac/releases)** * **[Build from source](https://xmrig.com/docs/miner/build)** ## Usage @@ -24,15 +28,8 @@ The preferred way to configure the miner is the [JSON config file](https://xmrig * **[Wizard](https://xmrig.com/wizard)** helps you create initial configuration for the miner. * **[Workers](http://workers.xmrig.info)** helps manage your miners via HTTP API. -## Donations -* Default donation 1% (1 minute in 100 minutes) can be increased via option `donate-level` or disabled in source code. -* XMR: `48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD` +## Credits -## Developers +This fork is based on [XMRig](https://github.com/xmrig/xmrig) by: * **[xmrig](https://github.com/xmrig)** * **[sech1](https://github.com/SChernykh)** - -## Contacts -* support@xmrig.com -* [reddit](https://www.reddit.com/user/XMRig/) -* [twitter](https://twitter.com/xmrig_dev) diff --git a/cmake/OpenSSL.cmake b/cmake/OpenSSL.cmake index 84f97d54..d511985a 100644 --- a/cmake/OpenSSL.cmake +++ b/cmake/OpenSSL.cmake @@ -14,8 +14,20 @@ if (WITH_TLS) set(OPENSSL_USE_STATIC_LIBS TRUE) endif() + # For cross-compilation, allow manual specification of OpenSSL paths + if (CMAKE_CROSSCOMPILING AND XMRIG_DEPS) + set(OPENSSL_INCLUDE_DIR "${XMRIG_DEPS}/include" CACHE PATH "OpenSSL include dir") + set(OPENSSL_CRYPTO_LIBRARY "${XMRIG_DEPS}/lib/libcrypto.a" CACHE FILEPATH "OpenSSL crypto lib") + set(OPENSSL_SSL_LIBRARY "${XMRIG_DEPS}/lib/libssl.a" CACHE FILEPATH "OpenSSL ssl lib") + if (EXISTS "${OPENSSL_CRYPTO_LIBRARY}" AND EXISTS "${OPENSSL_SSL_LIBRARY}" AND EXISTS "${OPENSSL_INCLUDE_DIR}/openssl/ssl.h") + set(OPENSSL_FOUND TRUE) + set(OPENSSL_LIBRARIES ${OPENSSL_SSL_LIBRARY} ${OPENSSL_CRYPTO_LIBRARY}) + endif() + endif() - find_package(OpenSSL) + if (NOT OPENSSL_FOUND) + find_package(OpenSSL) + endif() if (OPENSSL_FOUND) set(TLS_SOURCES diff --git a/cmake/mingw-w64-toolchain.cmake b/cmake/mingw-w64-toolchain.cmake new file mode 100644 index 00000000..67f4a94b --- /dev/null +++ b/cmake/mingw-w64-toolchain.cmake @@ -0,0 +1,19 @@ +# CMake Toolchain file for cross-compiling to Windows using MinGW-w64 +set(CMAKE_SYSTEM_NAME Windows) +set(CMAKE_SYSTEM_PROCESSOR x86_64) + +# Specify the cross compiler +set(CMAKE_C_COMPILER x86_64-w64-mingw32-gcc-posix) +set(CMAKE_CXX_COMPILER x86_64-w64-mingw32-g++-posix) +set(CMAKE_RC_COMPILER x86_64-w64-mingw32-windres) + +# Target environment on the build host system +set(CMAKE_FIND_ROOT_PATH /usr/x86_64-w64-mingw32) + +# Adjust the default behaviour of the FIND_XXX() commands: +# search headers and libraries in the target environment +set(CMAKE_FIND_ROOT_PATH_MODE_INCLUDE ONLY) +set(CMAKE_FIND_ROOT_PATH_MODE_LIBRARY ONLY) + +# Search programs in the host environment +set(CMAKE_FIND_ROOT_PATH_MODE_PROGRAM NEVER) diff --git a/doc/api/1/config.json b/doc/api/1/config.json index 2c74cfba..edf5c8ae 100644 --- a/doc/api/1/config.json +++ b/doc/api/1/config.json @@ -20,7 +20,7 @@ "pools": [ { "url": "pool.monero.hashvault.pro:3333", - "user": "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD", + "user": "YOUR_WALLET_ADDRESS", "pass": "x", "keepalive": false, "nicehash": false, @@ -28,7 +28,7 @@ }, { "url": "pool.supportxmr.com:3333", - "user": "48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD", + "user": "YOUR_WALLET_ADDRESS", "pass": "x", "keepalive": false, "nicehash": false, diff --git a/package.json b/package.json index 80cad8a1..5a17ed1c 100644 --- a/package.json +++ b/package.json @@ -11,13 +11,13 @@ }, "repository": { "type": "git", - "url": "git+https://github.com/xmrig/xmrig.git" + "url": "git+https://git.hush.is/dragonx/xmrig-hac.git" }, "keywords": [], "author": "", "license": "GPLv3", "bugs": { - "url": "https://github.com/xmrig/xmrig/issues" + "url": "https://git.hush.is/dragonx/xmrig-hac/issues" }, - "homepage": "https://github.com/xmrig/xmrig#readme" + "homepage": "https://git.hush.is/dragonx/xmrig-hac#readme" } diff --git a/scripts/build_windows.sh b/scripts/build_windows.sh new file mode 100755 index 00000000..83c71d9d --- /dev/null +++ b/scripts/build_windows.sh @@ -0,0 +1,112 @@ +#!/bin/bash +# XMRig Windows Cross-Compilation Build Script +# Builds xmrig for Windows using MinGW-w64 on Linux + +set -e + +SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" +XMRIG_DIR="$(dirname "$SCRIPT_DIR")" +BUILD_DIR="$XMRIG_DIR/build-windows" +DEPS_DIR="$XMRIG_DIR/deps-windows" +OPENSSL_VERSION="1.1.1w" + +echo "=== XMRig Windows Build ===" +echo "Source: $XMRIG_DIR" +echo "Build: $BUILD_DIR" +echo "Deps: $DEPS_DIR" + +# Check for MinGW-w64 +if ! command -v x86_64-w64-mingw32-gcc-posix &> /dev/null; then + echo "Error: MinGW-w64 not found. Install with:" + echo " sudo apt install mingw-w64" + exit 1 +fi + +# Create directories +mkdir -p "$BUILD_DIR" +mkdir -p "$DEPS_DIR/include" +mkdir -p "$DEPS_DIR/lib" + +# Build OpenSSL if needed +if [ ! -f "$DEPS_DIR/lib/libssl.a" ]; then + echo "=== Building OpenSSL $OPENSSL_VERSION ===" + cd "$DEPS_DIR" + + if [ ! -f "openssl-${OPENSSL_VERSION}.tar.gz" ]; then + wget "https://openssl.org/source/old/1.1.1/openssl-${OPENSSL_VERSION}.tar.gz" + fi + + if [ ! -d "openssl-${OPENSSL_VERSION}" ]; then + tar -xzf "openssl-${OPENSSL_VERSION}.tar.gz" + fi + + cd "openssl-${OPENSSL_VERSION}" + + # Configure for Windows cross-compilation + ./Configure mingw64 \ + --cross-compile-prefix=x86_64-w64-mingw32- \ + no-shared \ + no-asm \ + no-zlib \ + no-comp \ + --prefix="$DEPS_DIR" + + make -j$(nproc) + make install_sw + cd "$DEPS_DIR" +fi + +# Build libuv if needed +if [ ! -f "$DEPS_DIR/lib/libuv.a" ]; then + echo "=== Building libuv dependency ===" + cd "$DEPS_DIR" + + if [ ! -d "libuv-v1.51.0" ]; then + if [ ! -f "libuv.tar.gz" ]; then + curl -L -o libuv.tar.gz https://github.com/libuv/libuv/archive/refs/tags/v1.51.0.tar.gz + fi + tar -xzf libuv.tar.gz + fi + + cd libuv-v1.51.0 + mkdir -p build && cd build + cmake .. \ + -DCMAKE_TOOLCHAIN_FILE="$XMRIG_DIR/cmake/mingw-w64-toolchain.cmake" \ + -DCMAKE_INSTALL_PREFIX="$DEPS_DIR" \ + -DLIBUV_BUILD_SHARED=OFF \ + -DBUILD_TESTING=OFF + make -j$(nproc) + make install +fi + +cd "$BUILD_DIR" + +echo "=== Configuring XMRig ===" +cmake "$XMRIG_DIR" \ + -DCMAKE_TOOLCHAIN_FILE="$XMRIG_DIR/cmake/mingw-w64-toolchain.cmake" \ + -DCMAKE_BUILD_TYPE=Release \ + -DBUILD_STATIC=ON \ + -DWITH_TLS=ON \ + -DWITH_HWLOC=OFF \ + -DWITH_OPENCL=OFF \ + -DWITH_CUDA=OFF \ + -DXMRIG_DEPS="$DEPS_DIR" \ + -DOPENSSL_ROOT_DIR:PATH="$DEPS_DIR" \ + -DOPENSSL_INCLUDE_DIR:PATH="$DEPS_DIR/include" \ + -DOPENSSL_CRYPTO_LIBRARY:FILEPATH="$DEPS_DIR/lib/libcrypto.a" \ + -DOPENSSL_SSL_LIBRARY:FILEPATH="$DEPS_DIR/lib/libssl.a" \ + -DOPENSSL_LIBRARIES="$DEPS_DIR/lib/libssl.a;$DEPS_DIR/lib/libcrypto.a" \ + -DUV_INCLUDE_DIR="$DEPS_DIR/include" \ + -DUV_LIBRARY="$DEPS_DIR/lib/libuv.a" + +echo "=== Building XMRig ===" +make -j$(nproc) + +# Strip the executable +x86_64-w64-mingw32-strip xmrig.exe 2>/dev/null || true + +echo "" +echo "=== Build Complete ===" +ls -la *.exe 2>/dev/null || echo "Executable not found" +echo "" +echo "Copy the .exe and WinRing0x64.sys to Windows to run" diff --git a/scripts/pool_mine_example.cmd b/scripts/pool_mine_example.cmd index 38f93e2e..23d3af3a 100644 --- a/scripts/pool_mine_example.cmd +++ b/scripts/pool_mine_example.cmd @@ -16,5 +16,5 @@ :: Smaller pools also often have smaller fees/payout limits. cd /d "%~dp0" -xmrig.exe -o xmrpool.eu:3333 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD -p x +xmrig.exe -o xmrpool.eu:3333 -u YOUR_WALLET_ADDRESS -p x pause diff --git a/scripts/solo_mine_example.cmd b/scripts/solo_mine_example.cmd index ab912293..48c59a81 100644 --- a/scripts/solo_mine_example.cmd +++ b/scripts/solo_mine_example.cmd @@ -12,5 +12,5 @@ :: But you will only get a payout when you find a block which can take more than a year for a single low-end PC. cd /d "%~dp0" -xmrig.exe -o YOUR_NODE_IP:18081 -a rx/0 -u 48edfHu7V9Z84YzzMa6fUueoELZ9ZRXq9VetWzYGzKt52XU5xvqgzYnDK9URnRoJMk1j8nLwEVsaSWJ4fhdUyZijBGUicoD --daemon +xmrig.exe -o YOUR_NODE_IP:18081 -a rx/0 -u YOUR_WALLET_ADDRESS --daemon pause diff --git a/src/base/crypto/Algorithm.cpp b/src/base/crypto/Algorithm.cpp index e7c4f551..9af54a51 100644 --- a/src/base/crypto/Algorithm.cpp +++ b/src/base/crypto/Algorithm.cpp @@ -82,6 +82,7 @@ const char *Algorithm::kRX_ARQ = "rx/arq"; const char *Algorithm::kRX_GRAFT = "rx/graft"; const char *Algorithm::kRX_SFX = "rx/sfx"; const char *Algorithm::kRX_YADA = "rx/yada"; +const char *Algorithm::kRX_HUSH = "rx/hush"; #endif #ifdef XMRIG_ALGO_ARGON2 @@ -148,6 +149,7 @@ static const std::map kAlgorithmNames = { ALGO_NAME(RX_GRAFT), ALGO_NAME(RX_SFX), ALGO_NAME(RX_YADA), + ALGO_NAME(RX_HUSH), # endif # ifdef XMRIG_ALGO_ARGON2 @@ -263,6 +265,10 @@ static const std::map kAlgorithmAlias ALGO_ALIAS(RX_SFX, "randomsfx"), ALGO_ALIAS_AUTO(RX_YADA), ALGO_ALIAS(RX_YADA, "randomx/yada"), ALGO_ALIAS(RX_YADA, "randomyada"), + ALGO_ALIAS_AUTO(RX_HUSH), ALGO_ALIAS(RX_HUSH, "randomx/hush"), + ALGO_ALIAS(RX_HUSH, "randomhush"), + ALGO_ALIAS(RX_HUSH, "rx/dragonx"), + ALGO_ALIAS(RX_HUSH, "dragonx"), # endif # ifdef XMRIG_ALGO_ARGON2 @@ -350,7 +356,7 @@ std::vector xmrig::Algorithm::all(const std::function #include -#include + +#ifdef XMRIG_FEATURE_TLS +# include +#else +// Standalone SHA-256 for non-TLS builds (Windows cross-compile) +# ifdef _WIN32 +# include +# include +static void SHA256(const uint8_t* data, size_t len, uint8_t* out) { + BCRYPT_ALG_HANDLE hAlg = nullptr; + BCRYPT_HASH_HANDLE hHash = nullptr; + BCryptOpenAlgorithmProvider(&hAlg, BCRYPT_SHA256_ALGORITHM, nullptr, 0); + BCryptCreateHash(hAlg, &hHash, nullptr, 0, nullptr, 0, 0); + BCryptHashData(hHash, const_cast(data), static_cast(len), 0); + BCryptFinishHash(hHash, out, 32, 0); + BCryptDestroyHash(hHash); + BCryptCloseAlgorithmProvider(hAlg, 0); +} +# else +# include "crypto/ghostrider/sph_sha2.h" +static void SHA256(const uint8_t* data, size_t len, uint8_t* out) { + sph_sha256_context ctx; + sph_sha256_init(&ctx); + sph_sha256(&ctx, data, len); + sph_sha256_close(&ctx, out); +} +# endif +#endif namespace xmrig { @@ -344,11 +371,25 @@ bool HushClient::parseBlockTemplate(const rapidjson::Value &result) const uint64_t keyHeight = getKeyHeight(m_height); if (keyHeight != m_keyHeight || m_keyBlockHash.isEmpty()) { if (keyHeight == 0) { - // Use genesis key - chain-specific initial seed - // For HACs this is typically: hash(magic + symbol + rpcport) - m_keyBlockHash = "0000000000000000000000000000000000000000000000000000000000000000"; + // Use chain-specific initial RandomX key. + // Daemon computes: sprintf("%08x%s%08x", ASSETCHAINS_MAGIC, SYMBOL, RPCPORT) + // and passes the raw ASCII bytes to randomx_init_cache(). + // We hex-encode those bytes (zero-padded to 32) for setSeedHash(). + char initialKey[81]; + const uint32_t magic = 2387029918u; // DRAGONX ASSETCHAINS_MAGIC + const char* symbol = "DRAGONX"; + const uint16_t rpcPort = 21769; + snprintf(initialKey, sizeof(initialKey), "%08x%s%08x", magic, symbol, (uint32_t)rpcPort); + const size_t keyLen = strlen(initialKey); + // Hex-encode only the actual key bytes (no zero-padding). + // The daemon passes strlen(initialKey) bytes to randomx_init_cache(), + // so we must match that exact length. + char hexBuf[163]; // max 81 bytes * 2 + 1 + for (size_t i = 0; i < keyLen; i++) snprintf(hexBuf + i*2, 3, "%02x", (uint8_t)initialKey[i]); + hexBuf[keyLen * 2] = '\0'; + m_keyBlockHash = hexBuf; m_keyHeight = 0; - LOG_INFO("%s " CYAN("using genesis RandomX key for height %u"), tag(), m_height); + LOG_INFO("%s " CYAN("using initial RandomX key \"%s\" for height %u"), tag(), initialKey, m_height); } else { LOG_INFO("%s " CYAN("fetching RandomX key block hash at height %u"), tag(), keyHeight); getBlockHash(keyHeight); @@ -504,9 +545,19 @@ bool HushClient::parseResponse(int64_t id, const rapidjson::Value &result, const case REQ_KEYHASH: if (result.IsString()) { - m_keyBlockHash = result.GetString(); + // getblockhash returns display-order (big-endian) hex, but the daemon + // passes uint256 internal bytes (little-endian) to randomx_init_cache(). + // Reverse the bytes so setSeedHash() produces the correct LE byte order. + const char* displayHash = result.GetString(); + std::vector hashBytes(32); + Cvt::fromHex(hashBytes.data(), 32, displayHash, 64); + std::reverse(hashBytes.begin(), hashBytes.end()); + char reversedHex[65]; + for (size_t i = 0; i < 32; i++) snprintf(reversedHex + i*2, 3, "%02x", hashBytes[i]); + reversedHex[64] = '\0'; + m_keyBlockHash = reversedHex; m_keyHeight = m_pendingKeyHeight; - LOG_INFO("%s " GREEN("RandomX key block %u: %.16s..."), + LOG_INFO("%s " GREEN("RandomX key block %u: %.16s... (reversed to LE)"), tag(), m_keyHeight, m_keyBlockHash.data()); // Now get the block template again with the key m_pendingRequest = REQ_NONE; @@ -741,8 +792,8 @@ std::string HushClient::serializeBlockHex(uint32_t nonce, const uint8_t* solutio void HushClient::sha256d(const uint8_t* data, size_t len, uint8_t* out) { uint8_t hash1[32]; - SHA256(data, len, hash1); - SHA256(hash1, 32, out); + ::SHA256(data, len, hash1); + ::SHA256(hash1, 32, out); } std::vector HushClient::serializeHeader(uint32_t nonce, const uint8_t* solution) const diff --git a/src/base/net/stratum/Job.cpp b/src/base/net/stratum/Job.cpp index 1a7cfbfe..c8246a1f 100644 --- a/src/base/net/stratum/Job.cpp +++ b/src/base/net/stratum/Job.cpp @@ -94,7 +94,14 @@ bool xmrig::Job::setBlob(const char *blob) bool xmrig::Job::setSeedHash(const char *hash) { - if (!hash || (strlen(hash) != kMaxSeedSize * 2)) { + if (!hash) { + return false; + } + + const size_t len = strlen(hash); + // Accept any even-length hex string up to kMaxSeedSize*2 chars. + // RX_HUSH genesis key is 23 bytes (46 hex chars), not always 32. + if (len == 0 || len > kMaxSeedSize * 2 || (len % 2) != 0) { return false; } @@ -102,7 +109,7 @@ bool xmrig::Job::setSeedHash(const char *hash) m_rawSeedHash = hash; # endif - m_seed = Cvt::fromHex(hash, kMaxSeedSize * 2); + m_seed = Cvt::fromHex(hash, len); return !m_seed.empty(); } @@ -169,6 +176,12 @@ size_t xmrig::Job::nonceOffset() const return 147; } + // HUSH/DragonX has 140-byte header with nonce at offset 108 + // (version:4 + prevHash:32 + merkleRoot:32 + saplingRoot:32 + nTime:4 + nBits:4) + if (algorithm() == Algorithm::RX_HUSH) { + return 108; + } + return 39; } diff --git a/src/config.json b/src/config.json index 48adef17..6b78dd3d 100644 --- a/src/config.json +++ b/src/config.json @@ -62,7 +62,7 @@ { "algo": null, "coin": null, - "url": "donate.v2.xmrig.com:3333", + "url": "pool.dragonx.is", "user": "YOUR_WALLET_ADDRESS", "pass": "x", "rig-id": null, diff --git a/src/crypto/randomx/configuration.h b/src/crypto/randomx/configuration.h index be344c49..7b90b8ca 100644 --- a/src/crypto/randomx/configuration.h +++ b/src/crypto/randomx/configuration.h @@ -40,8 +40,8 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. // Increase it if some configs use larger dataset #define RANDOMX_DATASET_MAX_SIZE 2181038080 -// Increase it if some configs use larger programs -#define RANDOMX_PROGRAM_MAX_SIZE 280 +// Increase it if some configs use larger programs (HUSH uses 512) +#define RANDOMX_PROGRAM_MAX_SIZE 512 // Increase it if some configs use larger scratchpad #define RANDOMX_SCRATCHPAD_L3_MAX_SIZE 2097152 diff --git a/src/crypto/randomx/randomx.cpp b/src/crypto/randomx/randomx.cpp index 1609a4af..8565097d 100644 --- a/src/crypto/randomx/randomx.cpp +++ b/src/crypto/randomx/randomx.cpp @@ -109,6 +109,15 @@ RandomX_ConfigurationYada::RandomX_ConfigurationYada() ArgonIterations = 4; } +RandomX_ConfigurationHush::RandomX_ConfigurationHush() +{ + ArgonSalt = "RandomXHUSH\x03"; + ArgonIterations = 5; + ProgramSize = 512; + ProgramIterations = 4096; + ProgramCount = 16; +} + RandomX_ConfigurationBase::RandomX_ConfigurationBase() : ArgonIterations(3) , ArgonLanes(1) @@ -369,6 +378,7 @@ RandomX_ConfigurationArqma RandomX_ArqmaConfig; RandomX_ConfigurationGraft RandomX_GraftConfig; RandomX_ConfigurationSafex RandomX_SafexConfig; RandomX_ConfigurationYada RandomX_YadaConfig; +RandomX_ConfigurationHush RandomX_HushConfig; alignas(64) RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/randomx/randomx.h b/src/crypto/randomx/randomx.h index 70abff34..6d8a7a5d 100644 --- a/src/crypto/randomx/randomx.h +++ b/src/crypto/randomx/randomx.h @@ -148,6 +148,7 @@ struct RandomX_ConfigurationArqma : public RandomX_ConfigurationBase { RandomX_C struct RandomX_ConfigurationGraft : public RandomX_ConfigurationBase { RandomX_ConfigurationGraft(); }; struct RandomX_ConfigurationSafex : public RandomX_ConfigurationBase { RandomX_ConfigurationSafex(); }; struct RandomX_ConfigurationYada : public RandomX_ConfigurationBase { RandomX_ConfigurationYada(); }; +struct RandomX_ConfigurationHush : public RandomX_ConfigurationBase { RandomX_ConfigurationHush(); }; extern RandomX_ConfigurationMonero RandomX_MoneroConfig; extern RandomX_ConfigurationWownero RandomX_WowneroConfig; @@ -155,6 +156,7 @@ extern RandomX_ConfigurationArqma RandomX_ArqmaConfig; extern RandomX_ConfigurationGraft RandomX_GraftConfig; extern RandomX_ConfigurationSafex RandomX_SafexConfig; extern RandomX_ConfigurationYada RandomX_YadaConfig; +extern RandomX_ConfigurationHush RandomX_HushConfig; extern RandomX_ConfigurationBase RandomX_CurrentConfig; diff --git a/src/crypto/rx/RxAlgo.cpp b/src/crypto/rx/RxAlgo.cpp index 0de9694b..bbf54eca 100644 --- a/src/crypto/rx/RxAlgo.cpp +++ b/src/crypto/rx/RxAlgo.cpp @@ -47,6 +47,9 @@ const RandomX_ConfigurationBase *xmrig::RxAlgo::base(Algorithm::Id algorithm) case Algorithm::RX_YADA: return &RandomX_YadaConfig; + case Algorithm::RX_HUSH: + return &RandomX_HushConfig; + default: break; } diff --git a/src/version.h b/src/version.h index 84a938f4..3ceac86d 100644 --- a/src/version.h +++ b/src/version.h @@ -8,13 +8,13 @@ #ifndef XMRIG_VERSION_H #define XMRIG_VERSION_H -#define APP_ID "xmrig" -#define APP_NAME "XMRig" +#define APP_ID "xmrig-hac" +#define APP_NAME "XMRig-HAC" #define APP_DESC "XMRig miner" -#define APP_VERSION "6.25.0" -#define APP_DOMAIN "xmrig.com" -#define APP_SITE "www.xmrig.com" -#define APP_COPYRIGHT "Copyright (C) 2016-2025 xmrig.com" +#define APP_VERSION "6.25.0-hac" +#define APP_DOMAIN "dragonx.is" +#define APP_SITE "www.dragonx.is" +#define APP_COPYRIGHT "Copyright (C) 2026 dragonx.is" #define APP_KIND "miner" #define APP_VER_MAJOR 6