Skip to content
bitcryptic-gwPublic

About

MDF (Markdown First) — open web architecture proposal for native markdown serving, agent-readable content, and price-as-access-policy

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Repository files navigation

MDF — Markdown First

A proposal for a web content architecture where markdown is the source of truth, agents are first-class citizens, and access policy is expressed through price.

Status: Draft (v0.3.1) · Seeking community feedback
Project site: markdownfirst.com
Payment layer: x402 v2, with USDC on EVM chains and BTC over Lightning as its two settlement networks. 0.3.0 is a breaking change from 0.2.x — see CHANGELOG.md.
Authors: Gary Walker / BitCryptic™ · Graham Hall / Slepner


The problem in one paragraph

AI agents are now among the most frequent consumers of web content, yet the web serves them HTML — a format built for human eyes. Most agents compensate by stripping navigation, ads, scripts and layout markup client-side. That works, until it doesn't: the result depends entirely on how well a given page yields to a heuristic extractor, and the page has to be downloaded in full either way. Meanwhile the person who wrote the content receives nothing for it. MDF proposes a simple, open architecture addressing both halves: markdown as the canonical source, HTTP content negotiation for delivery, and an optional payment layer that doubles as access policy — giving creators a way to be paid for agent consumption of their work rather than watching it scraped and propagated for free.

What MDF proposes

  • Markdown-first authoring — markdown is the source of truth; HTML is rendered from it for browsers, not the other way around
  • Native agent serving — Accept: text/markdown returns clean markdown at the same URL, no conversion middleware required
  • Structured discovery — /mdf.json advertises capabilities, pricing, and content signals in a machine-readable format that agents can query before fetching
  • Price as access policy — one price per rail, in that rail's own units and with no exchange rate, unifies open access, micropayment, and private/authenticated access into one continuous spectrum, settled through x402 v2 over USDC on an EVM chain or BTC over Lightning

Two arguments, not one

Efficiency, where it applies. Serving markdown means the HTML never crosses the wire. Whether it also saves context-window tokens depends on the page: boilerplate-heavy commercial and editorial pages retain a large saving even against a good client-side extractor, while clean documentation may save almost nothing. Where MDF is unconditionally better is determinism — the publisher declares what the content is, rather than an extractor guessing, so JS-rendered, paginated and table-dense pages stop failing silently.

Compensation, always. This half doesn't depend on markdown being smaller. Today a creator's options are to be scraped for free or to retreat behind a login and disappear from the open web. MDF offers a third: stay open and discoverable, and be paid at the point of machine consumption. At higher price points the same payment mechanism issues an access credential, giving a small publisher the practical equivalent of a subscription wall without operating one — and giving agents a lawful route to content that was previously unavailable at any price.

How the price spectrum works

Price Meaning Behaviour
0.00 Open access Serve immediately, no payment required. Equivalent to permissive robots.txt.
0.0001 (example) Micropayment Agent pays a small per-fetch fee. The content creator offsets infrastructure costs. On boilerplate-heavy pages this is typically cheaper for AI operators than fetching and stripping HTML.
1.00+ Premium content Meaningful payment required. Subscription-tier documentation, research, or gated resources.
100.00+ Private / authorised only Price functions as an access barrier. At this tier, payment triggers an auth flow rather than immediate content delivery.

Each price is stated per rail in that rail's own units, with no exchange rate between rails. Whether payment buys content per fetch or a bearer credential is a separate, per-section declaration — access: "per_fetch" or access: "token" in /mdf.json — rather than something inferred from a price band, so a publisher can mark a cheap section as token-access and an expensive one as per-fetch.

Servers performing on-server markdown conversion may also report the size reduction between the original HTML and the served markdown directly in the response — giving agents a concrete efficiency signal alongside the price itself, rather than requiring them to price a request in the dark. See the concept document's Response Value Signalling section for details.

Read the full proposal

→ CONCEPT.md

The concept document covers the full architecture, existing partial solutions, open questions, and the reference implementation plan.

→ MCP-GATEWAY.md

A concept document for an MDF reference client: an MCP gateway that lets any MCP-capable agent runtime discover, negotiate, evaluate and pay for MDF content. The design doc lives here; the minimal build lives in bitcryptic-gw/mdf-mcp-gateway.

