warriors/erga/docs.md

how erga works

erga turns an Apple Silicon Mac into an Ergo miner: press one button, the GPU searches for Autolykos v2 solutions, a pool credits the ones it accepts, and a wallet the app generated for you holds the result.

This is the explanation. The specs say what it must do; the README says how to run it.

the shape of it

erga  (cli/ — one binary: window with no arguments, commands with them)
   │
   ├── erga_app        the window (eframe/egui: draws, never mines)
   │      │  spawns `erga mine … --machine` — itself — and reads its stdout
   │      ▼
   └── erga_miner      that second process; all GPU work lives here
   │
   ├── rs/autolykos   protocol-exact reference, chain-verified
   ├── rs/pool        stratum: subscribe · authorize · notify · submit
   ├── rs/wallet      ergo-lib: BIP39 → m/44'/429'/0'/0/0 → P2PK
   └── honeycrisp     zero-copy Metal: one IOSurface-pinned table

why the miner is a separate process

The window holds an OpenGL context (eframe/glow) while the miner drives Metal through honeycrisp. Two graphics APIs in one process proved fragile enough to abort the app — silently, with no Rust panic, which is what a native abort looks like. Split apart, the window only draws; if the miner dies the UI survives and says so. The cost is a pipe and a line protocol, which is cheap.

The bundle ships one binary. The window re-invokes its own executable as erga mine … --machine, so there is no sibling to ship, to lose, or to let drift out of version with the window.

what happens when you press the crystal

  1. connect — stratum mining.subscribe, then mining.authorize with your address. The pool answers with an extranonce prefix that reserves part of the nonce space for this connection.
  2. take a jobmining.notify carries the block height, the header pre-hash, and the share target.
  3. build the table — Autolykos v2 hashes over a table of N 32-byte elements derived from the height. N grows with the chain; at height 1.86M that is 6.8 GiB, rebuilt every block. The GPU builds it in ~11 s.
  4. search — a Metal kernel scans batches of 8.4M nonces, computing each candidate's hit and comparing it to the target.
  5. verify, then submit — every candidate the GPU finds is re-hashed on the CPU reference before it is sent. Nothing invalid ever leaves the machine.
  6. repeat — until the height changes, when the table is rebuilt.

the money

A share is not payment; it is evidence of work at the pool's difficulty. The pool accumulates shares, and when it finds a block it splits the reward among whoever contributed. Below its payout floor nothing moves, which is why the app shows progress toward that floor rather than a balance that would sit at zero.

Three different numbers, deliberately:

number where it comes from what it means
hashrate the miner, live what the GPU is doing this second
effective hashes ÷ session seconds the same work, with table rebuilds counted
pool sees the pool's API what was actually credited, 24h average

They disagree, and the disagreement is the point: the third is the only one that pays.

the development share

One share in twenty is mined for the project. It is a separate authorized session, not a relabelled submit — a pool binds each connection to the address that authorized it, so shares cannot be reassigned after the fact. erga alternates: nineteen for you, one for development, and the epoch table is held across the switch so it costs a reconnect, never a rebuild.

Change it with ERGA_DONATION=off, ERGA_DONATION=<address> or ERGA_DONATION_EVERY=N.

where things live

path what
rs/autolykos the protocol: pow_hit, gen_element, calc_big_n
rs/pool the stratum client
rs/miner the engine, the Metal kernels, the headless CLI
rs/wallet seed, address, transaction building
rs/app the window, as a library
cli/ the command that opens it, and everything else
rs/blake-bench, rs/rtable-bench, rs/mine-bench the measurements that came first
packaging/ the .app, the .dmg, and the icon as code

Folder

Homonyms

