qudag-dag 0.1.0

DAG consensus implementation for QuDAG - QR-Avalanche algorithm with Byzantine fault tolerance
Documentation

DAG consensus implementation with QR-Avalanche algorithm.

This module provides the core DAG (Directed Acyclic Graph) implementation with quantum-resistant consensus using a modified Avalanche protocol.

Key Types

  • [QrDag] - Main DAG consensus implementation (alias for DAGConsensus)
  • [Vertex] / [VertexId] - DAG vertices and their identifiers
  • [Consensus] / [QRAvalanche] - Consensus algorithms and implementations
  • [Graph] - High-performance graph data structure with caching
  • [Node] - Node representation with state management
  • [TipSelection] - Algorithms for choosing vertices to extend

Example Usage

use qudag_dag::{QrDag, Vertex, VertexId, ConsensusConfig};
use std::collections::HashSet;

// Create a new DAG consensus instance
let mut dag = QrDag::new();

// Add a message to the DAG
let message = b"Hello, DAG!".to_vec();
dag.add_message(message.clone()).expect("Failed to add message");

// Check if the message exists
assert!(dag.contains_message(&message));

// Get current tips
let tips = dag.get_tips();
println!("Current tips: {:?}", tips);

// Create a vertex directly
let vertex_id = VertexId::new();
let vertex = Vertex::new(vertex_id, b"vertex data".to_vec(), HashSet::new());
dag.add_vertex(vertex).expect("Failed to add vertex");