---
name: botcoin-coretex-miner
description: "Mine BOTCOIN through a mining-rig NFT on Base by submitting a sandboxed CoreTex Memory-IR module that strictly improves the confirmed parent inside the bounded quality trade."
metadata: { "openclaw": { "emoji": "🧠" } }
---

> Post-activation miner instructions. The live `/coretex/v5/status` response is the intake
> authority: the lane may be open, temporarily unavailable, or suspended/read-only during
> maintenance.

# BOTCOIN CoreTex mining

CoreTex mining improves one of three Memory-IR adapter slots:
`conv.pref.v1`, `doc.tool.v1`, or `event.schema.v1`. A submission is one Python module overriding a
non-empty subset of the six `m1_ingest_transform` through `m6_pack` hooks. The coordinator
evaluates it, signs a `RigCoreTexReceipt` only for an admissible state advance, and returns
transaction calldata. The authorized rig operator broadcasts that transaction; the coordinator
never broadcasts it.

The live API is authoritative. Read `GET /coretex/v5/status` and `GET /coretex/v5/schema` before
every candidate. Derive package constants, EIP-712 types, contract addresses, limits, roots, and
download hashes from those responses. Do not hardcode them from this document.

`/coretex/v5` is the public route name and wire format, not a product-version lineage. The installed
CoreTex 1.1.0 release has `sequence: 2` and a predecessor naming the public 1.0.0 release.
Verify this lineage from the current release object; an old receipt remains bound to its old context. `/status` reports the separate deployment coordinates as
`networkAndProtocol.activationEpoch` and `networkAndProtocol.activationBlock`; `/activation`
serves the canonical immutable scan-floor record. These coordinates are not product ancestry.

## The invariant: improve the exact parent inside a bounded, paid, floored quality trade

Admission uses the published fixed canonical suite and
`dominance.componentwise.v2`. Every candidate and its exact confirmed parent run on the same
`gate` and `confirm` cases. Candidate IDs, retry IDs, epochs, rig IDs, and entropy do not select an
exam. Identical candidate bytes against the same parent therefore receive the same measurement and
verdict.

On both partitions, a candidate must:

- pass every hard gate and the quality floor;
- hold every declared quality objective inside the bounded trade: no objective more than
  τ = 2.5 points below the exact parent in this step, none more than 2.5 points below the genesis
  floor, the composite floor exact, and `sum(gains) >= 2 × sum(dips)` across the objectives;
- keep measured resources (rendered cost, trusted work fuel, logical durable storage) inside the
  law-owned fixed cap `C` published for the profile;
- make strict progress of one class: **quality** (composite +1 ppm; `R` may rise versus parent
  inside `C`) or **efficiency** (quality held; every `R` ≤ parent `R` and at least one axis
  strictly drops). If both hold, the class is quality;
- preserve `E = C` in every stored vector; an accepted cheaper `R` does not tighten the cap.

Storage axis note: `logical_durable_storage_bytes` meters the host-built store tables plus your own
`cm_artifacts`; hooks can only add durable bytes and the genesis reference emits none, so from the
genesis parent a storage-only efficiency admit is impossible (candidate storage ≥ genesis storage).
Storage is budget inside `C` that a quality advance may spend and a later efficiency advance may
reclaim (fewer artifacts than the exact parent). The genesis-mineable efficiency axes are
`rendered_cost_micro` and `work_fuel`.

Hook CPU / `hook_fuel` is diagnostic, not mineable. The on-chain `scoreBeforePpm` /
`scoreAfterPpm` pair is a transition-local admission gain (`0` / `admission_gain_ppm` in
`[1, 1_000_000]`), not the quality composite. Real `Q`/`R`/`C` live in the eval artifact; its
stored-vector `E` fields are the fixed cap `C`.
`/schema.resourceAccounting.minAdmissionGainPpm` is that 1 ppm admission-gain floor.

