Skip to content

add SWIP-60: BPS singlehop — brokered broadcast pub/sub, base protocol - #104

Draft
zelig wants to merge 1 commit into
masterfrom
swip-60-bps-singlehop
Draft

add SWIP-60: BPS singlehop — brokered broadcast pub/sub, base protocol#104
zelig wants to merge 1 commit into
masterfrom
swip-60-bps-singlehop

Conversation

@zelig

@zelig zelig commented Aug 3, 2026

Copy link
Copy Markdown
Member

Base SWIP of the Broadcast Pub/Sub (BPS) family — the decomposition of the monolithic PubSub SWIP (#93) into work-package-sized SWIPs.

What it specifies: the smallest complete BPS protocol — one broker per topic, direct long-lived p2p streams, an explicit per-topic connection cap, SOC-only messages verified end-to-end. A cohort is fully described by a CohortSpec of genesis parameters; modes are parameter combinations, not an enum. Companion wire spec: assets/swip-60/bps.proto (singlehop concrete; multihop control frames reserved).

Deliberately out of scope (own SWIPs): multihop relaying/referral, reorganisation policies (SWATCH, SPORE), bandwidth incentives, broker discovery (SWIP-58 MEX, #103), history delivery, implicit-publisher event sourcing.

Relation to #93: this SWIP absorbs its Milestone 1 plus the mode system (reframed as genesis parameters); Milestone 3 was already extracted as SWIP-58 (#103). Implementation groundwork: bee #5435, bee-js #1151.

🤖 Generated with Claude Code

Base SWIP of the Broadcast Pub/Sub (BPS) family — the decomposition of the
monolithic PubSub SWIP (PR #93) into work-package-sized SWIPs. Companion
wire spec: assets/swip-60/bps.proto (singlehop concrete, multihop control
frames reserved).

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@zelig zelig mentioned this pull request Aug 3, 2026
@zelig zelig self-assigned this Aug 3, 2026

// What the topic binds to (see epic: "What does the topic bind to?").
enum TopicBinding {
TOPIC_BINDING_UNSPECIFIED = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this semantically mean? why is this a legitimate value that can be used?


// Who may author (see epic: genesis dimensions).
enum PublisherRegime {
PUBLISHER_REGIME_UNSPECIFIED = 0;

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this semantically mean? why is this a legitimate value that can be used?

TopicBinding binding = 2;
PublisherRegime publishers = 3;
bool history = 4; // deliver matching chunks from the local store
bytes admin = 5; // 20-byte eth address; set iff EXPLICIT_*

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if EXPLICIT_LIST is this then a concatenated list of ethereum keys?

EXPLICIT_SINGLE = 1; // opener is admin and sole publisher (live streaming)
EXPLICIT_LIST = 2; // admin dictates who the other publishers are
IMPLICIT = 3; // authorship implied by the topic binding (PO constraint)
ALL = 4; // every peer publishes (gossipsub-equivalent cohort)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why do we need this?

bool history = 4; // deliver matching chunks from the local store
bytes admin = 5; // 20-byte eth address; set iff EXPLICIT_*
uint32 po_min = 6; // proximity order for implicit bindings (default 16)
uint32 cap = 7; // max direct streams the broker accepts for this topic (0 = broker default)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why should a 3rd party be able to control the number of connections on a remote peer? what if the number is too large for the remote node to accept?

message Broadcast {
oneof frame {
Soc handshake = 1; // first frame on a stream: full SOC identity
DataFrame data = 2; // subsequent frames: signature ‖ span ‖ payload only

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

why split the same chunk to multiple messages? you're also overloading the protocol code to do the message sequencing/buffering/etc... seems really unnecessary. also if you assume just one stream per topic then essentially you're coercing the applications to manage multiple streams between the same two peers continuously - why not multiplex everything over the same stream?

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

while the single/multiple stream part is debatable, i'm not sure we need to skimp out on these few bytes that the chunk carries - it really doesn't save much, and then if we want to do single/multi stream management, we don't have to break the message format

oneof frame {
Soc handshake = 1; // first frame on a stream: full SOC identity
DataFrame data = 2; // subsequent frames: signature ‖ span ‖ payload only
Ping ping = 3; // keepalive; parent measures RTT off the echo

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

who needs this information? we already measure rtt using other means. not sure why this message is needed

Comment thread SWIPs/swip-60.md

## Out of scope (deliberately)

Multihop relaying and referral (bps-multihop), reorganisation policies (SWATCH, SPORE —

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would also add to this: remove multi-publisher setup from this iteration. it can be added later and just adds more review surface to deal with at this moment.

enum PublisherRegime {
PUBLISHER_REGIME_UNSPECIFIED = 0;
EXPLICIT_SINGLE = 1; // opener is admin and sole publisher (live streaming)
EXPLICIT_LIST = 2; // admin dictates who the other publishers are

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

i would get rid of this for a first iteration

// ---------------------------------------------------------------------------

// What the topic binds to (see epic: "What does the topic bind to?").
enum TopicBinding {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: i find this whole thing really confusing and not very approachable and i wonder if this even makes sense to do in a first iteration. "pubsub" is very dumb in this sense - it usually does not give you different topic semantics. here, a topic could have different semantics and input validation according to its "type" which makes for a much more complex API surfaces for users later on...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants