Skip to content
 
 

Latest commit

 

History

1 Commit

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

c_datum_prime

Public repo: github.com/Blockvase/c_datum_prime

A C translation of RATUM Prime by iohzrd. License: GNU Affero GPL v3 or later. See LICENSE and NOTICE.

This repo is only the DATUM pool server (Prime). It is not a full mining stack, not a public Stratum server, and not the LAN miner gateway. Cloning and running this binary will not hash or pay anyone by itself.

To get a Knots node, CONVOY DATUM Gateway, and miners working first, follow bitcoin-blake2b.org/mining. That guide leaves you in solo mode (datum.pool_host empty, datum.pooled_mining_only false).

CONVOY DATUM Gateway is separate MIT software. Do not merge this tree into it.

After the mining guide: point CONVOY DATUM at this pool

When Knots and CONVOY DATUM are up, replace the datum object in datum_gateway_config.json with:

"datum": {
    "pooled_mining_only": true,
    "pool_host": "pool.blockvase.com",
    "pool_port": 28915,
    "pool_pubkey": "d89f714cfe7bd9022794b42e2b9b7c196cdd0e16165df0300d788a1b18a86da20654de460ece16e2a2e88d1f8ad316f728c2b5b731d259afd55229375c905439"
}

Restart CONVOY DATUM. Keep your ASIC on the gateway's Stratum port (23334 in the guide). Do not point miners at Prime.

If you run your own Prime instead of Blockvase's, use the pool_pubkey printed at startup, pool_host 127.0.0.1 (or that host's public name), and pool_port 28915. From this LAN, pool.blockvase.com:28915 may time out (no hairpin); use 192.168.1.206.

What works now

Aligned with RATUM Prime (698a236) on the live path:

  1. Keys, listen, CONVOY DATUM/RATUM hello (v1 and v3), signed 0x99 config.
  2. Coinbaser split from a durable share ledger (RATUM window math, fee --fee-bps, --min-payout 546). Identities are username up to the first .. Mainnet P2PKH 1..., P2SH 3..., SegWit bc1q..., and Taproot bc1p... become scripts; up to 128 split outputs are served.
  3. require_split after a 30s grace (RATUM). --no-require-split to turn off.
  4. Share PoW (header-v2, twelve zero bytes in the coinbase hole), replay guard, credit into the ledger.
  5. v3 ABW: 0xA8 notices, key in H1, mask, 0xA5 receipts, 0x8F exact ref, rotate, delayed 0xA9 reveal. --abw-disabled if you need the old path.
  6. Resume tokens honored (ABW keys + coinbaser id).
  7. Block relay: nbits, 0x50 0x12/0x92, merkle, submitblock via bitcoin-cli cookie, hex under data/blocks/. Parses 0x90/0x91/0x94.
  8. Bulk framing (DBF\x01 / DBA\x01) for large replies.
  9. Stats HTTP (default 0.0.0.0:28917, /, /stats.json, and /pool.json for the Blockvase website relay).
  10. One thread per gateway. --self-test covers framing, handshake, header vectors, split 75/25 and >8 outputs, Base58Check, bech32, zero xor mask.

AGPL section 13: corresponding source is this GitHub repo and http://pool.blockvase.com:28916/ (also in the MOTD). Forward TCP 28916 (and 28917 if you want stats off-LAN). The tarball excludes data/ (keys, ledger) and build/.

systemd unit: contrib/c-datum-prime.service (TimeoutStopSec=15, KillMode=mixed; SIGTERM can hang on an open DATUM session).

Pool Info JSON

GET /pool.json on the stats listener returns public pool metadata for the Blockvase Pool tab. It includes schema_version, endpoint, source URL, pubkey, fee, payout address types, connected DATUM clients, share-window progress, blocks found, and miners by window work percent. It intentionally does not include RPC credentials, private keys, or local ledger file paths.

Build

Needs libsodium and CMake.

cmake -S . -B build
cmake --build build
./build/c-datum-prime --self-test

Run (localhost only)

After the mining guide you already have Knots. Then:

./build/c-datum-prime --keys data/pool.keys

Keys, ledger, and submitted-block files are created under data/ relative to the working directory. Bitcoin RPC defaults to $HOME/.bitcoin. Override with --bitcoin-datadir, --ledger, --block-dir, and --payout-script.

Do not forward 8332, 7152, or 23334. Forward 28915 when this Prime is public, and 28916 if remote users should fetch source (AGPL section 13).

Use a distinct process name from datum_gateway so Knots blocknotify=killall -USR1 datum_gateway does not signal Prime.

Isolation

  • Own tree, keys, ports, and unit.
  • Knots RPC stays on localhost.
  • This binary binds loopback until you pass --listen with another address.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages