Raman Marozau

CTO & Founder of Target Insight Function

Principal Engineering Architect

Skip to main content

Bitcoin Core

R&D: Formal AI Integration

Raman Marozau · 2026-03-31

← Back to Research

R&D: Formal AI Integration in Bitcoin — Problems, Models, and Protocol-Level Enforcement

Executive Summary

Bitcoin has operated for more than fifteen years without AI in consensus-critical validation. That remains true, and this research does not propose changing it.

At the same time, adaptive and ML-based techniques are increasingly applied to operational domains: fee estimation, peer selection, relay policy, Lightning Network routing, and anomaly detection. These integrations are happening incrementally, often without shared acceptance criteria for safety, trust boundaries, failure handling, or systemic effects.

This creates a review gap. Proposals can appear locally reasonable while introducing unclear trust transitions, unstable degradation behavior, or network-level side effects that no single node controls.

This R&D project defines the problem space, proposes a protocol-level enforcement substrate stdio_bus, and provides formal models for trust boundaries, policy enforcement, fallback behavior, latency discipline, and isolation. The research is phased: problem framing first, implementation proposals after community discussion of the problem space.


Scope and Non-Goals

This research covers non-consensus operational behavior only.

In scope:

  • Acceptance criteria for adaptive components in non-consensus node paths
  • Trust boundaries, policy mediation, fallback behavior, latency bounds, isolation, and systemic side effects
  • Protocol-level enforcement as implementation substrate

Non-goals:

  • Consensus rule changes
  • Claims that Bitcoin requires AI for protocol validity
  • Product proposals or deployment plans in this phase
  • Re-architecture of existing Bitcoin Core components

Reader contract: this document presents problems and research directions. The community decides what matters and what to prioritize.


Why Now

