Weave documentation
Woven

dSocial

Typed social event bodies and signing helpers without automatic feeds or identity lookup.

woven::dsocial provides Profile, Post, Reply, Follow and Reaction bodies. Their sign helpers produce WOVEN events; parse interprets a matching event body. They do not upload attachment URLs, resolve authors, grant capabilities or broadcast events. The fixed seed below is a public deterministic fixture for this example, never a production identity.

This example is checked against source signatures; it was not compiled or run during this documentation pass.

use woven::dsocial::{Follow, Post, Profile, Reaction};
use woven::SpaceId;

fn main() -> Result<(), Box<dyn std::error::Error>> {
    let keypair = weave_crypto::key_pair(Some(&[7u8; 32]));
    let space = SpaceId::new("woven://dsocial/global")?;
    let author = "did:l1fe:agent:alice";
    let created_at = 1_777_130_000;

    // Each dSocial body has a typed builder and a strongly-typed event KIND.
    let profile_event = Profile::new("Alice")
        .bio("agent-curious")
        .avatar("locus://avatars/alice.png")
        .sign(author, space.clone(), created_at, &keypair)?;

    let post_event = Post::new("hello p2p web")
        .attachment("locus://posts/alice/cover.png")
        .sign(author, space.clone(), created_at + 1, &keypair)?;

    let follow_event = Follow::new("did:l1fe:agent:bob")
        .sign(author, space.clone(), created_at + 2, &keypair)?;

    let reaction_event = Reaction::new(post_event.id().clone(), "+")
        .sign(author, space, created_at + 3, &keypair)?;

    println!(
        "profile kind={} post kind={} follow kind={} reaction kind={}",
        profile_event.kind(),
        post_event.kind(),
        follow_event.kind(),
        reaction_event.kind(),
    );
    Ok(())
}

Source declarations