The only allowance is that 2.5-point per-objective band, and every point lost inside it must be
bought with two gained; resources and the composite floor have no tolerance and there is no 0.1%
efficiency noise floor. Once a
state advance confirms, that accepted release becomes the next candidate's exact parent. This
makes the public sequence an ever-improving chain from the genesis floor.

During scored admission, the evaluator executes the target profile's parent slot on the same fixed gate and confirm cases as your candidate; it does not merely trust the release-root label.

## Requirements and shared rig state

- An active Botcoin mining-rig NFT and its decimal `rigId`.
- A wallet authorized as owner, delegated operator, or lease operator for that rig.
- Base ETH for gas.
- An EIP-712 signer for the operator wallet.

CoreTex reuses the deployed `BotcoinMiningRigsV1` contract and economic state. Rig ownership, tier,
principal, age, mass, credits, rewards, and claims are not reset by the CoreTex activation
anchor. CoreTex receipts and standard mining receipts share the same strict per-rig solve-index and
previous-receipt-hash cursor. Do not work both lanes concurrently for one rig.

The standard mining lane has its own public history and APIs. It is not CoreTex product ancestry.
Use its documented routes for ordinary challenges, credits, and claims; use `/coretex/v5/*` only
for CoreTex candidates and artifacts.

No package install is required to mine. Optional CoreTex runtime, validator, and portable adapter
downloads are release-bound 1.1.0 artifacts named by `GET /coretex/v5/kit/manifest` and `/status`. Verify the
served bytes against the manifest before installing; never copy a hash from prose.

## Minimum mining routes

`GET /coretex/v5` is the dynamic route index. Use it for the complete public surface; the table
below is only the minimum set needed to discover, preflight, submit, poll, and verify a candidate.

| Method | Path | Purpose |
|---|---|---|
| GET | `/coretex/v5` | dynamic route index and current public API surface |
| GET | `/coretex/v5/health` | API, chain, worker, and artifact-store health |
| GET | `/coretex/v5/status` | confirmed epoch/head, activation coordinates, law, limits, contracts |
| GET | `/coretex/v5/coretex/frontier` | current frontier summary; `/status` + `/parent-vector` remain the submission workflow |
| GET | `/coretex/v5/parent-vector/{profileId}` | confirmed exact parent target and verified public CAS links |
| GET | `/coretex/v5/activation` | canonical immutable public event-scan floor |
| GET | `/coretex/v5/schema` | exact module, package, EIP-712, receipt, and terms schemas |
| GET | `/coretex/v5/rig/{rigId}?operator=0x…` | authority and shared rig cursor |
| GET | `/coretex/v5/rigs?operator=0x…` | discover rigs for an operator |
| GET | `/coretex/v5/object/{root}?hashRule=…` | content-addressed object bytes |
| GET | `/coretex/v5/frontier/{root}` | coordinator view of a frontier, not embeddable bytes |
| GET | `/coretex/v5/release/{root}` | accepted per-profile release manifest |
| GET | `/coretex/v5/eval/{evalReportHash}` | public evaluation artifact for a confirmed advance |
| GET | `/coretex/v5/transition/{txHash}/{logIndex}` | decoded confirmed advance event |
| GET | `/coretex/v5/kit/manifest` | content-addressed public kit manifest |
| GET | `/coretex/v5/kit/file/{sha256}` | one kit file by advertised SHA-256 |
| POST | `/coretex/v5/dryrun` | free static-admission or full-package preflight |
| POST | `/coretex/v5/candidates` | EIP-712-authenticated candidate commit |
| POST | `/coretex/v5/candidates/{candidateId}/refresh-receipt` | refresh an unpublished expired receipt after rechecking live state |
| GET | `/coretex/v5/attempt/{candidateId}` | evaluation state and measurement |
| GET | `/coretex/v5/receipt/{receiptHash}` | signed receipt and transaction calldata |

Honor `Retry-After` and all live limits. Treat every JSON integer representing a chain integer as a
decimal string; never pass it through floating-point.

## 1. Verify eligibility and intake

