bstore

module
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Oct 6, 2026 License: Apache-2.0

README

bstore

License

Object storage as a market on Bitcoin. A publisher puts an object on the object plane once; every storage provider subscribed to the bucket receives the same bytes and competes to hold them. Readers speak S3.

How it works

  • Publish once, many providers. An object is a CHIRP (BRC-167) closure delivered to every provider on its bucket's blob topic, with a signed entry on the bucket's records topic. Providers advertise what they hold with ordinary UHRP (BRC-26) advertisements.
  • A bounty races the write. A publisher may commit a hold bounty that it pays, by rank, to the first providers to advertise and pass a challenge, with BRC-178's square-root split.
  • Anyone can buy time or proof. A renewal extends a provider's holding; a challenge samples 4 KiB segments chosen from a block hash, the buyer's nonce and the provider's key, and proves each into the object's proof root, about 5 KB per sample.
  • The bucket proves its own listing. The owner's chain of mined tokens commits to the whole key map, so a reader proves what a key names, that a key is absent and that a listing page is complete.
  • Incumbent UHRP hosts join unchanged through a bridge that speaks their HTTP routes.
  • Honest about limits. Availability is a market outcome, keys are not copies, and enforcement is reputation in this version.

Documentation

If you want to Read
Implement a compatible publisher, provider, host or reader docs/spec.md (the specification)
Know what cannot change once published docs/frozen.md
Use or check the codec and its golden vectors docs/codec.md
Run an overlay host that carries buckets docs/host.md
Run a storage provider docs/provider.md
Run the S3 gateway, and what S3 clients can and cannot do through it docs/s3.md
Own a bucket, put, read, judge a race, settle and challenge from the command line docs/usage.md

Building

cd host && npm ci && cd ..
make verify NODE=/path/to/node24
make module NODE=/path/to/node24   # host/bundle/bstore-module.js
go build ./cmd/bstore-provider     # the provider
go build ./cmd/bstore              # the command line, and bstore s3d, the S3 gateway

Go 1.27 and Node 24. docs/codec.md and docs/host.md say what each target checks.

Status

