WeaveDocs
Weave Identity Ed25519

Usage

Using the Ed25519 identity adapter: DID format/parse, signing, verification, and builder APIs.

Purpose

Ed25519 identity adapter with DID formatting/parsing, permission callbacks, signing, verification, and builder APIs.

This page follows the real source shape for Weave Identity Ed25519 and explains the workflow a developer is likely to use first.

Developer workflow

Start from the smallest constructor or builder, perform one meaningful operation, inspect the returned state, then add the relevant policy, storage, or network integration. The examples below should be expanded whenever the crate API changes.

Primary types to know

  • Ed25519Adapter — adapters/ed25519/src/lib.rs
  • Ed25519AdapterBuilder — adapters/ed25519/src/lib.rs
  • Ed25519AdapterConfig — adapters/ed25519/src/lib.rs
  • Ed25519IdentityMetadata — adapters/ed25519/src/lib.rs

Example shape

use std::sync::Arc;
use weave_identity::WeaveIdentityAdapter;
use weave_identity_ed25519::Ed25519Adapter;

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let adapter: Arc<dyn WeaveIdentityAdapter> = Arc::new(Ed25519Adapter::new());
    let (did, _identity) = adapter.create_ao_identity("my-org").await?;

    println!("autonomous organization did: {did}");
    Ok(())
}