gbp-node
GBP-layer group node for the Group Protocol Stack.
This is the IP-like substrate that the three sub-protocol crates
(gtp-protocol, gap-protocol, gsp-protocol) build on. It owns the
framing, AEAD, replay window, FSM and control plane.
What this crate provides
GroupNode— the core node type. Callbootstrap_as_creatororbootstrap_as_joineronce after MLS welcome, then pipe every inbound wire frame throughon_wireand route the resultingEvents to sub-protocol clients.OutboundFrame— a wire-ready(to, wire)pair returned by every send helper.DeliveredPayload— decrypted plaintext +stream_type,stream_id,sequence_no,flags, andcodecsurfaced to sub-protocols viaEvent::PayloadReceived.Event— all events emitted by the node:StateChanged,PayloadReceived,Control,Error,EpochAdvanced,CoordinatorElectionNeeded,BecameCoordinator,CoordinatorClaim.
Example
use ;
// After MLS two-party handshake (alice invites bob):
let gid = alice_mls.group_id_16;
let mut alice = new;
let mut bob = new;
alice.bootstrap_as_creator; // epoch 0
bob.bootstrap_as_joiner; // epoch 0, expect tid=1
// Apply epoch-1 transition.
let exec = alice.send_control?;
alice.apply_transition;
bob.on_wire?;
// Send a text message via GTP.
let mut gtp_alice = new;
let mut gtp_bob = new;
let frame = gtp_alice.send?;
for event in bob.on_wire?
See crates/gbp/stack/examples/ for fully-runnable examples
covering GTP, GAP and GSP.
License
Licensed under Apache License, Version 2.0.