Skip to content

Opt-in hashpower donation to the Pithead project wallet #2476

Open
0 of 6 issues completed
Open

Description

@VijitSingh97

What's the problem

Operator ask (2026-09-20): let operators donate hashpower to the Pithead project, the way XvB donation works today. Owner priority (2026-10-27): build it now; this lifts the post-GA deferral for this issue only. It ships dark (see the acceptance criteria): off by default, destination constants empty, setting hidden until the owner fills the constants.

Today (origin/develop-v2.1.0 at 02852bd)

  • README.md:269-275 lists the project XMR address for one-off transfers. There is no way to donate hashpower. (The first report cited README.md:259-265.)
  • The existing knobs do not reach Pithead: xmrig-proxy's --donate-level (proxy.donate_level, default 0, [Feature] Expose xmrig-proxy dev-donation level (donate-level) in config / advanced config #173; docs/configuration.md:252) pays the xmrig-proxy authors; XMRig's compiled-in 1 % fee pays XMRig (os/rootfs/Dockerfile:131; the first report cited :219); XvB donation pays the raffle. The egress list's dev donation row (dashboard/mining_dashboard/service/network/egress.py:128, first reported as :168) is xmrig-proxy's own fee and is hard-coded INACTIVE.
  • xmrig-proxy runs -m simple with an authenticated control API (docker-compose.yml:538-573). AlgoService is its only pool writer (dashboard/mining_dashboard/service/xvb/algo_service.py:75-115, loop :483-558) and switches two pools, P2Pool and XvB, inside a 10-minute cycle (config/config.py:144). No third destination exists in code, config or docs.

Mechanism (the open question in the first report, now answered)

Mining to a second wallet on the operator's own P2Pool node is not possible. Upstream P2Pool ignores a wallet sent in the miner's login (upstream README lines 190 and 257; src/stratum_server.cpp:204-313 parses only a label and a difficulty), and one P2Pool instance pays one wallet. The slice has to go to a stratum endpoint the project runs (a P2Pool mini node mining to the project address), over Tor by default with an opt-out, exactly like #166. Who operates that endpoint is an owner decision, needed for go-live but not for the build.

Requirements (kept from the first report)

Related: #2475 (chart band, closed into #2516 and #2515), #2477 (ledger, closed), #2478 (Sovereign UI tracker), #166, #173, #2367 (dashboard edits every key), #3557 (configuration model), #3566 (lean UI spec). The investigation brief of 2026-09-24 (comment below) remains valid except its host-only suggestion for the key: the keys are dashboard-editable behind the typed APPLY gate and stay off the direct-commit list.

What it impacts

  • Operators who opt in: a few minutes of hashrate a day go to the project instead of their own P2Pool payouts.
  • The project: it must run and trust a 24/7 stratum endpoint.
  • Every setup path, 2.0.0 config and upgrade: the feature must stay off unless chosen, with no key rewritten.
  • The XvB switching controller, the egress, topology and firewall views, docs/privacy.md, the config editor, the state API.
  • The public claim "no pool operator, no fee" (README.md:34-36): it stays true only because this is optional and off by default, and all copy must say so.

How I found it

Read-only scan of origin/develop-v2.1.0 at 02852bd on 2026-10-27, upstream P2Pool at master, the lean roadmap and the open v2.1.0 issues. Nothing was executed. The mechanism claim above was checked against upstream source, not against the pinned release.

Unknown, to settle in the children or at go-live: whether xmrig-proxy honours a per-pool socks5 for an onion upstream; the stratum login semantics of the pinned P2Pool release; the project node's capacity (if simple mode opens one upstream connection per rig, connections grow with rigs times donors) and its real hashrate; and which of #3632, #3575, #3576 and #3577 land first (they edit the same defaults, parse and render files).

How important is it

Owner priority, medium urgency, low risk because it ships dark. The value is mostly goodwill: at 1 % a 10 kH/s donor gives the project roughly 0.0002 XMR a month, and 1,000 such donors roughly 0.24 XMR a month (assumes network difficulty near 6.6e11 and a 0.6 XMR block reward; not verified). Hosting cost may exceed revenue until many donors, so the cost line the UI shows will read as near zero and the copy must say so. Hashpower routing is involved, so default-off must hold on every path.