Current status

  • Concept document published
  • Specification at 0.3.1 — the x402 v2 hard cut: a 402 body is an x402 v2 PaymentRequired object, with MDF's own fields under extensions.mdf, mirrored base64 in the PAYMENT-REQUIRED header
  • mdf.schema.json — JSON Schema for /mdf.json, with per-rail pricing and a per-section access: per_fetch | token flag
  • mdf-402.schema.json — JSON Schema for the x402 v2 402 response body
  • Reference implementation — bitcryptic/mdf-reference-server on Docker Hub (bitcryptic-gw/mdf-reference-server), server 0.3.0
  • Demo site — https://mdf-demo.bitcryptic.com — both settlement rails live in production, plus the token tier
  • x402 v2 payment verification, with USDC on Base (eip155:8453) settled live on mainnet through x402 v2 facilitators — first settlement 2026-11-13
  • Bitcoin Lightning (exact / lnbtc), with invoices minted over Nostr Wallet Connect and preimages verified locally
  • Atom feed with mdf:change_type namespace — live at https://mdf-demo.bitcryptic.com/feed.xml
  • Validator CLI — bitcryptic-gw/mdf-validator, v0.3.0, covering spec 0.3.0–0.3.1
  • Reference client — MDF MCP gateway (bitcryptic-gw/mdf-mcp-gateway): a minimal mdf_fetch build covering negotiation and free content only, with payments not built

Live Demo

A reference implementation is publicly deployed at https://mdf-demo.bitcryptic.com

Try it now:

# Discover the site's MDF capabilities
curl https://mdf-demo.bitcryptic.com/mdf.json

# Fetch the agent index
curl https://mdf-demo.bitcryptic.com/llms.txt

# Request markdown directly (agent-style)
curl -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/

# Free content — no payment required
curl -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/docs/getting-started

# Priced content — 402 with an x402 v2 PaymentRequired body and PAYMENT-REQUIRED header
curl -i -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/premium/deep-dive     # 0.01 USDC on Base
curl -i -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/micropayment/intro    # 1 sat over Lightning
curl -i -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/showcase/dual-rail    # Base USDC or Lightning
curl -i -H "Accept: text/markdown" https://mdf-demo.bitcryptic.com/testnet/intro         # Base Sepolia test USDC

# Token tier — 402 with an auth_endpoint hint; one payment buys a 24 h bearer token
curl -i https://mdf-demo.bitcryptic.com/private/internals

# Atom feed with mdf:change_type metadata
curl https://mdf-demo.bitcryptic.com/feed.xml

Both rails settle real payments on the demo. Each is priced per rail in its own units — 0.01 USDC on Base and 1 sat over Lightning — with no exchange rate between them, and the first mainnet USDC settlement landed on 2026-11-13.

Paying takes an x402 v2 client: the offer in accepts[] is answered by retrying the request with a PAYMENT-SIGNATURE header built from one entry, and a successful paid response carries PAYMENT-RESPONSE. Without such a client, the priced URLs above let you inspect the offer, not settle it.

Ecosystem

markdownfirst.com

The project site: markdownfirst.com.

mdf-reference-server

The reference implementation of this specification, live at mdf-demo.bitcryptic.com. Server 0.3.0: markdown by content negotiation, /mdf.json and /llms.txt, priced content over x402 v2 on both rails, and a bearer-token tier.

→ bitcryptic-gw/mdf-reference-server

mdf-analytics-wp — MDF Analytics for WordPress

A WordPress plugin for MDF. It serves markdown to AI agents at the same URL, publishes /llms.txt and a free-only /mdf.json, and sends X-MDF-Version, which makes a site MDF 0.3.1 conformant for free content once negotiation is confirmed. It also shows you which agents visit, and which of them are asking for markdown. Paid markdown is planned, not scheduled.

→ bitcryptic-gw/mdf-analytics-wp

mdf-validator

The conformance CLI. It fetches a site's /mdf.json, validates it against the schema, checks /llms.txt reachability, and optionally verifies that content URLs respond with the right MDF headers and that discoverable 402s are well formed. Version 0.3.0 covers spec 0.3.0–0.3.1.

→ bitcryptic-gw/mdf-validator

mdf-mcp-gateway

The reference client: an MCP server for agent runtimes. The current build implements one tool, mdf_fetch(url), covering content negotiation and the free 200 path — on a 402 it returns the offer unchanged and does not attempt payment. mdf_discover, mdf_ledger, the local index and payment logic are not built yet.

→ bitcryptic-gw/mdf-mcp-gateway

Get involved

This is an early-stage community proposal. The open questions section of the concept document is a good starting point for discussion.

  • Discuss: Open an issue
  • Implement: Build an MDF-compatible server or client and link it here
  • Challenge: If you think this is wrong, redundant, or misses something — say so

License

MIT

About

MDF (Markdown First) — open web architecture proposal for native markdown serving, agent-readable content, and price-as-access-policy

Topics

Resources

Stars

2 stars

Watchers

1 watching

Forks

Releases

Packages

Contributors

Languages