The rust implementation of IPLD schemas and some associated functionalities.

Overview

Linked Data

IPLD schemas and what to do with them.

Beacon

Directory of user content and metadata. Since this object should not change it can be used as a unique identifier. Always resolve the IPNS address to get the most up to date content. If using IPNS over PubSub, you can also subscribe to a IPNS topic for live update. Use friend list to crawl the social web.

IPLD Schemas

type Beacon struct {
    identity IPNS
    content_feed optional IPNS
    comments optional IPNS
    live optional IPNS
    friends optional IPNS
    bans optional IPNS
    mods optional IPNS
}

type IPNS string # IPNS address

Identity

A user name and avatar.

IPLD Schemas

type Identity struct {
    display_name String # Your choosen name
    avatar Link # Link to an image
}

Content Feed

An anchor for a user's content. Chronological order is used. Other indexing methods could be used.

IPLD Schemas

type FeedAnchor struct {
    content [Media]
}

type Media union {
    | &MicroPost link
    | &FullPost link
    | &VideoMetadata link
} representation kinded

Comments

An anchor for a user's comments. Indexed by the content they commented on. Other indexing methods could be used.

IPLD Schemas

type Commentary struct {
    "comments": {String:[&Comment]} # Keys are CIDs of the content being commented on.
}

type Comment struct {
    timestamp Int # Unix Time
    origin Link # CID of content being commented on.
    comment String
}

Friends

A list of friends you follow.

IPLD Schemas

type Friendlies struct {
  friends [Friend] 
}

type Friend union {
    | ENS string # ENS domain name linked to Beacon
    | Beacon link # Link to Beacon
} representation kinded

type ENS string
type Beacon link

Chat Moderation

Moderator can send ban/mod messages via PubSub. The message should be signed. The schemas are list of banned users and moderators.

IPLD Schemas

type ETHAddress bytes # Ethereum address are 20 bytes.

type Bans struct {
    banned_addrs [ETHAddress]
}

type Moderators struct {
    moderator_addrs [ETHAddress]
}

Chat

Display Name and GossipSub Peer ID are signed using Ethereum Keys then the address, name, id, and signature are added to IPFS returning a CID. When receiving a pubsub message this CID is used to fetch and verify that IDs matches and signature is correct.

IPLD Schemas

type Text string

type Ban struct {
    ban_peer String
    ban_addrs ETHAddress
}

type Moderator struct {
    mod_peer String
    mod_addrs ETHAddress
}

type MessageType union {
    | Text string
    | Ban map   # ETH address and peer Id of the person to ban.
    | Moderator map # The ETH address and peer Id of the new moderator.
} representation kinded

type ChatID struct {
    peer_id String
    name String
}

type SignedMessage {
    address ETHAddress

    data ChatID

    signature Bytes # 65 bytes
}

type ChatMessage struct {
    message MessageType

    signature &SignedMessage
}

Streams

A video node contains links to segments of videos of all quality. As video is streamed, new video nodes are created and linked to previous ones. A special node contains the stream setup data; codecs, qualities, initialization segments, etc...

IPLD Schemas

type VideoNode struct {
    tracks {String:Link} # Name of the track egg "audio" or "1080p60" & link to video segment data
    setup optional &SetupNode
    previous optional &VideoNode
}

type SetupNode struct {
    tracks [Track] # Sorted from lowest to highest bitrate.
}

type Track struct {
    name String
    codec String #Mime type
    init_seg Link # Link to the initialization segment data
    bandwidth Int
}

Videos

Timecode nodes are created at specific intervals and linked together to form a structure around the video allowing it to be addressable by timecode. Video clips are subgraph of the whole.

IPLD Schemas

type VideoMetadata struct {
    timestamp Int # Unix time
    duration Float
    image Link # Poster & Thumbnail
    video &TimeCodeNode
    title String
}

type TimeCodeNode struct {
    time &DayNode
}

type DayNode struct {
    hour [&HourNode]
}

type HourNode struct {
    minute [&MinuteNode]
}

type MinuteNode struct {
    second [&SecondNode]
}

type SecondNode struct {
    video &VideoNode
    chat [&ChatMessage]
}

Blog

Micro-blogging & long form via markdown files.

IPLD Schemas

type MicroPost struct {
    timestamp Int # Unix Time
    content String
}

type FullPost struct {
    timestamp Int # Unix Time
    content Link # Link to markdown file
    image Link
    title String
}

License

Licensed under either of

at your option.