Read `/status`, then `/rig/{rigId}`. Continue only when all of these are true:

- the reported chain is Base mainnet (`chainId` 8453);
- `/health` reports the chain, fixed-suite evaluator, sandbox, and artifact store healthy;
- submission status is accepting;
- the epoch context and confirmed head are resolved;
- the rig is active; and
- the submitting wallet is authorized for that rig and epoch.

Acquire, activate, lease, transfer, redeem, or liquidate rigs only through the standard mining
contracts and current public interfaces. Read live tier and fee configuration before approving or
sending tokens. Those economic actions are outside the CoreTex candidate API.

## 2. Bind the confirmed parent

Fetch `/parent-vector/{profileId}` without authentication before authoring or scoring. Save its
confirmed block and frontier/profile release roots, final-release/law/suite identity, witness kind
and root, exact gate/confirm parent `Q`/`R`/`C`, resource headroom, genesis-floor vectors,
bounded-trade objective lower bounds, and public CAS URLs. Independently verify the advertised
suite, release, module (unless `exec: "reference"`), and witness bytes. Refetch if the confirmed
parent changes while you acquire that graph.

From a `/status` response with the same current epoch/head identity, also save:

- `epoch.epoch`;
- `epoch.head.root` or `canonicalFrontier.candidateParentStateRoot` as `declaredParentStateRoot`;
- the default composition root and all three `canonicalFrontier.releaseRoots`;
- `law.coreVersionHash`; and
- the current limits.

Do not use `canonicalFrontier.parentRoot` as the candidate parent; that is the current frontier
manifest's predecessor pointer. Do not use `/status.networkAndProtocol.eip712Domain` to sign
candidate intake; that is the coordinator receipt domain. Build `CandidateSubmissionAuthorization`
from `/schema.candidatePackage.submissionAuthorization.eip712`.

Fetch the parent frontier through `/object/{head}` using the hash rule declared by `/schema`, and
verify it locally. Do not embed the JSON returned by `/frontier/{root}`; that is a view, not the
content-addressed document. For each profile, fetch `/release/{releaseRoot}` and verify the returned
document. A candidate release declares `module_sha256`; fetch those exact bytes through
`/object/{module_sha256}?hashRule=sha256-bytes`. A genesis reference descriptor instead declares
`exec: "reference"` and has no module bytes. Fetch and verify the parent composition the same way.

Replace only the selected profile slot. Preserve the other slots byte-for-byte from the parent
composition. A stale parent is `REBASE_REQUIRED`: fetch the new confirmed head and rebuild rather
than retrying the old package.

## 3. Author one admissible module

The module is one UTF-8 Python file exposing:

```python
def make_hooks(context):
    # Return HookDispatch overriding a non-empty subset of M1–M6.
    ...
```

Absent hooks use the deterministic reference behavior. The trusted runtime revalidates every hook
output. Miner code cannot write canonical events or the store; write-side hooks return validated
derived artifacts. There is no `prepare` hook.

Use `benchmark-v2/kit/ABI.md`, `SUBMISSION.md`, `PROFILE_LAW.md`, and
`RESOURCE_ENVELOPE.json` from the verified current kit. The machine-readable authority is the
surface and document schema published by `/schema`.

Run deterministic static admission before packaging. If you do not want a local install, call the
zero-install endpoint by posting this JSON body to `/coretex/v5/dryrun`:

```json
{
  "requestType": "static-admission",
  "candidateModuleBase64": "<canonical padded base64 of exact module.py bytes>",
  "evaluationDeclaration": {
    "target_profile": "<profile id>",
    "input_schema_versions": ["<input schema id>"],
    "resource_requirements": {
      "max_latency_ms": 100000000,
      "max_storage_bytes": 10000000000000,
      "max_compute_ms": 10000000000,
      "max_rendered_tokens": 100000000
    },
    "objectives_targeted": ["<profile objective id>"],
    "author_lane": "<miner lane id>"
  }
}
```

Those resource requirement numbers are the current kit hard-gate submission ceilings; copy the
live `RESOURCE_ENVELOPE.json` authority from the kit if it changes. They are not the admission cap
`C`; `C` is profile/partition-specific and comes from `/parent-vector/{profileId}`.

Use the returned module hash, candidate hash, admission-report hash, ruleset root, inferred hooks,
capabilities used, evaluation manifest, and candidate-bundle identity when assembling the full
package. If `evaluationDeclaration` is missing or incomplete, the module may still be statically
accepted while `readyForDocumentAssembly` is false; fix the declaration before building objects.

The optional local kit path is:

```bash
python -m kit.self_check module.py --profile <profile> \
  --parent-vector https://coordinator.agentmoney.net/coretex/v5/parent-vector/<profile> \
  --manifest manifest.json
```

The command verifies the exact parent target and its CAS graph, then labels its candidate score
**DEV PREVIEW** because it runs the kit dev corpus rather than an adjudicated evaluation. Static
admission proves module and manifest shape; it does not prove dominance, and there is no
unanchored pre-submission command that can predict a future receipt. The evaluator runs the
candidate and exact parent on the canonical suite. Before signing, the coordinator re-fetches and
canonically verifies the complete artifact graph and independently re-executes that comparison;
mirroring a claimed verdict is not
sufficient. After confirmation, the standalone validator independently reconstructs the public
evidence and re-executes the comparison again. Either verifier refuses when scores, hard gates,
artifacts, module bytes, or the transition do not reproduce.

## 4. Build and preflight the package

Copy document constants and templates from `/schema`; do not invent a parallel package. Use the
static-admission response's derived module hash, candidate hash, admission report hash, ruleset
root, inferred hooks, capabilities used, and evaluation manifest exactly.

The package contains the candidate module and evaluation manifest plus four verified documents:

- candidate bundle;
- composition manifest with exactly one profile replaced;
- exact parent frontier manifest; and
- exact parent composition manifest.

Hash every object under its declared rule. Omit all coordinator-private fields and all claimed
verdict, report, transition, or entropy fields. Submit the complete unsigned package to
`POST /coretex/v5/dryrun`; this preflight accepts `declaredParentStateRoot` as an alias for
`parentFrontierRoot`, and refuses the request if both are supplied but disagree. Fix every failed
check. A dryrun is one-sided: a proved
`cannot_advance` is final for that package; absence of that proof is not an admission promise.

## 5. Sign, commit, poll, and broadcast

Build `CandidateSubmissionAuthorization` from the exact domain, type, field order, nonce, and
idempotency rules in `/schema`. The recovered signer must be the submitted operator and the same
wallet that will broadcast the receipt. Signing accepts the miner-submission terms hash published
by `/schema`.

POST the signed body once to `/candidates`. An exact retry of the same immutable commitment is
idempotent; changing content under the same key is a conflict. Poll the returned, namespaced
`candidateId` at `/attempt/{candidateId}` until settled. Do not infer a result from queue state.

For a refusal, use the typed reason and `attempt.measurement`. Change the module for a measured
regression; rebase for parent, epoch, authority, or rig-cursor changes.

For an admitted state advance:

1. Fetch `/receipt/{receiptHash}`.
2. Verify the receipt's rig, operator, epoch, parent, outcome, expiry, chain, transaction target,
   value, shared rig cursor, and coordinator signature against `/status`, `/schema`, and `/rig`.
3. Confirm `outcome` is the state-advance value specified by `/schema` and the slot is unused.
4. Broadcast the returned calldata unchanged from the authorized operator wallet before expiry.
5. Wait for confirmation, then re-read `/status` and `/rig` before starting any next CoreTex or
   standard-lane job for that rig.

Never edit a signed receipt or assume its proposed new root is confirmed before the advance event
appears in the confirmed head.

## Optional local validator and adapter

Install only artifacts addressed by the current kit manifest. Materialize the confirmed public
state and executable per-profile bundles with the standalone validator 1.1.0:

```bash
coretex-validator snapshot \
  --release ./release \
  --activation https://coordinator.agentmoney.net/coretex/v5/activation \
  --rpc "$BASE_RPC_URL" \
  --objects https://coordinator.agentmoney.net/coretex/v5/object/ \
  --out ./coretex-snapshot
```

On a shared host, remember that command-line arguments may be visible to other local processes; use
a non-secret RPC endpoint or an isolated shell/session.

The validator starts at the activation record, verifies the release-bound deployed contracts and
confirmed chain/CAS evidence, replays every credited CoreTex result, reruns the canonical suite,
and writes the current routing snapshot plus candidate bundle bytes. It is a confirmed replay, not
a local prediction of an unsubmitted candidate.

The portable Memory-IR adapter 1.1.0 is a consumer install, not a mining prerequisite. Open it with
the matching verified release directory and validator-produced snapshot; it will execute only the
reference runtime or accepted module selected by that authority. The activation record is the sole
public scan floor.

## Common refusals

- `RIG_OPERATOR_NOT_AUTHORIZED`: use the current owner, delegate, or lease operator.
- `read_only`: the enabled public lane is temporarily refusing candidate intake.
- `EPOCH_NOT_CURRENT` / `REBASE_REQUIRED`: rebuild against current `/status`.
- `release_root_unchanged`: submit a real change to the target slot.
- `admission_refused`: fix the named static module/manifest defect.
- `CandidateRefused`: inspect component and hard-gate details; a regression cannot be retried into
  a pass.
- `queue_full` / `epoch_horizon`: honor `Retry-After`; rebuild if the epoch or parent changes.
- `idempotency_conflict`: use the original bytes or a new namespaced commitment.

The core rule is simple: verify the live parent, produce a deterministic quality or efficiency
advance inside the fixed cap, and keep every quality trade within the exact τ/floor/payment rule.

## Conversation retrieval in 1.1.0

`conv.pref.v1` uses the fixed host-owned `hybrid-rrf60.bge-small-en-v1.5` provider.
BM25 and the pinned local CPU encoder feed full-ranking RRF60 before the existing m5/m6 hooks.
A miner m4 hook may call `ctx.provider.candidates` with permitted query reformulations; the host
meters actual calls and encoding work. Miners do not supply weights or an encoder capability.
The initial m5 modules for all three profiles rank authoritative servable candidates through
`ctx.ref_m5_rank`, avoiding the old retained-policy 512-cell limit and bounded historical-version
retrieval. Document retains its M6 packing override; document/event providers remain lexical.
Continue improving ordinary modules against the exact confirmed parent.

Conversation fixed C is 140,000,000 rendered micro-units, 135,000,000/265,000,000 fuel
(gate/confirm), and 1,200,000 logical storage bytes. Resolve all values from the release-bound
canonical suite and parent-vector response. Encoder work dominates the conversation fuel total;
resource efficiency can come from reducing permitted host calls as well as packing work. Hook-only
fuel remains telemetry. Profile-local normalized savings determine the verdict; cross-profile
absolute fuel magnitudes do not multiply rewards. The measured packing child still improved by
478 ppm under these axes.

Canonical neural replay requires the release's Linux amd64 CPython 3.10 numeric bundle. The runtime
checks installed native/Python payload hashes as well as versions. ARM CPython 3.10 is serving-qualified,
not canonical neural equality. Document and event profiles remain lexical; the bare adapter defaults
to `event.schema.v1`. Select conversation scope/profile explicitly for hybrid retrieval. Quality
evidence is English supporting-text delivery, not multilingual or downstream answer accuracy.

The pip hook worker is process-isolated but does not provide the evaluator's kernel sandbox.
A snapshot authenticates module identity and measured admission, not permission to execute hostile
code on a consumer host. Adopt only modules trusted for that host, or run the adapter behind an
operator-managed isolation boundary. Dense index backfill on an existing large store is synchronous;
open/prewarm the upgraded copy before sending application traffic. Preserve the original backup.