Acceptance criteria

  • Every child below is closed: {{A1}} config keys; {{A1b}} appliance env; {{A2}} constants guard; {{A3}} cycle planner; {{A4}} store and API; {{A5}} docs; {{A6}} endpoint runbook; {{A7}} fake stratum; {{A8}} controller; {{A9}} egress and topology; {{A9b}} firewall choice; {{A10}} fail-open recovery; {{A11}} cost estimate; {{A12}} e2e phase; {{A12b}} bench-ci phase registration; {{A13}} profile row; UI {{A14a}} settings section, {{A14b}} chart band, {{A14c}} Earnings line, {{A14d}} Activity and attention item, {{A14e}} Inspect route row.
  • With the shipped constants empty (the state at merge): no user-visible change on any platform. The setting is hidden, the proxy pool list is byte-identical to today, and no egress or topology row appears. A test pins this.
  • donation.enabled is false after the CLI wizard, the browser wizard, the no-JS form, the minimal configs, an appliance image build and a sparse 2.0.0 config; no existing key is rewritten on upgrade.
  • On a bench, with a stub endpoint only (never the real project endpoint), the proxy flips to the stub pool and back within a cycle, the XvB slice is unchanged, workers stay attached, hashes advance, disabling stops slices and the baseline restores exactly (the --donation-routing-smoke phase).
  • Each PR follows the repo rules: new logic in new files because several files sit at their docs/dev/file-budget.tsv ceiling, no ceiling raised, no new explanatory code comments.
  • Not part of done, and not for a worker: go-live. That is the owner or devops standing up the project endpoint and one owner-authored change that fills the constants, followed by a live reachability check from a bench.

Possible solutions

Destination of the slice (owner ruling needed before go-live):

  • A (recommended). A project-run P2Pool mini node mining to a dedicated project address, exposed as a stratum endpoint, onion service preferred so donors need no exit relay and the address is self-authenticating. Needs project infrastructure off the home network. Option B, a third-party pool with the project address as login, is custodial and contradicts the product claim. Option C, a second P2Pool on the donor with the project address as --wallet, needs about 2 GB more RAM and a second sidechain sync; at most a later expert option.

Design carried by the children:

  • Keys donation.enabled (false), donation.percent (integer 1 to 10, hard cap 10) and donation.tor (true, later set by the privacy profile). The endpoint, kind and project address are not config keys: they are constants shipped in the image, so a compromised dashboard cannot redirect the slice. Empty constants mean unavailable.
  • A debt accumulator in a pure planner, because 1 % of a 600 s cycle is 6 s, below the 15 s dwell and the 60 s minimum slice. The slice is trimmed first when XvB plus the project slice would exceed the P2Pool reserve cap.
  • Fail open: end the slice and back off when the upstream is not accepting, and restore the P2Pool route when the dashboard starts.

Owner decisions still open (go-live, not build): endpoint operator, location, uptime and monthly cost; the dedicated project address and whether to publish a view key; presets and default percentage (suggested Off, 1, 2, 5, custom to 10, 2 when first enabled); routing follows the profile or always Tor; trim the project slice or honour the full percentage; fiat shown beside XMR; an always-on informational alert when the setting changes; "donation" or "support" in the copy; review budget for roughly 20 PRs.

🤖 Generated with Claude Code

Sub-issues

Sub-issues

0 of 6 Issues completed
Loading 6 sub-issues

Activity

  1. added this to the v2.x - post-GA milestone on Sep 20, 2026
  2. added
    enhancement
    dashboard
    monero
    on Sep 20, 2026
  3. pithead-developer commented on Sep 24, 2026

    @pithead-developer
    Contributor

    Investigation brief (operator pre-read, 2026-09-23)

    Triage recommendation: MOVE-sovereign-ui — no GA blocker (opt-in, off by default, no security/data-loss/Tari-fork angle; the active "v2 - appliance" GA milestone has no related open issues), and its UI surface already lives with #2475/#2477/#2478 in Sovereign UI — post-2.0; move it to track those siblings instead of the broader v2.x - post-GA bucket, once the milestone freeze lifts post-GA.

    Verify against the code before relying on this; it was written by an investigator, not the implementer.

  4. added
    tracker
    on Oct 27, 2026
  5. pithead-architect commented on Nov 20, 2026

    @pithead-architect

    Owner ruling, 2026-11-20: "we can dark release it ahead so we can spot issues in logs before making a proper ui for it".

    The backend ships in v2.0.7 and v2.0.8 with no UI, so the logs are the only way to see it working. One acceptance criterion is added to this issue:

    • While the feature is dark, every donation decision is logged at info level with a stable prefix (donation:): slice start and end, the route chosen (tor or direct), fallback to P2Pool, endpoint errors and the cost estimate. These lines appear in the dashboard log and in the support bundle, with addresses redacted by the existing redactors. No UI is required.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    dashboardenhancementmonerotracker

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions