Skip to content

Bendy Butt (BB) metafeed format for Secure Scuttlebutt (SSB)

Notifications You must be signed in to change notification settings

ssbc/ssb-bendy-butt-rs

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

ssb-bendy-butt-rs

Bendy Butt (BB) metafeed format for Secure Scuttlebutt (SSB).

Based on the JavaScript reference implementation: ssb-bendy-butt (written according to the specification).

Data Types

Before a message can be encoded it must first be constructed using the provided data types. The top-level type, expected as input by the encoder, is a Msg struct (provided by this library). It is up to the library user to instantiate this type with the desired message data. All fields are required.

pub struct Msg {
    previous: String,
    author: String,
    sequence: i32,
    timestamp: i64,
    signature: String,
    content: Content,
}

Content is an enum with variants catering for a private message (encrypted String type) or a FeedData struct. These types must be instantiated before the construction of the top-level Msg type.

pub enum Content {
    // encrypted message (box2)
    Private(String),
    Feed(FeedData, String),
}

pub struct FeedData {
    feed_type: String,
    subfeed: String,
    metafeed: String,
    nonce: String,
    // WIP: more fields will be added here
}

Encode

The encoder expects a message in the form of a Msg struct (defined above). The encoded value is returned as a Bencoded vector of bytes. Message fields (excluding sequence and timestamp) are encoded as BFE values before Bencoding.

Decode

The decoder expects a message in the form of a byte vector (Vec<u8>). The decoded value is returned as a Msg struct.

Documentation

Use cargo doc to generate and serve the Rust documentation for this library:

git clone git@github.com:ssb-ngi-pointer/ssb-bendy-butt-rs.git
cd ssb-bendy-butt-rs
cargo doc --no-deps --open

License

LGPL-3.0.

About

Bendy Butt (BB) metafeed format for Secure Scuttlebutt (SSB)

Resources

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages