Skip to content

Add rx/mars algorithm: RandomX on Bitcoin-style 80-byte headers#3803

Open
novalis78 wants to merge 2 commits into
xmrig:masterfrom
marscoin:marscoin-rx
Open

Add rx/mars algorithm: RandomX on Bitcoin-style 80-byte headers#3803
novalis78 wants to merge 2 commits into
xmrig:masterfrom
marscoin:marscoin-rx

Conversation

@novalis78

Copy link
Copy Markdown

Marscoin uses a Bitcoin-derived consensus with an 80-byte block header (version + prev_hash + merkle_root + timestamp + bits + nonce) where the nonce sits at offset 76. This differs from CryptoNote-family coins which use variable-length blobs with the nonce at offset 39.

This change adds a new algorithm variant RX_MARS that uses the same reference RandomX configuration as rx/0 but tells Job::nonceOffset() to return 76 instead of 39.

Changes:

  • src/base/crypto/Algorithm.h: declare RX_MARS = 0x7215126d + kRX_MARS
  • src/base/crypto/Algorithm.cpp: register rx/mars name, aliases (randomx/mars, rx/marscoin), and include in RandomX order list
  • src/base/net/stratum/Job.cpp: return 76 from nonceOffset() for RX_MARS

No changes to RandomX core, VM, or OpenCL backends. The RxAlgo default path (RandomX_MoneroConfig) is used.

Usage: ./xmrig -a rx/mars -o stratum+tcp://pool:port -u WORKER -p x

Marscoin uses a Bitcoin-derived consensus with an 80-byte block header
(version + prev_hash + merkle_root + timestamp + bits + nonce) where
the nonce sits at offset 76. This differs from CryptoNote-family coins
which use variable-length blobs with the nonce at offset 39.

This change adds a new algorithm variant RX_MARS that uses the same
reference RandomX configuration as rx/0 but tells Job::nonceOffset()
to return 76 instead of 39.

Changes:
- src/base/crypto/Algorithm.h: declare RX_MARS = 0x7215126d + kRX_MARS
- src/base/crypto/Algorithm.cpp: register rx/mars name, aliases
  (randomx/mars, rx/marscoin), and include in RandomX order list
- src/base/net/stratum/Job.cpp: return 76 from nonceOffset() for RX_MARS

No changes to RandomX core, VM, or OpenCL backends. The RxAlgo default
path (RandomX_MoneroConfig) is used.

Usage: ./xmrig -a rx/mars -o stratum+tcp://pool:port -u WORKER -p x
novalis78 added a commit to marscoin/marsforge that referenced this pull request Apr 19, 2026
Updates the mining instructions to:
- Explain why stock xmrig doesn't work (nonce offset mismatch)
- Link to our fork at marscoin/xmrig branch marscoin-rx
- Link to upstream PR xmrig/xmrig#3803
- Provide git clone + cmake + make build instructions
- Update run command to use -a rx/mars

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Builds xmrig on Linux x86_64, macOS (ARM + Intel), and Windows x64
when a version tag is pushed. Publishes as a GitHub Release with
SHA-256 checksums for each archive.

Triggers on tag push (v*) or manual workflow dispatch.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant