{
  "question": "For the exact Puzzle #140 goal, is the proposed entrant-only private-runner design sound, and what concrete checks must pass before any real-key execution? Review RCKangaroo@618473ac and JeanLucPons/Kangaroo@37576c82 for recovery-output, DP leakage, untrusted collision inputs and checkpoint-integrity hazards.",
  "status": "INCOMPLETE_BY_DESIGN: this item delivers one threat review + acceptance checklist only; no search, recovery, signing or broadcasting performed. Goal #140 remains unsolved.",
  "scope": "Public primary sources (pinned GitHub commits) + exact arithmetic + small synthetic sentinel experiments. No machine config/credentials/private state inspected. Recipient fixed by objective; not substituted.",
  "pinnedSources": {
    "RCKangaroo": {
      "repo": "https://github.com/RetiredC/RCKangaroo",
      "commit": "618473acd7f5e696be5ec4f8377c18cc55c1361c",
      "license": "GPLv3 (header: '// License: GPLv3, see \"LICENSE.TXT\" file'; README: 'RCKangaroo is free and open-source (GPLv3).')",
      "sha256": {"RCKangaroo.cpp": "ef2a2819f33456c52be2a06d9c97db62d8f12e524d3d598b0c9c4a8e2ce805f0", "README.md": "65327d14621769c411a4ae58a27b557c25b01171854c1ec56b8315810ee586f3"},
      "locators": {
        "recovered_key_stdout": "RCKangaroo.cpp:725 printf(\"...PRIVATE KEY: %s...\", s)",
        "recovered_key_file": "RCKangaroo.cpp:726-730 fopen(\"RESULTS.TXT\",\"a\"); fprintf(fp,\"PRIVATE KEY: %s\\n\", s) -> written to process CWD (inside checkout by default)",
        "cannot_save_hang": "RCKangaroo.cpp:732-734 on fopen failure prints key then while(1) so key stays on screen/scrollback",
        "no_network": "0 socket/listen/recv/accept/bind occurrences in RCKangaroo.cpp (local-only, no server mode)",
        "no_checkpoint": "no SaveWork/LoadWork/fread/fwrite/resume in RCKangaroo.cpp (no resumable checkpoint; long run restarts from zero)"
      }
    },
    "JeanLucPons_Kangaroo": {
      "repo": "https://github.com/JeanLucPons/Kangaroo",
      "commit": "37576c82d198c20fca65b14da74138ae6153a446",
      "license": "GPLv3 (main.cpp header: 'the Free Software Foundation, version 3.')",
      "sha256": {"Network.cpp": "3d950fdcada863ffb4e89fc558d3151f4331b3b96983fb9d7ffdc2fa0315a8a8", "Kangaroo.cpp": "0dabe31c688f11048bff6e3efe3080866112590034cb5c85f15f8e618ed36200", "Backup.cpp": "0b6b74fde56ffaf78effbe0e2b094fb0bfd518c34a78fe7e08fe9af978aa73c1", "main.cpp": "d3de6e84e4e984003c11c2838743aca06ba5de85bde4895da0ed4b1bd681df97"},
      "locators": {
        "recovered_key_output": "Kangaroo.cpp:182-200 writes 'Priv: 0x...' to outputFile (-o) or falls back to stdout",
        "dp_server_ingress": "Network.cpp:511-592 SERVER_SENDDP reads DPHEADER + malloc(sizeof(DP)*head.nbDP) from client, pushes to recvDP",
        "dp_validation_disabled": "Network.cpp:547 '//#define VALIDITY_POINT_CHECK' -> point-recompute/hash validation of client DPs is compiled OUT by default; untrusted DPs enter hashtable unverified in server/client mode",
        "cleartext_network": "Network.cpp PUT/GET raw TCP (README: port 17403) with no TLS/auth -> tame/wild DP points and distances transit in cleartext",
        "checkpoint_integrity": "Backup.cpp:103-204 ReadHeader checks only 32-bit magic (HEADW/HEADK)+version; LoadWork only adds on-curve check ('key does not lie on elliptic curve'); no MAC/signature -> tampered/poisoned work file accepted"
      }
    }
  },
  "designAssessment": {
    "no_real_search_on_public_workers": "ENDORSED. RCKangaroo is local-only (no sockets); JLP must NOT be launched with -s/-c for #140. Public/LLM workers lack GPUs and must never hold the real pubkey search that could surface the key.",
    "candidate_over_inherited_FD_32B": "SOUND and preferred over files. Reproduced: 32 raw bytes cross an inherited pipe FD intact without touching disk, argv or env. Replaces RCKangaroo RESULTS.TXT / JLP -o file, both of which persist the key on disk.",
    "private_checkpoint_dir_outside_checkout": "NECESSARY but INSUFFICIENT alone. Keeps work files out of the repo (which is uploaded), but see operator-limit below. Checkpoints must be treated as untrusted inputs (no integrity in either tool).",
    "local_only_coordination": "ENDORSED. Disables cleartext TCP DP exchange (Network.cpp) and its unvalidated-DP ingress.",
    "fixed_recipient": "VALIDATED. bc1pg6luxm9s4qq65lge4l6ual7xwdw5v85eh675cmrl5we0ht3vpfhswxu0cx decodes mainnet (hrp=bc), witver=1 (P2TR), bech32m checksum OK. Pay only this, less network fee.",
    "core_rpc_signing_local_auth": "ACCEPTABLE if auth is supplied explicitly at run time (never read from checkout/env baked into repo); sign+broadcast only after regtest rehearsal and UTXO re-verification.",
    "fresh_utxos_fee_bounds": "REQUIRED. Re-query spendable UTXOs at claim time; cap fee; abort if prize already spent/moved.",
    "separate_public_receipt": "ENDORSED. Public artifact carries txid/address only, never the key or distances."
  },
  "operatorLimit_whatFilePermsCannotProtect": "A platform operator (root or same-UID, or who controls the sandbox/host) is NOT constrained by file modes. 0600 on a private checkpoint dir, a pipe FD, or an output file only excludes other unprivileged users. The operator can read process memory, ptrace/attach the signer, read the inherited FD and stdout, snapshot the private dir, capture the Core RPC credentials at use, or swap the recipient before broadcast. Therefore a wrapper/permissions alone do NOT make a shared holder private: if the holder is untrusted, the real key and signing must run only on entrant-controlled hardware. Do not assert otherwise.",
  "reproducedEvidence": {
    "interval_arithmetic": "Inclusive [2^139, 2^140-1]; width = (2^140-1) - 2^139 + 1 = 2^139 keys. Kangaroo expected work ~ 2*sqrt(2^139) ~= 2^70.5 group ops (context only; not a platform capability claim).",
    "recipient_checksum": "bech32m decode of recipient: hrp=bc (mainnet), witver=1, polymod==0x2bc830a3 (valid bech32m). Pure arithmetic, test/scratch/bech32.py.",
    "fd_vs_file_leak": "test/scratch/fd_vs_file.py on synthetic 64-hex sentinel (deadbeef*8): appended file created mode 0o644 (group/other-readable, persists on disk); 32 bytes over inherited pipe FD delivered intact, no disk/argv exposure. Demonstrates file-based recovery output leaks where inherited-FD transfer does not.",
    "dp_validation_default_off": "Confirmed by source read: VALIDITY_POINT_CHECK is a commented-out #define, so default JLP server build ingests client DP points without recomputing/validating them."
  },
  "auditMatrix": [
    {"id": "A1", "priority": "P0", "hazard": "Recovered key printed to stdout and appended to RESULTS.TXT in CWD", "tool": "RCKangaroo@618473ac", "locator": "RCKangaroo.cpp:725-730", "mitigation": "Run only in private runner; patch/redirect output to an inherited FD; never run in the checkout CWD; scrub scrollback.", "repro": "grep for 'PRIVATE KEY' and fopen(\"RESULTS.TXT\")"},
    {"id": "A2", "priority": "P0", "hazard": "Priv key written to -o outputFile or stdout fallback", "tool": "JLP@37576c82", "locator": "Kangaroo.cpp:182-200", "mitigation": "Use inherited-FD sink; forbid -o to shared path; capture+discard stdout in runner.", "repro": "source read"},
    {"id": "A3", "priority": "P0", "hazard": "Untrusted client DPs accepted without point validation (validation #ifdef off by default)", "tool": "JLP@37576c82", "locator": "Network.cpp:511-592 (547)", "mitigation": "Local-only; do not use -s/-c; if ever networked, compile VALIDITY_POINT_CHECK and add auth/TLS.", "repro": "grep '//#define VALIDITY_POINT_CHECK'"},
    {"id": "A4", "priority": "P1", "hazard": "DP points/distances transit cleartext TCP (wild/tame leakage, MITM)", "tool": "JLP@37576c82", "locator": "Network.cpp PUT/GET; README port 17403", "mitigation": "Disable network modes entirely for #140.", "repro": "README + source"},
    {"id": "A5", "priority": "P1", "hazard": "Checkpoint/work files have no integrity (magic+version only); poisoned/tampered file silently loaded", "tool": "JLP@37576c82", "locator": "Backup.cpp:103-204", "mitigation": "Store checkpoints in private dir; wrap with HMAC the runner verifies before LoadWork; treat foreign work files as untrusted; -wcheck is not a MAC.", "repro": "flip a byte -> only on-curve check may catch, header/distances not"},
    {"id": "A6", "priority": "P1", "hazard": "Incomplete-checkpoint claim: RCKangaroo has NO resume; long #140 run cannot be checkpointed/resumed", "tool": "RCKangaroo@618473ac", "locator": "no SaveWork/LoadWork in RCKangaroo.cpp", "mitigation": "Do not claim resumability for RCKangaroo; if resume needed, use JLP work files (with A5 guard).", "repro": "grep absence"},
    {"id": "A7", "priority": "P1", "hazard": "fopen-failure hang leaves key on screen indefinitely", "tool": "RCKangaroo@618473ac", "locator": "RCKangaroo.cpp:732-734", "mitigation": "Pre-create writable FD sink so this branch never runs; monitor for the WARNING string.", "repro": "source read"},
    {"id": "A8", "priority": "P0", "hazard": "Operator can bypass file perms (memory/ptrace/FD/snapshot/RPC-cred capture/recipient swap)", "tool": "design", "locator": "n/a", "mitigation": "Run real key + signing only on entrant-controlled host; public workers do synthetic/small-range only.", "repro": "threat model"}
  ],
  "acceptanceChecks": [
    "Build both tools from the pinned commits; record binary sha256; confirm licenses (GPLv3) and that redistribution of any patched build stays GPLv3.",
    "Verify no network listener/egress for #140: RCKangaroo has none; JLP launched without -s/-c; port 17403 never opened.",
    "Redirect all key output to an inherited FD: confirm RESULTS.TXT (RCK) and -o/stdout (JLP) never receive the key; the private runner writes the key nowhere on disk.",
    "Small-range known-answer E2E on the private runner (e.g. puzzle32.txt / a generated 32-40 bit challenge): tool recovers the known key AND the key is verified (pubkey==G*k) before any claim; key emitted only over the inherited FD.",
    "Leak scan: after the small-range solve, scan every file the process wrote + captured stdout/logs for the 64-hex sentinel/key; it MUST be absent everywhere except the inherited FD.",
    "DP ingress: confirm no unvalidated DP path is reachable (local-only); if any networked mode is used, VALIDITY_POINT_CHECK must be compiled in.",
    "Checkpoint integrity: corrupt one byte of a work file; the runner's MAC check MUST reject it before LoadWork; untrusted/foreign work files are refused.",
    "Recipient: re-validate bech32m mainnet P2TR checksum of bc1pg6luxm9s4qq65lge4l6ual7xwdw5v85eh675cmrl5we0ht3vpfhswxu0cx at claim build time.",
    "Claim rehearsal on Bitcoin regtest only: build+sign+broadcast a tx paying ONLY the recipient minus fee; Core RPC auth supplied explicitly at run time, not from the checkout.",
    "At real claim: re-query fresh spendable UTXOs for the puzzle address, enforce a fee bound, abort if already spent; publish a separate public receipt carrying txid/address only."
  ],
  "limitations": [
    "No real search, recovery, signing or broadcasting was performed; #140 solution status is UNKNOWN and remains unknown.",
    "Source behavior assessed by reading pinned commits; not executed/compiled here (no GPU, no build in this item).",
    "Upstream README performance figures are data, not verified platform capability; the ~2^70.5 figure is textbook arithmetic, not a runtime estimate for this machine.",
    "The reported #140 public key and current spendable prize were NOT independently re-verified in this item (out of scope: no key ops); that verification is an acceptance check for a later wave.",
    "DP-validation default-off finding is based on the commented #define in Network.cpp at the pinned commit; downstream forks may differ."
  ]
}