soft3/conformance/docs
why conformance soft3 is fourteen repos that all serialize, hash, prove, and verify each other's values. one repo silently changes an encoding; every snapshot, proof, and signal produced before that change becomes unverifiable. the harness catches the change at the moment it happens, not months…
soft3/tru/docs
tru docs teaching and explanation for tru — the convergence VM. the normative contracts live in [specs/](/soft3/tru/specs); this tree explains and references them, it never duplicates them. explanation why tru works the way it does — narrative, derivations, background. see…
soft3/glia/docs
docs
cyb/wysm/docs
docs
warriors/trisha/docs
Trisha documentation explanation why Trisha works the way it does — design decisions and rationale. architecture — how trisha fits in the soft3 stack gpu-backend — seven shaders, one pipeline, Metal/Vulkan/DX12 proof-file-format — TOML envelope + bincode proof bytes patching — vendor patching…
cyber-valley/cve/docs
docs
soft3/radio/docs
docs
soft3/zheng/docs
docs
soft3/hemera/docs
Hemera documentation explanation why Hemera works the way it does — design decisions and rationale. see explanation/ for the full index. guides task-oriented how-tos (phase 2 — not yet written). cli.md — hash files, check sums, encode/decode streams streaming.md — verified streaming for large files…
soft3/foculus/docs
docs
neural/inf/docs
inf — a whitepaper inf is the language of a provable graph. you ask the cybergraph a question and get an answer; you state a change and the graph takes it. both come with a zheng proof that the result follows from the graph's committed state, and anyone holding the 32-byte graph root checks that…
neural/rune/docs
rune documentation Documentation follows [Diataxis](https://diataxis.fr) — four kinds, each serving a different need. The [specs](/neural/rune/specs) are the canonical reference (the fourth quadrant); this directory holds the other three. | | learning | working | |---|---|---| | **practical** |…
soft3/mir/docs
docs
soft3/cybergraph/docs
cybergraph a knowledge graph where every change is a proven computation. not "someone wrote a fact and we trust them," and not "a contract moved tokens and we re-execute to check." instead: a neuron declares what it will do, runs it, and publishes a proof that it did exactly that — and anyone…
neural/rs/docs
docs
soft3/bbg/docs
docs
neural/trident/docs
🔱 Trident Documentation [← Project Root](/neural/trident/readme) Organized following the [Diataxis](https://diataxis.fr/) framework: tutorials, how-to guides, reference, and explanation. 🎓 Tutorials: learning-oriented The Builder's Journey — six chapters that build one complete private application,…
soft3/nox/docs
docs
soft3/radio/iroh-blobs/docs
docs
soft3/strata/genies/docs
docs
soft3/radio/docs/docs
docs eventually-consistent multi-dimensional key-value documents replica a document instance identified by a NamespaceId (public key). contains unlimited entries. the namespace private key grants write authority over the entire document entries and authors an entry is identified by the tuple…
cyberia/research/mimi/docs
docs
soft3/strata/kuro/docs
docs
cyb/honeycrisp/rane/docs
docs
soft3/strata/trop/docs
docs
soft3/strata/nebu/docs
docs
cyb/honeycrisp/acpu/docs
docs
soft3/radio/iroh-willow/docs
docs
soft3/radio/iroh/docs
docs
cyb/honeycrisp/aruminium/docs
docs/ documentation for humans. three levels of depth. | file | audience | what's inside | |------|----------|--------------| | `tutorial.md` | newcomers | step-by-step first GPU program | | `guide.md` | practitioners | patterns, best practices, real workflows | | `explanations.md` | curious minds…
cyb/honeycrisp/unimem/docs
docs
cyberia/research/events/docs
docs
soft3/radio/quinn/docs
docs
soft3/strata/jali/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-aa1259cb10112b22a/rane/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-aa1259cb10112b22a/unimem/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-ad6c77c38e86bc291/rane/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-ad6c77c38e86bc291/aruminium/docs
docs/ documentation for humans. three levels of depth. | file | audience | what's inside | |------|----------|--------------| | `tutorial.md` | newcomers | step-by-step first GPU program | | `guide.md` | practitioners | patterns, best practices, real workflows | | `explanations.md` | curious minds…
cyb/honeycrisp/.claude/worktrees/agent-aa1259cb10112b22a/aruminium/docs
docs/ documentation for humans. three levels of depth. | file | audience | what's inside | |------|----------|--------------| | `tutorial.md` | newcomers | step-by-step first GPU program | | `guide.md` | practitioners | patterns, best practices, real workflows | | `explanations.md` | curious minds…
cyb/honeycrisp/.claude/worktrees/agent-ad6c77c38e86bc291/acpu/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-aa1259cb10112b22a/acpu/docs
docs
cyb/honeycrisp/.claude/worktrees/agent-ad6c77c38e86bc291/unimem/docs
docs

Graph