Releases: block-xaero/XaeroID
Xaero ID: A did:peer with dead simple zk proof model
- simplified did:peer to utterly simple, iroh friendly PublicKey model.
- zk proofs from arkworks were too complex, for now we use hash commitments, need to explore ZkVM to do this better for future.
XaeroID Cache sized added
cache added for xaero ids for compact reference.
Xaero ID tag with blake 3 hashing
This allows for stack friendly linear scan memory layout based (fixed sizes) Xaero ID cache to avoid overheating memory with tons of xaero ids if peers increase in a typical p2p application where hundreds of new peers or existing peers are collaborating on different workspaces in a group (see xaeroflux for details on Groups, Workspace, Object hierarchy)
Rusted Ring update: Backpressured Readers
Rusted Ring lib added backpressured readers which could be useful for xaero id pooling.
Patch update: unused imports removed
0.3.1-rc3 Release candidate 3 with unused imports
Pooling for Xaero IDs
We use a pre-allocated, stack based pooling mechanism using
https://github.com/block-xaero/rusted-ring
to effectively pre-allocate xaero_ids and re-use the slots to save space for any dApps being built on XaeroID.
[0.3.0-rc3]
Added
Ring Buffer Memory Pool Integration
- XaeroIDPoolManager - High-performance ring buffer allocation for XaeroID instances
- Ring buffer pooling using rusted-ring crate for zero-allocation identity management
- Memory pool sizing with automatic size estimation (XaeroID fits in L pool: 4096 bytes)
- Pool error handling with dedicated PoolError enum for allocation failures
- Zero-copy access to pooled XaeroID instances via RingPtr smart pointers
- Thread-safe allocation using static EventAllocator reference
- Device-aware optimization support for mobile/tablet/desktop memory constraints
Memory Management Features
- RingPtr smart pointer for reference-counted XaeroID access
- Automatic pool selection based on XaeroID size (~2453 bytes → L pool)
- Type-safe transmutation from RingPtr<PooledEvent> to RingPtr
- From<PooledEvent> trait implementation for XaeroID deserialization
- bytemuck integration for Pod-safe serialization to/from ring buffer storage
- Stack overflow protection with 16MB stack requirement for test environments
Performance Optimizations
- Zero heap allocation for XaeroID storage in high-frequency scenarios
- Predictable memory usage through pre-allocated ring buffer pools
- Reference counting enables efficient XaeroID sharing across components
- Cache-friendly access patterns via sequential ring buffer layout
- Reduced GC pressure by eliminating frequent XaeroID allocations/deallocations
P2P Integration Preparedness
- Bandwidth optimization support for network protocols (store author_id as RingPtr)
- Peer identity caching with ring buffer-backed XaeroID storage
- Memory-efficient gossip protocols through shared XaeroID references
- Scalable peer management with bounded memory usage via ring buffer pools
Technical Implementation
Ring Buffer Architecture
- Pool allocation strategy: Automatic sizing from XS (64B) to XL (16KB) pools
- XaeroID pool placement: L pool (4096 bytes) with ~1643 bytes padding efficiency
- Memory layout preservation: Pod-safe structures maintain deterministic layout
- Reference counting: Atomic operations for thread-safe XaeroID sharing
- Type safety: Compile-time guarantees for pool size compatibility
Integration Points
- rusted-ring dependency: EventAllocator integration for ring buffer management
- Stack size requirements: 16MB minimum for ring buffer initialization in tests
- Device compatibility: Configurable pool sizes for iOS/Android/Desktop platforms
- FFI readiness: Prepared for Dart/Flutter integration via C-compatible interfaces
Test Coverage
- Basic allocation/retrieval: XaeroID round-trip through ring buffer pools
- Data integrity verification: Byte-level equality after pool storage
- Reference counting validation: Multiple RingPtr instances sharing same data
- Concurrent access testing: Multi-threaded allocation and access patterns
- Memory layout verification: Size and alignment assumptions validation
- Pool error handling: Allocation failure scenarios and error propagation
Dependencies
New Dependencies
rusted-ring- Custom ring buffer implementation with smart pointer semanticsthiserror^2.0 - Enhanced error handling for pool allocation failures
Updated Test Requirements
- Stack size: 16MB minimum for test execution (RUST_MIN_STACK=16777216)
- Memory constraints: Device-aware testing for mobile platform compatibility
Breaking Changes
API Additions (Non-breaking)
- All existing XaeroID APIs remain unchanged
- New pooling functionality is additive and optional
- Backward compatibility maintained for all identity operations
Known Limitations
Memory Requirements
- Initialization stack: 16MB minimum for ring buffer allocation
- Pool exhaustion: No graceful degradation when ring buffer pools are full
- Device scaling: Pool sizes need manual tuning for optimal mobile performance
Testing Environment
- Stack overflow risk: Tests require RUST_MIN_STACK=16777216 environment variable
- CI/CD requirements: Build systems must configure larger stack sizes for test runs
Future Roadmap
Performance Enhancements
- Pool size auto-tuning: Dynamic pool sizing based on runtime usage patterns
- Heap fallback: Graceful degradation to heap allocation when pools exhausted
- Memory pressure handling: Advanced pool management for constrained environments
Platform Optimization
- iOS/Android optimization: Device-specific pool sizing and initialization strategies
- WASM compatibility: Ring buffer adaptation for WebAssembly environments
- Embedded support: Ultra-low memory footprint variants for IoT devices
Migration Guide
For Existing Users
No code changes required - all existing XaeroID functionality remains identical.
For Performance-Critical Applications
use xaeroid::pool::{XaeroIDPoolManager, PoolError};
// Initialize pool manager (requires 16MB stack)
let pool_manager = XaeroIDPoolManager::new(allocator);
// Allocate XaeroID in ring buffer (zero heap allocation)
let ring_ptr = pool_manager.allocate_xaero_id(xaero_id)?;
// Access XaeroID (zero-copy)
let retrieved_id = &*ring_ptr;
// Share across components (reference counting)
let shared_ptr = ring_ptr.clone();For Test Environments
# Required for running tests
RUST_MIN_STACK=16777216 cargo test
# Or add to .cargo/config.toml
[env]
RUST_MIN_STACK = "16777216"Rkyv support for XaeroID primitives
rkyv support (previously only supported as Pod type from bytemuck)
Patch release: XaeroID support for Eq, Hash
v0.2.1-rc1 Release 0.2.1-rc1
v0.2.0-rc1
Outline of a xaero wallet that combines:
- did:peer with falcon signed / quantum safe security.
- zk proofs (arkworks based)
packaged with a trait store/sink that can be used to store wallet data in a safe eventful way. Highly useful when packaged with Xaeroflux which is a paged mmap'd event p2p offline first db/store powering dApps.
ZK Proof Arkworks Circuit structure
Working Arkworks circuitry