This is timely not because of a single "AI feature," but because review pressure is already visible in active Bitcoin Core development:

  • Fee estimation accuracy and testability are under active discussion (#27995, #18243). As fee logic becomes more sophisticated, the question of what constraints and evidence reviewers should expect becomes pressing.

  • Relay and mining policy separation is being discussed (#32401), alongside growing mempool policy composition complexity (#29319). These are policy-layer changes where composition conflicts and precedence ambiguity matter.

  • Process isolation and boundary hardening are actively tracked in the multiprocess effort (#28722). As components are separated into distinct processes, the question of what isolation guarantees are sufficient becomes concrete.

  • Network topology resilience is a live concern: net split risks (#33958), peer selection randomization (#34019), and connection diversity (#28462, #16599) are all open threads where adaptive behavior could help or harm depending on how it is constrained.

These are current review surfaces where composition, boundaries, and failure behavior already matter — and where adaptive logic will increasingly be proposed.


Formal Problem Statement

Adaptive components and critical node software optimize for fundamentally different properties:

Adaptive behavior tends towardCritical node behavior requires
Non-deterministic outputsReproducible decision paths
Opacity in reasoningAuditable evidence for decisions
Diverse failure modes (drift, hallucination)Graceful, deterministic degradation
Variable latency with tail riskBounded completion behavior
Training-dependent behavior changesStable, reviewable invariants

The formal problem: given a deterministic system S with safety invariants R, and an AI agent A that produces probabilistic recommendations, find an integration architecture that provides utility from A while guaranteeing R holds regardless of A's output quality, maintaining bounded response time, and degrading gracefully when A fails.

This is a structural conflict, not an implementation bug. Without explicit architecture and constraints, these property sets collide in every system that attempts to combine them.


Problem Taxonomy

This research identifies six problem areas. Each is independent but connected through a shared review gap: missing acceptance criteria for adaptive components in non-consensus paths.

IDProblem AreaFocusBoundary
R1Non-consensus systemic risksNetwork/market emergent effectsNot trust semantics or failure handling
R2Trust boundary and anti-launderingData trust states, provenance trackingNot policy decision logic
R3Deterministic fallbackFailure handling, recovery protocolNot timing/budget discipline
R4Policy enforcement semanticsDecision logic, composition, auditNot trust provenance
R5Latency budget disciplineTiming, budget reservation, loadNot failure state machines
R6Risk-based isolationContainment, leakage, data minimizationNot policy or trust semantics

R1: Non-Consensus Systemic Risks

Problem. When many nodes independently deploy similar adaptive strategies, local optimizations can couple into emergent network-level dynamics. Some behaviors remain consensus-safe while becoming network/market-unsafe: transaction propagation fragmentation, convergent fee behavior creating market distortion, peer-selection concentration reducing graph diversity, mining centralization pressure from asymmetric AI advantages, and herd behavior eroding behavioral diversity that itself serves as a resilience property.

Why now in Core. Open issues on peer diversity (#16599, #34019, #28462), net split risks (#33958), fee estimation (#27995), and relay efficiency (#34542) each address individual symptoms. None frame the systemic risk class connecting them.

Research direction. Enforce network-facing constraints through a trusted mediation layer: bounded relay reachability, bounded fee-policy deviation, bounded peer centralization with diversity floors. Coordination-risk controls: model diversity, randomized tie-breaking, anti-correlation noise, synchrony monitoring, operator-local emergency disable conditions with shared observability signals.

Related open issues. #27995, #16599, #34019, #28462, #33958, #34542.


R2: Trust Boundary and Anti-Laundering

Problem. Without formal trust-state transitions and provenance continuity, advisory outputs can accumulate de facto authority through processing chains. The boundary between untrusted influence and trusted decision input becomes ambiguous. If advisory-influenced data can be transformed and later appear indistinguishable from core-derived data, trust boundaries collapse silently (trust laundering).

Why now in Core. Bitcoin Core already handles trust distinctions implicitly — peer-provided data vs locally validated data, RPC input vs internal state. But there is no explicit vocabulary or checklist for reviewing trust transitions when adaptive/external advisory inputs are introduced into operational decision paths.

Research direction. Propose a minimal trust-state vocabulary (untrusted / validated / trusted) for review of non-consensus decision inputs. Endorsement checks at the mediation boundary (schema, authorization, policy, binding, capability, budget) before advisory data can influence actions. Provenance continuity so advisory influence cannot be laundered. Authorization bound to the original initiator to prevent confused-deputy escalation.

Related open issues. No directly related open issues found — this is an under-explored area in current review practice.


R3: Deterministic Fallback and Recovery

Problem. If fallback and recovery behavior is not specified deterministically, failure handling becomes inconsistent exactly during stress events — unstable degradation and unpredictable recovery when safety margins are thinnest.

Why now in Core. Bitcoin Core handles some failure modes deterministically (peer disconnection on protocol violation, block download timeout). But there is no shared convention for how adaptive components should degrade and recover. As proposals for adaptive fee estimation, peer scoring, or routing emerge, reviewers need minimum fallback properties.

Research direction. Minimum required properties: monotonic degradation (only stricter modes on failure), bounded recovery gating (eligibility, low-risk probing, success-streak validation before promotion), idempotent retries, explicit anti-flapping controls (hysteresis, minimum dwell, cooldown, transition rate limits). Timeout ownership and state transitions in the mediation layer.

Related open issues. No directly related open issues found — fallback/degradation discipline is under-explored for adaptive components.


R4: Policy Enforcement Semantics

Problem. As adaptive logic is integrated, validation checks tend to be added at multiple points in application code, producing fragmented enforcement. Without a formal policy model and single deterministic mediation point, it is hard to prove all advisory outputs are evaluated consistently. Composition conflicts and hidden bypass paths become difficult to detect.

Why now in Core. Policy separation (#32401), mempool policy composition (#29319), fee estimation constraints (#27995), and fee testability (#18243) are all active. Each addresses a specific policy domain; none frame general advisory-to-action mediation semantics.

Research direction. For new adaptive policy paths, require one explicit decision path with deterministic semantics and auditable trace. Define effect semantics (permit, deny, forbid with non-overridable precedence), deterministic combining (forbid-overrides default), fail-closed defaults, hierarchical policy layers, complete decision witness for replay, and pre-deploy static analysis (conflicts, shadowing, gaps, obligation incompatibility).

Related open issues. #27995, #32401, #29319, #18243.


R5: Latency Budget Discipline

Problem. Adaptive inference adds variable latency to operational paths. Without explicit budget reservation, advisory processing can consume time required for mandatory policy, apply, audit, and fallback steps — turning latency variance into reliability and safety risk.

Why now in Core. Block download stalls, RPC batch overload, and IBD sync delays under resource pressure are symptoms of the same underlying problem: no explicit budget discipline separating mandatory processing time from optional/advisory time. As adaptive components are proposed for latency-sensitive paths, reviewers need a convention for timing constraints.

Research direction. For latency-sensitive paths, require explicit timeout budget split, fallback-time reservation (advisory cannot consume fallback budget), and logged timeout decisions for replay and debug. Mode-aware adaptation (normal/degraded/shedding/emergency) with replay-compatible controller state. Under load: admission thresholds, priority scheduling, fairness policy, shedding behavior enforced by the trusted boundary.

Related open issues. No directly related open issues frame this as formal budget discipline for adaptive paths.


R6: Risk-Based Isolation and Leakage Control

Problem. Advisory components are increasingly isolated with process/container mechanisms, but these are often treated as binary ("sandboxed or not") rather than quantified risk controls. Without risk-based guarantees, isolation cannot answer: how much can leak, through which channels, what blast radius remains after compromise.

Why now in Core. The multiprocess effort (#28722) confirms process isolation is an active engineering priority. This research extends the isolation question to include formal leakage guarantees, data classification, and risk-proportional containment.

Research direction (Phase 1 — minimum baseline). Define IPC allowlist, privilege boundaries, fail-closed error handling, and audit hooks. Enforce explicit invariants: no direct core writes, restricted egress via trusted IPC boundary, bounded resources, fail-closed sandbox errors, no cross-tenant flow.

Research direction (Phase 2 — advanced track). Extend to covert-channel modeling (timing/size/order/contention/error), measurable leakage limits, class-based leakage budgets with dual limits on rate and per-session volume, and data minimization architecture where sensitive raw inputs stay outside advisory reach.

Related open issues. #28722.


Non-Consensus Systemic Effects (Expanded)

This risk class deserves expanded treatment because it is the most underestimated and least covered by existing review practice.

A common assumption is that if consensus remains safe, the system is safe. This is false at the network and market level. Certain behaviors remain fully consensus-correct while being systemically harmful:

Propagation fragmentation. Different adaptive relay policies can reduce effective transaction reachability. Some transactions propagate to subsets of the network only — without violating any consensus rule. This degrades the reliability property that users depend on.

Convergent fee behavior. If a significant fraction of nodes use similar adaptive fee strategies, coordinated market effects emerge without explicit coordination. Synchronized fee spikes or drops distort the natural fee market. No individual node is "wrong," but the aggregate effect is harmful.

Mining centralization pressure. Miners with access to superior adaptive optimization gain systematic advantages in fee revenue and block construction efficiency. This creates centralization pressure that undermines the decentralization property Bitcoin depends on — while every block remains consensus-valid.

Peer-selection concentration. Local optimization of peer metrics (latency, reliability) can reduce network graph diversity, increasing vulnerability to partitioning attacks. Each node appears to make a good local decision; the network-level effect is harmful.

Herd behavior and diversity loss. Convergent adaptive strategies reduce behavioral diversity across the network. This diversity is itself a resilience property — it makes coordinated attacks harder. Convergent strategies erode it silently, and the erosion is invisible to consensus-level review.

These effects are particularly dangerous because current review practice does not have a standard way to evaluate them. If we only ask "is consensus safe?", we miss "is the network still healthy and decentralized under these dynamics?"


Implementation Substrate: Protocol-Level Enforcement via stdio_bus

The formal models in this research require an enforcement mechanism. The research identifies that application-level checks are insufficient — guarantees must be enforced at the protocol/mediation boundary.

Why protocol-level. If trust transitions, policy evaluation, fallback control, timeout ownership, and isolation invariants are implemented as scattered application-level checks, they can be bypassed, forgotten, or composed incorrectly. Protocol-level enforcement means these guarantees are structural — they hold by construction of the communication architecture, not by developer discipline.

stdio_bus as substrate. The stdio_bus transport layer provides the concrete enforcement plane for this research:

  • Channel isolation: AI agent communicates only through stdin/stdout pipes. No direct channel to Policy Engine, Core, or Client. Proven within the formal model by construction of stdio_bus architecture.
  • Policy enforcement: Policy evaluation runs as synchronous in-process call within the bus boundary. Context is immutable during evaluation.
  • Fallback control: Bus owns the AI timeout timer. When timeout fires, bus triggers deterministic fallback — not the AI component. Anti-flapping state machine runs within bus.
  • Latency budget: Bus allocates T_ai budget, enforces early cutoff, manages admission control and load shedding.
  • Isolation: stdio_bus is part of the Trusted Computing Base (TCB) for isolation. Only allowed egress channel for AI process. Provides FIFO enforcement, jitter mitigation, frame validation, session routing isolation.
  • Audit: Decision witness generated within bus for every advisory decision. Correlation IDs propagate through protocol translation.

What stdio_bus does not solve alone. Network-level systemic effects (R1) require governance, metrics, and operational controls beyond the transport layer. stdio_bus provides the enforcement hooks (policy gates, audit, kill-switch path), but systemic risk management requires deployment-level coordination.

Relationship to phases. stdio_bus is presented here as R&D context. In community-facing discussion (bitcoin-dev, GitHub issues), the problem framing is presented first without implementation specifics. stdio_bus enters the discussion only after problem statements are accepted.


Method and Evidence

This research is based on:

  • 11 R&D documents (00-10) covering formal models, case studies, comparative evaluation, and future directions
  • Verified open Bitcoin Core issues (confirmed via GitHub API, March 2026)
  • Formal specifications in temporal logic and TLA+
  • Comparative evaluation of 7 architectures (2 baselines, 5 AI variants)

Not used: closed issues, speculation about future Bitcoin Core direction, claims about specific AI model capabilities.


Evaluation Summary

Comparative evaluation (documented in research) compared 7 architectures across safety, performance, reliability, and cost:

ArchitectureUnsafe Rate (per 10K)Policy BypassEscape Ratep95 Latency OverheadFallback Correctness
B0 (no AI)0.5 (0.1–1.2)N/AN/A0%N/A
B1 (rule-based)0.3 (0.1–0.8)N/AN/A+2%N/A
C0 (direct AI)5.2 (3.1–8.4)N/A0.1%+5%N/A
C4 (full stack)0.2 (0.0–0.6)0%0%+15%100%

Values show mean with 95% confidence intervals where applicable. Table shows representative subset (B0, B1, C0, C4); full comparison including C1–C3 is documented in the evaluation research (Doc 09).

C4 (full advisory pattern with trust + policy + fallback + isolation) achieves lowest unsafe rate, zero policy bypass, zero escapes, and 100% fallback correctness at 15% latency overhead. It sits on the Pareto frontier for safety-performance trade-off.

C4 is recommended for safety-critical applications with mature governance. For non-critical applications or immature governance, simpler approaches (C3 or B1) may be sufficient.


Roadmap

Community Engagement Phases

PhaseTimingActionGoal
AWeek 1bitcoin-dev framing post + Issue R1 (systemic risks)Establish problem framing, get initial reaction
BWeek 2Issue R4 (policy enforcement)Most practical issue for Core reviewers
CWeek 3Umbrella issue (index) + Issue R6 (isolation)Connect to multiprocess effort
DWeeks 4-6Issues R2, R3, R5Complete problem surface
EAfter problem acceptanceResearch corpus summary + stdio_bus as substrateSolution-phase, only after explicit community signal

Technical Research Horizons

HorizonTimeframeFocus
H1 (Hardening)0-18 monthsMechanized proofs of core invariants, runtime covert-channel monitoring, benchmark standardization
H2 (Expansion)18-36 monthsHardware-backed isolation (TEE), distributed trust boundaries, human factors modeling
H3 (Foundational)36+ monthsMulti-agent safety algebra, unified risk calculus, post-quantum audit integrity

Open Problems

  • Formal verification of kernel/container isolation (currently empirical)
  • Interpretability vs performance trade-off for advisory models
  • Adversarial robustness standards for advisory components
  • Long-term drift detection and safe adaptation protocols
  • Human-AI collaboration optimization (approval fatigue, trust calibration)

Traceability Matrix

Problem AreaRelated Open Core IssuesResearch DocsProposed Discussion Output
R1: Systemic risks#27995, #16599, #34019, #28462, #33958, #3454207 (Bitcoin case study)Network stability constraints, coordination-risk controls
R2: Trust boundary(gap — no open issues)02 (Trust boundary model)Minimal trust-state vocabulary for review
R3: Fallback(gap — no open issues)04 (Fallback state machine)Minimum fallback properties for adaptive components
R4: Policy enforcement#27995, #32401, #29319, #1824303 (Policy algebra)Decision semantics, composition rules, audit requirements
R5: Latency budget(gap — no open issues)05 (Latency budget theory)Budget split convention, fallback-time reservation
R6: Isolation#2872206 (Isolation experiments)Phase-1 isolation baseline, Phase-2 leakage quantification

What This Is Not

  • An AI adoption mandate — Bitcoin does not need AI to function.
  • A product pitch — stdio_bus is research substrate, not a product in this phase.
  • A claim that current Core review is broken — the goal is incremental improvement for an emerging class of changes.
  • A request to re-architect Bitcoin Core — existing architecture is not claimed to be unsafe.

Conclusion

Bitcoin does not need AI to remain a valid protocol. But adaptive operational logic is increasingly relevant in non-consensus domains, and ad hoc integration creates genuine risk — not to consensus, but to network health, decentralization, and operational safety.

This R&D project identifies the review gap, maps six concrete problem areas with verified anchors in current Bitcoin Core development, proposes protocol-level enforcement as the implementation substrate, and provides formal models with comparative evaluation.

The practical question is not "AI yes or no." It is whether adaptive components, where they are introduced, will be governed by shared acceptance criteria and verifiable enforcement — or integrated ad hoc, with safety left to convention.

This research provides the engineering foundation for the first option.

Target Insight Function Logo

Cloud Architect & Systems Innovator. One Vision. Infinite Scale.

HomeBuildResearchComposeExperienceEducationContact
raman@worktif.com+48 881 592 968

Szwedzka 4, Warszawa

© 2026 Target Insight Function Ltd. All rights reserved.