bbox

module
v0.3.1 Latest Latest
Warning

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

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

README

bbox

License

A message box on Bitcoin, replicated by overlay hosts. A sender addresses an encrypted envelope to a recipient's identity key and a box; every host that carries the office holds it; the recipient lists its box from any host, verifies every envelope against block headers it checks itself, and acknowledges with a signed receipt that every host applies. A payment can travel inside an envelope, unbroadcast, for the recipient to internalize.

How it works

  • Envelopes are never mined. Each rides an unmined carrier transaction that spends one output of the sender's mined funding tree, so it verifies by SPV, it is bound to the sender's key, and the sender can retract it by spending that output.
  • Hosts are replicas, not authorities. A host can withhold an envelope; it cannot forge or alter one. Reading from several hosts shows a host that withholds.
  • Content is a BRC-169 envelope, encrypted to the recipient under BRC-78. Who wrote to whom, and when, is public; what was written is not.
  • Two ways to reach the hosts. On the multicast plane a publisher submits each object once and every subscribed host receives it; without it, the publisher submits to each host itself.
  • Reading is free. The base questions are free on every conforming host; a host may charge for history, never for the inbox, through a BRC-105 402 that the client pays and the host's payee settles.
  • Retraction is a mined sweep. A sender takes an envelope back by spending its funding output; honest hosts stop answering it. It is not erasure.

Documentation

If you want to Read
Try it on one machine in minutes, with no coin QUICKSTART.md
Understand it and use it day to day: concepts, sending, reading, paying, retracting, troubleshooting docs/user-guide.md
Look up a command, a flag, a setting or an exit code docs/usage.md
Implement a compatible sender, reader or host docs/spec.md (the specification)
Know what cannot change once published docs/frozen.md
Know the defaults and caps, and why each is set where it is docs/limits.md
Run a host: the module, its configuration, the terms route, settling, backups, metrics docs/host.md
Send and read bbox envelopes from another Go program docs/packages.md

Build and test

$ (cd host && npm ci)   # once
$ make verify           # gofmt, vet, dependency set, typecheck, vectors, tests
$ make vectors          # regenerate both vector sets
$ make module           # the host module, host/bundle/bbox-module.js
$ make bbox             # the command, bin/bbox
$ make e2e REFERENCE_HOST=/path/to/reference-host          # the module; needs Docker
$ make e2e-client REFERENCE_HOST=/path/to/reference-host   # the command on two hosts

Go 1.27.1 or later and Node 24; NODE=/path/to/node selects a Node 24 binary that is not on PATH. The golden vectors in testdata/vectors are generated by the Go codec (boxrec), and testdata/ts by the TypeScript codec in host/; each side's tests read the other's, byte for byte. Two direct Go dependencies, asserted by make verify: go-sdk at exactly v1.7.1 and bcommon, whose TypeScript package at the same version is vendored under host/vendor.

License

Apache 2.0; see LICENSE.

Directories

Path Synopsis
Package boxrec is the byte-level contract of bbox: the envelope record an envelope carrier holds, the receipt record a receipt carrier holds, the BRC-169 envelope a record's content is, the office and box name grammars, and the lookup question classes.
Package boxrec is the byte-level contract of bbox: the envelope record an envelope carrier holds, the receipt record a receipt carrier holds, the BRC-169 envelope a record's content is, the office and box name grammars, and the lookup question classes.
cmd
bbox command
Command bbox sends and reads bbox envelopes: a message box whose server is the set of overlay hosts that carry an office.
Command bbox sends and reads bbox envelopes: a message box whose server is the set of overlay hosts that carry an office.
devchain command
Command devchain is a local stand-in chain for trying bbox without a node, a settlement service or any coin: it serves a node's JSON-RPC (generatetoaddress, sendrawtransaction, getinfo) at /rpc, a node's asset API under /api/v1/, and a header source (/v1/root/<height>, /v1/tip) that the bbox command and the overlay hosts check proofs against.
Command devchain is a local stand-in chain for trying bbox without a node, a settlement service or any coin: it serves a node's JSON-RPC (generatetoaddress, sendrawtransaction, getinfo) at /rpc, a node's asset API under /api/v1/, and a header source (/v1/root/<height>, /v1/tip) that the bbox command and the overlay hosts check proofs against.
vectors command
Command vectors writes the golden vectors under testdata/vectors.
Command vectors writes the golden vectors under testdata/vectors.
internal
config
Package config resolves the bbox command's settings: flags, then BBOX_* in the environment, then the config file, then the built-in default.
Package config resolves the bbox command's settings: flags, then BBOX_* in the environment, then the config file, then the built-in default.
limits
Package limits holds the measurements behind docs/limits.md: carrier sizes on the plane for envelope contents and funding tree sizes, from real carriers minted with bcommon.
Package limits holds the measurements behind docs/limits.md: carrier sizes on the plane for envelope contents and funding tree sizes, from real carriers minted with bcommon.
state
Package state is an identity's durable record in its home: the funding trees its carriers spend, the trees signed and not yet adopted, the carriers persisted before they are published, what it sent and acknowledged, the sweeps it built, the envelopes it read and the payments it took.
Package state is an identity's durable record in its home: the funding trees its carriers spend, the trees signed and not yet adopted, the carriers persisted before they are published, what it sent and acknowledged, the sweeps it built, the envelopes it read and the payments it took.
testchain
Package testchain is the local stand-ins this module's tests run against: the shared chain, and this application's host.
Package testchain is the local stand-ins this module's tests run against: the shared chain, and this application's host.
unicast
Package unicast publishes objects to overlay hosts one by one, for a deployment with no multicast plane (spec section 9).
Package unicast publishes objects to overlay hosts one by one, for a deployment with no multicast plane (spec section 9).
vectors
Package vectors generates the golden vectors under testdata/vectors from the boxrec codec.
Package vectors generates the golden vectors under testdata/vectors from the boxrec codec.
Package reader asks overlay hosts the ls_bbox questions and checks every answer itself (docs/spec.md sections 7.2, 9 and 13): the carrier's rules and content rules (the admission rules a host applies), SPV of the carrier through its funding parent against the reader's own headers, and the record's office and recipient.
Package reader asks overlay hosts the ls_bbox questions and checks every answer itself (docs/spec.md sections 7.2, 9 and 13): the carrier's rules and content rules (the admission rules a host applies), SPV of the carrier through its funding parent against the reader's own headers, and the record's office and recipient.
Package send is a bbox publisher: it seals envelopes, acknowledges them with receipts and retracts them with sweeps (docs/spec.md sections 3 to 6 and 9), from one identity's home.
Package send is a bbox publisher: it seals envelopes, acknowledges them with receipts and retracts them with sweeps (docs/spec.md sections 3 to 6 and 9), from one identity's home.

Jump to

Keyboard shortcuts

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