CoreTex Client Architecture
CoreTex is the open client for BOTCOIN's retrieval-memory lane. In practical terms, it plays the role that Bitcoin Core plays for Bitcoin: it carries the code, manifests, corpus bindings, model pins, replay rules, and local verifier tooling needed to independently check the state transitions that the coordinator awards.
It is not a hosted model and not a private benchmark service. The coordinator runs CoreTex to evaluate submissions in real time, but the same pinned bundle is available to miners and independent verifiers. The chain stores roots, accepted compact patches, receipts, and epoch metadata. The CoreTex client turns those public commitments back into decoded substrate state and benchmark results.
| Role | What it runs | What it needs |
|---|---|---|
| Miner | Optional local client, or only the public /coretex/* API |
Wallet, current substrate root/body, bundle metadata, visible corpus hints |
| Coordinator | CoreTex evaluator and API mount | Active bundle, corpus release/deltas, model cache, Base RPC, signing key |
| Independent verifier | CoreTex replay client | Base RPC, contract addresses, active bundle, corpus/deltas, revealed epoch secret, accepted patch bytes |
| Calibration host | Corpus generation and bundle calibration tools | Challenge-library source, pinned BGE-M3, Qwen3, audit reranker, validation scripts |
The architecture separates three concerns:
| Concern | Where it lives |
|---|---|
| Canonical roots and credits | Base contracts: CortexState and BotcoinMiningV4 |
| Evaluator, corpus, models, replay logic | CoreTex client bundle |
| Convenience serving and real-time mining UX | Coordinator /coretex/* API |
That separation is intentional. The EVM should not run retrieval models, and miners should not have to run the whole calibration stack to participate. At the same time, accepted state advances must remain replayable by anyone who does run the client.
The design was chosen around four constraints:
- Keep settlement small enough for Base by anchoring roots, receipts, patch bytes, and epoch metadata on chain.
- Keep evaluation strong enough to measure retrieval quality by running the benchmark off chain under a pinned client bundle.
- Keep miner participation lightweight by serving current state, visible corpus views, and live coarse results through the coordinator API.
- Keep verification independent by making the same bundle, corpus roots, model manifests, patch bytes, and replay rules public.
What Ships In The Client Bundle
A CoreTex release is not just an NPM package. The bundle is the versioned verifier surface for an epoch. It contains or pins:
| Bundle component | Purpose |
|---|---|
| Substrate decoder and patch verifier | Decode 1024-word state, validate compact patches, recompute roots |
| Evaluator source files | Canonical scoring, hidden-pack derivation, per-patch randomness, replay rules |
| Corpus root and corpus release/deltas | Retrieval records, qrels, embeddings, splits, provenance |
| Model manifests | BGE-M3, Qwen3-Reranker-0.6B, audit/reference reranker pins and file hashes |
| Runtime profile | CPU-only torch/transformers/tokenizer versions and replay tolerance |
| Benchmark profile | Weights, floors, split ratios, hard-negative qrel map, hidden-pack quotas |
| Replay CLI | Watch chain logs, replay transactions, verify current state |
The minimum useful validator setup is deliberately small:
- Install the CoreTex client release.
- Provide a Base RPC URL.
- Point the client at the active contract addresses.
- Let the client fetch or verify the active bundle and corpus artifacts by hash.
Validators do not need to generate the corpus, label qrels, tune thresholds, or train models. Those are release and calibration tasks. A validator only needs the published artifacts and enough local compute for the verification depth it chooses.
A light verifier can check patch bytes, state-root continuity, bundle/corpus hash binding, and receipt structure without running the models. A full evaluator replay also runs the pinned CPU model path and reproduces gate/confirm scores within replayTolerancePpm. Both paths are useful: the light path catches impossible chain histories; the full path catches scoring drift.
Client Releases And Version Policy
CoreTex client artifacts ship as versioned GitHub releases. Each release publishes the coretex-replay and botcoin-cortex binaries plus a tarball, accompanied by SHA256SUMS and a release manifest for integrity verification.
Bundle manifests can pin a clientVersionPolicy block that gates which client versions are accepted against the active bundle:
| Field | Purpose |
|---|---|
minimumVersion |
Below this version the client is treated as outdated |
recommendedVersion |
Soft signal for operators; logged but not enforced |
hardFailOutdated |
When true, outdated clients refuse to run against this bundle |
Runtime behavior:
- A client below
minimumVersionis flaggedOUTDATED_CLIENT. - When
hardFailOutdatedis true, the client refuses canonical evaluation. An explicit emergency override flag exists for continuity during incidents. - A client at or above
minimumVersionruns normally;recommendedVersionlag is logged but not blocking.
Startup binding is fail-closed on explicit signal and tolerant on absence:
- Outdated or invalid client versions are refused.
- Bundles without a
clientVersionPolicydo not brick existing validators — the policy is opt-in per bundle, so a missing field never breaks a live fleet.
Recommended rollout for a new minimum version is phased: warn-mode publication first, fleet audit to confirm validator uptake, then hard-fail enforcement in the next bundle rotation. Operators updating to a release that crosses a minimumVersion boundary install the new artifact, verify against SHA256SUMS, and restart the client.