Contract signed: every row of docs/frozen.md is frozen, with clarifications C1 to C24 signed and C25 to C29 pending confirmation (section 14). The codec, in Go and TypeScript, its golden vectors, the overlay host module (tm_bstore_, tm_bstoreblob_ and ls_bstore), the storage provider (bstore-provider), the S3 gateway (bstore s3d) and the command line (bstore: the publisher client, which judges the hold race and settles bounties, and the owner's anchoring tooling) are built; the bridge for incumbent UHRP hosts comes next.

License

Apache License 2.0. See LICENSE.

Directories

Path Synopsis
Package auth104 is the server side of BRC-103 mutual authentication over HTTP (BRC-104), as a provider's routes need it: the handshake at /.well-known/auth, and each authenticated request checked and its answer signed, the way the SDK's clients (authhttp in Go, AuthFetch in TypeScript) send and check them.
Package auth104 is the server side of BRC-103 mutual authentication over HTTP (BRC-104), as a provider's routes need it: the handshake at /.well-known/auth, and each authenticated request checked and its answer signed, the way the SDK's clients (authhttp in Go, AuthFetch in TypeScript) send and check them.
Package backend is the hold-backend interface of spec section 17 and the native content-addressed backend on local disk.
Package backend is the hold-backend interface of spec section 17 and the native content-addressed backend on local disk.
cmd
bstore command
Command bstore is bstore's command line: the publisher client (spec sections 9 and 14), the bucket owner's tooling (sections 3.4 to 3.6 and 4.4), a verified reader (section 15) and the S3 gateway (`bstore s3d`, section 16).
Command bstore is bstore's command line: the publisher client (spec sections 9 and 14), the bucket owner's tooling (sections 3.4 to 3.6 and 4.4), a verified reader (section 15) and the S3 gateway (`bstore s3d`, section 16).
bstore-provider command
Command bstore-provider is a bstore storage provider: the market front of spec section 17 over the native content-addressed hold backend.
Command bstore-provider is a bstore storage provider: the market front of spec section 17 over the native content-addressed hold backend.
vectors command
Command vectors writes the golden vectors under testdata/vectors.
Command vectors writes the golden vectors under testdata/vectors.
internal
anchor
Package anchor is the bucket owner's tooling (spec sections 3.4 to 3.6 and 4.4): it creates a bucket chain, and anchors the entries of the owner and its writers into the chain's next tokens, exactly as frozen.
Package anchor is the bucket owner's tooling (spec sections 3.4 to 3.6 and 4.4): it creates a bucket chain, and anchors the entries of the owner and its writers into the chain's next tokens, exactly as frozen.
publish
Package publish is bstore's publisher (spec sections 5, 9, 13 and 14): it builds an object's CHIRP closure and proof root while the content streams (Store.Stage), mints a hold output when a bounty is asked for, makes the piece carriers and the entry, and delivers them over the plane, by unicast to the hosts and providers configured, or by BRC-167 upload session; it judges each bounty's race (race.go), settles it by rank or reclaims it after its deadline (settle.go), challenges providers (challenge.go), publishes outcome records, and sweeps its funding trees (sweep.go).
Package publish is bstore's publisher (spec sections 5, 9, 13 and 14): it builds an object's CHIRP closure and proof root while the content streams (Store.Stage), mints a hold output when a bounty is asked for, makes the piece carriers and the entry, and delivers them over the plane, by unicast to the hosts and providers configured, or by BRC-167 upload session; it judges each bounty's race (race.go), settles it by rank or reclaims it after its deadline (settle.go), challenges providers (challenge.go), publishes outcome records, and sweeps its funding trees (sweep.go).
reader
Package reader is a bstore reader (spec section 15): it asks the hosts it is given the free lookup questions of spec section 11.1, verifies every token, entry and advertisement against its own headers, proves what a key names, that a key is absent and that a listing page is complete against the chain's latest token, and reads an object's closure from its advertisers, every byte held to its hash before it is released.
Package reader is a bstore reader (spec section 15): it asks the hosts it is given the free lookup questions of spec section 11.1, verifies every token, entry and advertisement against its own headers, proves what a key names, that a key is absent and that a listing page is complete against the chain's latest token, and reads an object's closure from its advertisers, every byte held to its hash before it is released.
s3d
Package s3d is `bstore s3d`, the S3 gateway of spec section 16: a reader and a writer for clients that speak S3, authenticated with AWS Signature Version 4 in gateway mode.
Package s3d is `bstore s3d`, the S3 gateway of spec section 16: a reader and a writer for clients that speak S3, authenticated with AWS Signature Version 4 in gateway mode.
testwriter
Package testwriter is a minimal bstore writer for tests only: it funds itself from a local test chain's coinbase, builds an object's CHIRP closure, mints its piece carriers, a hold output and the entry, submits them, asks hosts for advertisements, challenges providers, verifies their signed responses as a buyer does (spec section 7.4), buys renewals, and settles a bounty by rank with BRC-29 outputs and remittances (spec section 9.5).
Package testwriter is a minimal bstore writer for tests only: it funds itself from a local test chain's coinbase, builds an object's CHIRP closure, mints its piece carriers, a hold output and the entry, submits them, asks hosts for advertisements, challenges providers, verifies their signed responses as a buyer does (spec section 7.4), buys renewals, and settles a bounty by rank with BRC-29 outputs and remittances (spec section 9.5).
vectors
Package vectors generates the golden vectors under testdata/vectors from the codec in storerec.
Package vectors generates the golden vectors under testdata/vectors from the codec in storerec.
Package provider is bstore-provider: the market front of spec section 17 over a hold backend.
Package provider is bstore-provider: the market front of spec section 17 over a hold backend.
Package storerec is the byte-level contract of bstore: the bucket record a mined token carries, the object entry, the piece, the outcome record and the front statement that ride unmined carriers, the challenge request and response, the hold terms, the key map and its contexts, the proof tree, settlement, BRC-26 advertisements, the names and lookup questions, the topic manager's transaction rules and a reader's checks that need no network.
Package storerec is the byte-level contract of bstore: the bucket record a mined token carries, the object entry, the piece, the outcome record and the front statement that ride unmined carriers, the challenge request and response, the hold terms, the key map and its contexts, the proof tree, settlement, BRC-26 advertisements, the names and lookup questions, the topic manager's transaction rules and a reader's checks that need no network.

Jump to

Keyboard shortcuts

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