bweb

module
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 28, 2026 License: Apache-2.0

README

bweb

A web origin whose servers compete. Websites kept in bstore buckets, served free to readers by any web node that holds them, behind the web server an operator already runs.

[!WARNING] Experimental and private. bweb is part of bstack, the applications and patterns built on BSV Layered Multicast. Interfaces, formats and behavior may change between releases; pin an exact version.

A publisher puts a static site into a bstore bucket with ordinary S3 tooling. The bucket's records and bytes travel once, over a multicast plane, to every node that asks for them. Each web node reads from its own copy, holds every byte to its hash before serving it, and answers readers over plain HTTP. Any number of nodes can serve the same site, and none of them needs the publisher's permission or a contract with anyone else.

bweb on a web node

Why bweb

What you get How bweb does it
Content that proves itself Every object a reader gets was verified against the bucket's token chain and its content hash first. The ETag is the content's SHA-256
Servers that are interchangeable A web node is a bstore replica plus the bweb server. Any operator can run one; a reader's request lands on whichever answers
One publish, every node A put is carried once over the plane; every node that asked for the site's topics receives the same bytes
Your web stack unchanged bweb speaks plain HTTP behind Caddy, NGINX or any front you run. It adds no TLS, caching or compression of its own
Updates with an audit trail A site changes when its owner anchors a new token. Each version is a mined transaction anyone can check
A deny list per node An operator refuses a site, an object or a content hash with 451, without touching anyone else's node
Reads that keep working A node that has read an object serves it from its own store when every provider is down

How it works

flowchart LR
  P["Publisher<br/>AWS CLI or any S3 tool"] -->|"put, anchor"| G["Writing gateway<br/>bstore s3d"]
  G -->|"records and pieces, once<br/>(multicast plane)"| N1
  G --> N2
  subgraph N1["Web node A"]
    R1["bstore gateway<br/>(reads, keeps what it fetched)"] --> B1["bweb"]
  end
  subgraph N2["Web node B"]
    R2["bstore gateway"] --> B2["bweb"]
  end
  B1 --> F1["Your front<br/>TLS, cache"]
  B2 --> F2["Your front"]
  F1 --> U(["Readers"])
  F2 --> U
  1. The publisher writes the site to a bucket through a bstore gateway and anchors it: one token names every file of that version.
  2. The plane delivers the records and pieces to every node subscribed to the bucket's topics. A node asks for them through the topic interest protocol, so it receives only the sites it chose to serve.
  3. bweb maps the Host header to a site and the path to a key, reads it from the node's gateway on loopback, and serves it with GET and HEAD.

The details, with sequence diagrams: docs/architecture.md.

Quickstart

About ten minutes on one Linux machine with Docker: a local chain, two hosts, two providers, a gateway, a site published with the AWS CLI, and bweb serving it.

examples/quickstart/quickstart.sh          # build, publish, serve, check, tear down
KEEP=1 examples/quickstart/quickstart.sh   # leave it running at http://127.0.0.1:8480

Walkthrough: docs/quickstart.md.

Install

Form Where
Binary each release: Linux and macOS, amd64 and arm64, with SHA256SUMS and the licenses in every tarball
Image ghcr.io/lightwebinc/bweb:<version> (distroless, non-root)
Source go build -o bin/bweb ./cmd/bweb (Go 1.27)
bin/bweb -config /etc/bweb/bweb.json

Documentation

Document For
Quickstart a site served end to end on one machine
Architecture the components, the read path, publishing, what comes next
Configuration every setting, with defaults and examples
HTTP behavior what a reader gets for each request
Operations deployment, the front server, sizing, the deny list, troubleshooting
The checker bweb check: verdicts on a site's servers for a renderer on the same node
Records the site, hosting terms, serving advertisement and outcome records, and how a host admits them (draft)
Performance measured read rates and where the limits are
Roadmap the steps after this one
Examples configurations, a sample site, systemd, Caddy and NGINX
Changelog what changed in each release

Develop

make verify     # gofmt, vet, go.mod tidy, third-party licenses, tests: what CI runs
make build      # bin/bweb
make docker-build

Report a vulnerability privately: SECURITY.md. Contributing: CONTRIBUTING.md. Licensed under the Apache License 2.0.

Directories

Path Synopsis
Package challenge is bweb's serving challenge (docs/spec.md section 7): a handful of ordinary reads of a site at a server's advertised address, each held to what the challenger's own store says the object is.
Package challenge is bweb's serving challenge (docs/spec.md section 7): a handful of ordinary reads of a site at a server's advertised address, each held to what the challenger's own store says the object is.
cmd
bweb command
Command bweb serves websites kept in bstore buckets over plain HTTP.
Command bweb serves websites kept in bstore buckets over plain HTTP.
probe command
Command probe sends sequences of reads to a store over one kept-alive connection and reports the first that is not answered in time.
Command probe sends sequences of reads to a store over one kept-alive connection and reports the first that is not answered in time.
internal
abuse
Package abuse is a web node's abuse reporting and enforcement, as an operator runs it on its own: signed reports arrive at the node, a report from a reporter the operator recognizes is applied to the deny list at once and any other waits for the operator, and every change to the list is appended to a log signed by the operator's key, naming the report it answers.
Package abuse is a web node's abuse reporting and enforcement, as an operator runs it on its own: signed reports arrive at the node, a report from a reporter the operator recognizes is applied to the deny list at once and any other waits for the operator, and every change to the list is appended to a log signed by the operator's key, naming the report it answers.
check
Package check is bweb's loopback checker, bweb check (docs/check.md): a small HTTP service on the node's own loopback that answers whether servers serve a site, for a program on the same node that must decide which addresses to hand out for it (bdns's renderer).
Package check is bweb's loopback checker, bweb check (docs/check.md): a small HTTP service on the node's own loopback that answers whether servers serve a site, for a program on the same node that must decide which addresses to hand out for it (bdns's renderer).
delegate
Package delegate is the owner's side of a site's delegation through borg (1bsv-ops docs/apps/bweb/design.md section 16.5): a site's owner names delegates as writers of the site's bucket, and its own service applies a delegate's entries only while borg allows the delegate the site's write permission.
Package delegate is the owner's side of a site's delegation through borg (1bsv-ops docs/apps/bweb/design.md section 16.5): a site's owner names delegates as writers of the site's bucket, and its own service applies a delegate's entries only while borg allows the delegate the site's write permission.
host
Package host is a web node's own side of the chain: the wallet that pays for what the node publishes, and the chain view it is funded and settled through.
Package host is a web node's own side of the chain: the wallet that pays for what the node publishes, and the chain view it is funded and settled through.
sitetest
Package sitetest builds bweb's transactions for tests: real keys, real signatures, each transaction mined in a block of its own against a stub header source.
Package sitetest builds bweb's transactions for tests: real keys, real signatures, each transaction mined in a block of its own against a stub header source.
web
Package web is the bweb server: a read-only HTTP face over sites kept in bstore buckets.
Package web is the bweb server: a read-only HTTP face over sites kept in bstore buckets.
Package module is bweb's overlay module, against bcommon's engine-neutral contract: tm_bweb_<site> for each site BWEB_SITES names, and ls_bweb for all of them.
Package module is bweb's overlay module, against bcommon's engine-neutral contract: tm_bweb_<site> for each site BWEB_SITES names, and ls_bweb for all of them.
Package siterec is bweb's record codec: the four records a site's topic carries (docs/spec.md).
Package siterec is bweb's record codec: the four records a site's topic carries (docs/spec.md).

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL