beefcat

module
v0.2.2 Latest Latest
Warning

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

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

README

beefcat

CI Release Go Reference Go version License

[!WARNING] Experimental software. beefcat builds on bstack. It is published to be built on and improved. Interfaces, formats and behavior may change rapidly between releases; pin an exact version.

netcat for the BEEF data carrier, with SPV.

Any bytes in, sent to an address and port, and the far end proves three things about them before it writes one: the bytes are exactly what was sent, a named key signed them, and that key had postage mined on the BSV blockchain. The proof travels with the data. The receiver needs nothing but block headers, from a source it chooses, and the proof is as strong as that source: see how far the header check goes.

receiver$ beefcat -l 9000 -k 03c1873f...9911c982 > received.bin
sender$   beefcat receiver.example.com 9000 < file.bin
beefcat: VERIFIED 5 carrier(s), 20000000 bytes in 596ms
  sender      03c1873f...9911c982 (pinned with -k)
  postage     funding transaction f67988ab...08ef1cce, mined at height 975787
  headers     woc:main

That is a real run on mainnet; docs/walkthrough.md has all of it.

The data is never mined. Each chunk rides a carrier: a signed transaction built so that it cannot be mined, spending one output of a transaction that was. That mined output is the postage; the carrier and its Merkle path, in one BEEF envelope, are the proof.

Postage is a setup cost, not a fee per message. beefcat spends one funded output per carrier and never spends one twice, and enough of them for a gigabyte costs about 1,800 satoshis in miner fees. But a carrier is never mined, so nothing on the chain records that an output was used: the same stream can go to any number of receivers at no further cost. A receiver that must take a stream only once keeps its own record of the outputs it accepted (-seen), and one that wants recent postage limits its age (-max-age); both are off unless asked for. What the proof shows is that the sender's key paid to exist on the chain, not what any one message cost.

The proof is of a transaction that was mined, not of outputs that are still unspent. A sender retracts by spending them, and a receiver sees that only if it asks: -unspent.

It is loud when it should be

beefcat exists to tell you when data should not be believed, so it does not whisper. Each of these stops the stream, writes nothing of the carrier that failed, prints a banner, and exits nonzero:

What happened Code Exit
Data altered, or signed by someone else REFUSED-SIG, REFUSED-DECODE 3
A sender claiming a key that is not theirs REFUSED-KEY-DERIVE 3
Postage not on your chain, never mined, or spent twice REFUSED-BUMP, REFUSED-FORK 3
Stream cut short, reordered, spliced or appended to REFUSED-TRUNCATED, REFUSED-SEQ 3
A transaction that could be mined, passed off as a carrier REFUSED-MINEABLE 3
Data its sender retracted (with -unspent) REFUSED-RETRACTED 3
Postage older than you allow, or not deep enough (with -max-age, -min-conf) REFUSED-STALE 3
A stream this receiver took before (with -seen) REFUSED-REPLAY 3
Verified, but not from a sender you pinned REFUSED-UNTRUSTED 4
The header source did not answer: no verdict ERROR 1

A stream that verifies from a sender you did not pin is written, with a warning as loud as a refusal: anyone with a funded key can send data that verifies, so pin the key you expect with -k.

Start here

To Read
Try it in two minutes on one machine, with no coin QUICKSTART.md
Send on mainnet QUICKSTART.md
See a real run on mainnet, with every refusal docs/walkthrough.md
See it on the wire: a packet capture with every byte named docs/capture.md
Every command and flag, costs and limits docs/usage.md
What is checked, in what order, and what SPV cannot tell you docs/verification.md
The formats that never change docs/frozen.md
Why it is built this way docs/design.md

Install

$ go install github.com/lightwebinc/beefcat/cmd/beefcat@latest

or take a release tarball. A receiver needs only the binary. A sender also needs a home (beefcat init) and postage (beefcat fund).

License

Apache-2.0: see LICENSE, NOTICE and LICENSE-THIRD-PARTY.

Directories

Path Synopsis
cmd
beefcat command
Command beefcat is netcat for the BEEF data carrier: any bytes in, sent to an address and port as signed, unmineable carriers, and verified by SPV at the far end before a byte of them is written.
Command beefcat is netcat for the BEEF data carrier: any bytes in, sent to an address and port as signed, unmineable carriers, and verified by SPV at the far end before a byte of them is written.
devchain command
Command devchain is a local stand-in chain for trying beefcat without a node, a settlement service or any coin: bcommon devkit's devchain (a node's JSON-RPC at /rpc, its asset API under /api/v1/ and a header source at /v1/root/<height> and /v1/tip, every transaction mined at once).
Command devchain is a local stand-in chain for trying beefcat without a node, a settlement service or any coin: bcommon devkit's devchain (a node's JSON-RPC at /rpc, its asset API under /api/v1/ and a header source at /v1/root/<height> and /v1/tip, every transaction mined at once).
internal
home
Package home is a sender's directory: its identity and coin pool (bcommon's bwallet), its settings, and the funding trees its carriers spend from.
Package home is a sender's directory: its identity and coin pool (bcommon's bwallet), its settings, and the funding trees its carriers spend from.
peerpay
Package peerpay delivers a BRC-29 payment to its recipient the way PeerPay does: the payment token, encrypted to the recipient, put in the recipient's payment_inbox at a message box server (BRC-33).
Package peerpay delivers a BRC-29 payment to its recipient the way PeerPay does: the payment token, encrypted to the recipient, put in the recipient's payment_inbox at a message box server (BRC-33).
seen
Package seen is a receiver's memory of the funding outputs it has accepted carriers on: an append-only file of fixed records, read into a map when it is opened.
Package seen is a receiver's memory of the funding outputs it has accepted carriers on: an append-only file of fixed records, read into a map when it is opened.
Package recv is beefcat's far end: it reads a stream of carriers and writes a carrier's data only after that carrier has passed every check.
Package recv is beefcat's far end: it reads a stream of carriers and writes a carrier's data only after that carrier has passed every check.
Package send is beefcat's near end: it cuts a stream of bytes into carriers, each spending one mined funding output of the home's, and writes them as frames.
Package send is beefcat's near end: it cuts a stream of bytes into carriers, each spending one mined funding output of the home's, and writes them as frames.
Package wire is everything beefcat freezes at its first release: the key derivation, the funding tag, the signed payload header every carrier holds, and the framing of a stream of carriers (docs/frozen.md).
Package wire is everything beefcat freezes at its first release: the key derivation, the funding tag, the signed payload header every carrier holds, and the framing of a stream of carriers (docs/frozen.md).

Jump to

Keyboard shortcuts

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