Request Quoted Span
Call GET /api/quote/:docId to mint an X-Attribution-Receipt header and
#:~:text= link while incrementing transclusion_reads.
Edge Attribution & Hypermedia Metering Lab
When automated retrieval pipelines summarize publisher pages without returning verifiable referrals, publishers
absorb crawl bandwidth costs with no feedback loop. Test an edge Worker and SQLite Durable Object issuing
signed X-Attribution-Receipt tokens with #:~:text= links, settling verified clicks,
and modeling publisher sustainability.
Issuing signed X-Attribution-Receipt headers paired with #:~:text= deep links
creates verifiable referral signals for metered discovery without forcing binary crawler bans or hard
paywalls.
/api/quote/:docId issues HMAC-SHA256 receipts that settle cleanly inside the Durable Object
AttributionLedger (/api/click-receipt), separating verified referred clicks from
replays and tampered tokens.
Strip-on-copy URL transformations by chat interfaces or aggregator proxies discard #:~:text=
parameters and receipt headers unless browsers propagate provenance natively.
Execute the attribution cycle directly against the edge Worker and SQLite Durable Object.
Call GET /api/quote/:docId to mint an X-Attribution-Receipt header and
#:~:text= link while incrementing transclusion_reads.
Settle a valid receipt (HTTP 200), mutate a signature byte (HTTP 401), or
simulate an aggregator stripping fragments and receipts on copy (HTTP 400).
Compare monthly net economics across Zero-Click Scraping, Hard Paywall, and Metered Attribution below and above break-even CTR.
Live Edge Protocol
X-Attribution-Receipt Token Structure
Tokens use three dot-separated Base64URL segments:
v1.<payloadB64>.<hmacSha256B64>.
jti: 96-bit unique receipt identifier for replay deduplicationdocId & spanHash: SHA-256 digest of normalized quoted textsessionId: binds receipt to one AttributionLedger DOiat / exp: epoch seconds validity window (3600s default)Issue a quote to generate a deep-linked #:~:text= fragment URL and X-Attribution-Receipt token.
#:~:text=)X-Attribution-Receipt—
Economic Modeling
Live HTTP status, response headers, SQLite ledger rows, and decoded HMAC signature trace.
Response Headers
Waiting for request...
Response JSON Payload
Waiting for request...
AttributionLedger)
No ledger events recorded for this session yet.
Issue or verify a quote receipt to inspect decoded Base64URL fields.
AttributionLedger), producing an auditable read-to-click ratio.
Attaches HMAC-SHA256 X-Attribution-Receipt headers, W3C #:~:text= deep-link
fragments, and a Durable Object SQLite AttributionLedger to reconcile span fetches with
verified referral clicks.
GET /hypermedia/ HTTP/1.1
User-Agent: AutomatedFetcher/1.0
HTTP/1.1 200 OK
Content-Type: text/html; charset=utf-8
<!-- Full document fetched; downstream summary omits span provenance.
Publisher pays egress cost with no cryptographic receipt
connecting transcluded passages back to referral clicks. -->
GET /api/quote/hypermedia?session=demo&span=span-1 HTTP/1.1
HTTP/1.1 200 OK
X-Attribution-Receipt: v1.eyJ2IjoxLCJqdGkiOi...sigB64
X-Attribution-Policy: metered-transclusion; v=1
X-Text-Fragment: https://aifoc.us/hypermedia/#:~:text=Hypermedia%20responses...
// Client cites fragmentUrl and settles verified referral clicks:
POST /api/click-receipt { "sessionId": "demo", "receipt": "v1..." }
Matches the live endpoints in src/worker.ts, HMAC-SHA256 signing/verification in
src/metering.ts, and fragment encoding in public/lib/economics.js.
// 1. Mint HMAC-SHA256 Receipt & Encode #:~:text= Fragment (src/metering.ts + public/lib/economics.js)
const fragmentUrl = buildTextFragmentUrl(doc.url, selectedSpan.text, {
prefix: selectedSpan.prefix,
suffix: selectedSpan.suffix,
});
const receipt = await mintQuoteReceipt({
docId: doc.id,
spanText: selectedSpan.text,
origin: url.origin,
issuedAt: nowSec,
sessionId: meta.session_id,
keySecret: meta.hmac_secret,
}); // Format: "v1." + base64url(payload) + "." + hmacSha256B64
// 2. Durable Object SQLite Ledger Settlement (src/worker.ts -> AttributionLedger)
// GET /api/quote/:docId?session=...&span=... -> increments transclusion_reads, emits X-Attribution-Receipt
// POST /api/click-receipt { sessionId, receipt } -> verifies HMAC, checks redeemed_receipts for replays:
const verification = await verifyQuoteReceipt({
receipt: params.receipt,
keySecret: meta.hmac_secret,
nowSec,
});
// Valid first click -> 200 (click_throughs++), replay -> 200 (deduplicated: true),
// tampered signature -> 401 (rejected_clicks++), strip-on-copy loss -> 400.
Unattributed full-page scraping and binary allow-all vs. 403-block postures with zero verifiable referral feedback.
Signed HMAC-SHA256 X-Attribution-Receipt headers, W3C #:~:text= deep links, replay deduplication in SQLite, and break-even CTR curves.
Chat interfaces and aggregator proxies frequently strip URL fragments and custom headers on copy; durable attribution needs native browser provenance propagation.