Contribution

Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.

You might also like...
An implementation of the SMP protocol as used in zephyr, mcuboot, mcumgr, and more.

SMP An implementation of the SMP protocol in pure Rust. This repository contains: ./mcumgr-smp: A SMP library implementation to be used in your own pr

Async implementation of the StatusNotifierItem and DbusMenu protocols for building system trays.

System Tray An async implementation of the StatusNotifierItem and DbusMenu protocols for building system trays. Requires Tokio. Example use system_tra

Rust implementation of the legacy Master Server Query Protocol

msq-rs Rust library implementation of the legacy Master Server Query Protocol. Documentation crates.io Repository Release Notes Usage Add this to your

🦀 Rust-based implementation of a Snowflake Generator which communicates using gRPC

Clawflake Clawflake is a Rust application which implements Twitter Snowflakes and communicates using gRPC. Snowflake ID numbers are 63 bits integers s

Re-implementation of Panda Doodle in Rust targetting WASM, a mobile game originally written in C++

Description This is the source code of my game Panda Doodle, which can be played at https://pandadoodle.lucamoller.com/ (it's best playable on touch s

2D Predictive-Corrective Smoothed Particle Hydrodynamics (SPH) implementation in Rust with WASM + WebGL

pcisph-wasm 2D Predictive-Corrective Smoothed Particle Hydrodynamics (SPH) implementation in Rust with WASM + WebGL Reimplementation of my previous Ru

A Rust implementation of fractional indexing.
A Rust implementation of fractional indexing.

fractional_index This crate implements fractional indexing, a term coined by Figma in their blog post Realtime Editing of Ordered Sequences. Specifica

Pure rust implementation of jq

XQ JQ reimplemented purely in Rust. Caution This program is under development. You probably want to use the original implementation of jq, or pure Go

A pure Rust PLONK implementation using arkworks as a backend.

PLONK This is a pure Rust implementation of the PLONK zk proving system Usage use ark_plonk::prelude::*; use ark_ec::bls12::Bls12; use rand_core::OsRn

Owner
Defluencer
Decentralized social media protocol
Defluencer
An extended CW721 (v0.9.2) with update, burn, freeze, set_minter functionalities.

Extended CW721 Extended CW721 NFT with update, burn, freeze, set_minter functionalities

null 12 Oct 1, 2022
A lending iterator trait based on generic associated types and higher-rank trait bounds

A lending iterator trait based on higher-rank trait bounds (HRTBs) A lending iterator is an iterator which lends mutable borrows to the items it retur

Sebastiano Vigna 6 Oct 23, 2023
A balanced unbounded interval-tree in Rust with associated values in the nodes

store-interval-tree A balanced unbounded interval-tree in Rust with associated values in the nodes. Based on rudac and bio. Example use store_interval

Andrea Fioraldi 3 Nov 22, 2022
File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files.

FTZZ File Tree Fuzzer allows you to create a pseudo-random directory hierarchy filled with some number of files. Installation $ cargo +nightly install

Alex Saveau 22 Dec 28, 2022
Replay git history with some tweaks

Git-replay Overview Git-replay is a simple tool that replays the history of a Git repository but with some tweaks (i.e., it can change the author name

Tak-gun Na 3 Mar 22, 2022
Ditch your status bar for some snazzy desktop notifications.

citron Ditch your panel for some snazzy desktop notifications. citron is: a non-intrusive alternative to status bars. on-demand, i.e. does not run in

Aziz Ben Ali 1 Jan 11, 2022
Programming language just for fun, will kill LUA some day.

Loom Programming language just for fun, will kill LUA some day. Currently development of this language is algorithm driven. I'm trying to implement va

Mateusz Russak 5 Dec 4, 2023
Svix - A pure Rust and fully tested KSUID implementation

Svix - Webhooks as a service Svix-KSUID (Rust) A pure Rust and fully tested KSUID implementation This library is fully compatible with Segment's KSUID

Svix 48 Jan 3, 2023
untyped-arena provides an Arena allocator implementation that is safe and untyped with minimal complexity

untyped-arena untyped-arena provides an Arena allocator implementation that is safe and untyped with minimal complexity Usage let arena = Arena::new()

Max Bruce 1 Jan 9, 2022
Implementation of "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism"

Implementation of "Complete and Easy Bidirectional Typechecking for Higher-Rank Polymorphism" See arXiv:1306.6032 This implementation focusses on read

Jakob Demler 95 Dec 20, 2022