feat: add BRC-170 LCH reference implementation - #501
Conversation
|
Exact head |
Codecov Report❌ Patch coverage is 📢 Thoughts on this report? Let us know! |
|
Exact head The reference path is now concrete end to end: a creator wizard publishes protected content and an Offer; the issuer produces buyer-bound Payment Demands; a BRC-100 buyer wallet funds one Atomic BEEF transaction; each Payee verifies and internalizes its exact BRC-29 wallet-payment output; the issuer verifies the signed receipts and releases the License; and the player decrypts and exercises every initial profile. Ambiguous delivery recovery reuses the same funded transaction and cannot double-pay. The package includes the deterministic-CBOR HTTP binding, reusable server/client, Payee receiver and ledger boundary, multilateral payment client, endpoint policy, recovery, and deployment adapters. The executable reference server exposes health, asset publication, acquisition, and range-capable content endpoints; Exact-head hosted CI is fully green: 36 successful checks, 3 expected scope skips, 0 pending/failing; merge gate, Sonar, CodeQL, dependency review, browser/mobile lanes, package artifact checks, and mutation gates all pass. Hosted changed-code coverage is 90.65% (2,122/2,341 points; 90% target). Local There are no unresolved review threads. This remains draft for joint review with the current BRC-170 text and for a second-implementation interoperability pass. |
|
Federated Payee delivery and the final coverage hardening are now on exact head
Validation on this head:
The PR remains draft for joint BRC-170 review and independent interoperability work. |
|
Availability and authorized-output settlement refinement is complete at d0fddb9. What is now concrete:
Validation:
The matching BRC-170 refinement is bsv-blockchain/BRCs#236 at 418ed7ed4a56fd6fa16b7a02f1eaf361929519e0. This TS Stack PR remains draft for coordinated spec and implementation review. |
|
I reviewed the current head I do have a few points I would want addressed or explicitly answered before treating this as ready:
Overall, this is a strong PR and the architecture is broadly in the right direction. My main concern is not the amount of code, but making sure the buyer-side validation and persistence boundaries are strict enough for a payment/licensing protocol. Tests reviewed: GitHub shows green checks on the current head. I did not run the full workspace locally. |
|
|
Addressed the review feedback on exact head For the three acquisition/persistence points:
The additional review findings are also closed: URL-normalized IPv4-mapped IPv6 loopback is rejected before connection (with the regression constructed through The time-bound wallet manual-suite inventory was re-audited after UTC expiry. All 30 exact dispositions remain current, and the inspection also restored six mechanically weakened string/number assertions without running funded/live suites. Validation is terminal on this exact head: 36 checks succeeded, three scope-based checks were skipped, and none failed or remain pending. Repository health, dependency review, build/typecheck/lint/format, exact package artifacts, npm supply-chain dry run, docs, aggregate coverage, |
BraydenLangley
left a comment
There was a problem hiding this comment.
Fixes look good!



Program and scope
executable profile feedback, recovery-safe multilateral settlement, and a
complete consumer/deployment documentation set for the published standard.
wallets, Payees, content hosts, and implementation agents need concrete,
interoperable LCH building blocks and an explicit way to combine them with
CHIRP without changing UHRP.
operation, application-specific catalogue/social schemas, future selective
composition mapping, partial-host CHIRP coverage, and a streaming LCH decoder.
6c7b287b69dbabc3b6a74cf56d4c7c353c55ce95.Impact
Affected packages/services and intended versions (publication occurs only
through the release workflow after approval):
@bsv/lch0.1.0 package with deterministic BRC-170 framing,encryption, rights, acquisition, multilateral settlement, key delivery,
authority/revocation, transport, composition/provenance, CLI, UHRP, and CHIRP
adapters.
@bsv/chirp0.1.1 package remains the BRC-167 storage layer;its APIs and every existing UHRP API remain backward compatible.
apps/lch-referenceneutral workbench with creator, server,player, wallet-module, all six initial usage profiles, both settlement
profiles, repeated placements, time warp, reversal, distortion, offline
Payee recovery, provider outage, and conflict cases.
docs/guides/chirp-lch-production.mdconsumer and operator guide coveringlayer selection, public APIs by role, resumable publication, acquisition,
payment destinations, independent Payee topology, persistence, failure and
recovery, security, observability, rollout/rollback, production gates, and an
agent implementation contract.
Verification
6,690 conformance vectors; LCH 118/118; CHIRP 109/109; reference workbench 15/15;
and the complete SDK, Wallet Toolbox, overlay, messaging, helper, browser, and
mobile suites.
repository health, contributor policy, dependency/release governance,
license and third-party notices, operations docs, resource profiles, browser
governance, service policies, and runtime-copy checks passed.
33 public packages; documentation policy reports 44 package docs, 100 fresh
records, and zero findings; eight examples compile against 21 exact package
tarballs; the site prerendered 120 routes, indexed 125 pages, and passed built
link and bundle-license validation.
@bsv/lchand@bsv/chirppass exact tarball,conditional export, source-map, publint, strict type, ESM consumer, CLI, Vite,
and esbuild browser checks.
apps/lch-referencebuilds browser and Nodebundles and copies its scoped notice plus exact license archive.
status: ready, itsindependently routed issuer/Payee/provider endpoints,
walletMode: fixture,and
contentAdapter: reference-memory; deployment guidance requires thosefixture/memory boundaries to be replaced before real purchases.
correctly skipped, and zero checks failed, were cancelled, or remained pending.
The merge gate, aggregate coverage, CodeQL, Sonar, Socket, dependency review,
mutation, conformance, docs, browser/mobile, package, and policy lanes passed
at the exact head SHA.
gate;
lch-cbormutation scored 92.47%; CodeQL passed; and Sonar reported zeronew issues and zero unreviewed security hotspots.
public API, artifacts, dependencies, docs, and operations
Dependency evidence
@bsv/lchmanifest and the privateapps/lch-referenceworkspace manifest. The lockfile adds only those twoimporter records and reuses versions already resolved by the workspace; it
adds no registry package snapshot or dependency override.
@bsv/lchhas no direct runtime dependency. It declares@bsv/sdkas apeer and
@bsv/chirpas an optional peer so LCH-only consumers do not pullCHIRP, while the reference app links both packages from the workspace.
exact-package artifact checks, npm release dry run, package-license policy,
third-party-material policy, and bundled-notice validation pass on the exact
head. No advisory was dismissed for this change.
Security, dependencies, and compatibility
evidence; no registry snapshot, override, advisory dismissal, quality
suppression, or required-test skip was introduced
StorageUploader,StorageDownloader,StorageUtils, UHRPidentifiers, overlays, advertisements, and routes remain unchanged
document bounded parsing, SSRF/DNS rebinding, early-consumption, credential,
key, recovery, and provider-trust boundaries
Deliveries must be persisted before fan-out and retried without replacement
providers, issuers, and content hosts can be independently operated
tradeoffs are documented and exercised
ciphertext ranges are never described as authenticated playable plaintext
Release and operations
guidance are current for published BRC-170
retention/renewal, recovery, backup/restore, rollout, and rollback are documented
behavior differs
Completion evidence