Skip to content

Monorepo for ICN core Rust crates: common, identity, DAG, mesh, runtime, protocol, governance, economics, network, API & CLI

License

Notifications You must be signed in to change notification settings

InterCooperative-Network/icn-core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

ICN Core v0.2 – Advanced Cooperative Infrastructure Development

⚠️ DEVELOPMENT STATUS: This project has substantial working implementations but is NOT production ready

ICN Core is the advanced development reference implementation of the InterCooperative Network (ICN) protocol, written in Rust with comprehensive frontend applications. It provides working cooperative infrastructure for federations, cooperatives, and communities with substantial functionality, but requires security review and production hardening.

Mission: Replace every major function of the state and corporation with programmable, federated, democratic infrastructureβ€”built for actual human needs and scalable solidarity.

Current Status: This is advanced development software with substantial working implementations. While it demonstrates real P2P networking, cross-node job execution, governance/economic systems, and end-to-end workflows, it should NOT be used in production environments without security review.

🚧 Development Status Warning

IMPORTANT: ICN Core has substantial working functionality but critical production readiness gaps:

  • Security Review Needed: Cryptographic implementations require professional security audit
  • Production Hardening: Monitoring, error recovery, and operational procedures need development
  • Scale Testing: Works in development, needs validation at production scale
  • API Stability: APIs and data formats may change during development
  • Operational Excellence: Production deployment procedures incomplete

Use for:

  • Development and testing of cooperative infrastructure
  • Research and experimentation with federated governance
  • Contributing to the development of cooperative digital infrastructure
  • Learning about distributed systems and cooperative technology

DO NOT use for:

  • Production applications without security review
  • Real economic transactions without audit
  • Critical governance decisions without testing
  • Any system where data loss or security issues would cause harm

πŸš€ Quick Start

Try ICN in 10 Minutes (Development)

# Clone and build
git clone https://github.com/InterCooperative/icn-core
cd icn-core
just setup && just build

# Start a development node
cargo run --bin icn-node

# In another terminal, try the CLI
cargo run --bin icn-cli -- info

Start Frontend Applications

# Setup frontend development environment
just setup-frontend

# Start all frontend apps
just dev-frontend

# Or start specific apps
just dev-web-ui     # Federation dashboard
just dev-explorer   # Network explorer  
just dev-agoranet   # Governance interface
just dev-wallet     # DID/key management

Next Steps: Complete Getting Started Guide

Documentation Hub πŸ“š

πŸ“– Documentation Index - Quick navigation guide
πŸ“š Complete Documentation - Full documentation directory
πŸ“Š Project Status & Roadmap - Current implementation status and development roadmap
πŸ—οΈ Architecture Guide - System design and component overview
πŸ”— Complete API Reference - All 60+ HTTP endpoints


🎯 What ICN Provides (Current Implementation Status)

Advanced Development Platform (Substantial Working Implementation)

βœ… CCL WASM Compilation & Execution - Complete pipeline from CCL source to WASM execution
βœ… Multi-backend Persistence - PostgreSQL, RocksDB, SQLite, Sled all operational
βœ… P2P Networking - libp2p with gossipsub and Kademlia DHT working
βœ… Governance Workflows - Proposals, ranked choice voting, budget allocation functional
βœ… Economic Systems - Mana ledgers, resource tokens, mutual credit working
βœ… Mesh Computing - End-to-end job submission, bidding, execution, receipt generation
βœ… Identity Management - DID creation, credential verification, signing operational
βœ… Frontend Applications - UI components connecting to real backend APIs

Production Readiness Gaps (Security & Operational)

⚠️ Security Review - Cryptographic implementations need professional audit
⚠️ Scale Testing - Works in development, needs validation at production scale
⚠️ Monitoring - Comprehensive observability and alerting systems needed
⚠️ Error Recovery - Robust error handling and automatic recovery procedures needed
⚠️ Documentation - Implementation has outpaced documentation in many areas

Development Capabilities (What's Demonstrable)

  • Multi-node Development: Containerized devnet with real P2P networking
  • Real API Integration: HTTP server with working endpoints (not just mocks)
  • Database Integration: Multiple storage backends with real persistence
  • Frontend Development: Working UI applications with backend integration
  • CLI Tooling: Command-line interface with functional operations
  • Configuration System: Service configuration for different deployment scenarios

Working System Demonstrations

ICN includes substantial working implementations for:

  • Cooperative Governance: Real proposal creation, voting, and execution
  • Economic Coordination: Mana-based resource management with persistent accounting
  • Identity Systems: DID-based authentication with credential verification
  • Mesh Computing: Distributed job execution with cryptographic receipts
  • Federation Management: Multi-node coordination and trust management

πŸ”§ Development & Architecture

Backend Infrastructure (Rust)

15+ crates with ~65-75% implementation:

  • Runtime & Core: Job orchestration, WASM execution, utilities (icn-runtime, icn-common)
  • Identity & Security: DID management, credential verification (icn-identity, icn-zk)
  • Storage & Networking: Content-addressed DAG, P2P networking (icn-dag, icn-network)
  • Governance & Economics: Proposals, voting, mana accounting (icn-governance, icn-economics)
  • Mesh Computing: Job scheduling, execution pipeline (icn-mesh)
  • Developer Tools: CLI, API, SDK, templates (icn-cli, icn-api, icn-sdk)

Frontend Applications (React/React Native)

4 applications with ~60% implementation:

  • apps/web-ui: Federation administration dashboard
  • apps/explorer: DAG viewer and network browser
  • apps/agoranet: Governance deliberation platform
  • apps/wallet-ui: DID and key management interface

Shared Infrastructure

3 packages with ~70% implementation:

  • packages/ts-sdk: TypeScript SDK for all frontends
  • packages/ui-kit: Cross-platform component library
  • packages/ccl-visual-editor: Visual contract editor (early development)

πŸ’‘ Key Features & Implementations

πŸ›οΈ Governance Systems (Advanced Implementation)

  • Ranked Choice Voting: Complete implementation with ballot validation
  • Budget Proposals: On-chain mana allocation through democratic process
  • Federation Governance: Multi-federation coordination and trust management
  • CCL Contracts: Governance policies compiled to WASM for execution
  • Proposal Lifecycle: Complete workflow from creation to execution

πŸ’° Economic Coordination (Working Implementation)

  • Mana System: Regenerating resource credits across multiple storage backends
  • Resource Tokens: Generic token framework for different asset types
  • Mutual Credit: Community credit systems for local economic coordination
  • Time Banking: Work contribution tracking and exchange systems
  • Economic Policies: Configurable rules for resource distribution and management

🌐 Mesh Computing (End-to-End Implementation)

  • Job Submission: Real cross-node job submission and execution
  • Bidding System: Executor selection based on reputation and resource availability
  • WASM Execution: Secure, sandboxed execution with resource limits
  • Cryptographic Receipts: Verifiable execution proofs anchored in DAG
  • CCL Integration: Contract-based job execution with governance integration

πŸ” Identity & Security (Working with Security Review Needed)

  • DID Management: Decentralized identifier creation and resolution
  • Credential Verification: Issue and verify credentials with ZK proof support
  • Ed25519 Signing: Cryptographic signatures for all network operations
  • Execution Receipts: Signed proofs of job execution and state changes
  • Multi-factor Authentication: Support for HSM and encrypted key files

πŸ•ΈοΈ Federation Networking (Operational)

  • libp2p Integration: Real P2P networking with gossipsub and Kademlia DHT
  • Peer Discovery: Automatic federation joining and peer coordination
  • Message Routing: Efficient routing for governance and job coordination
  • Trust Management: Inter-federation trust and reputation systems
  • Network Resilience: Fault tolerance and connection management

πŸš€ Development Commands

Backend Development (Rust)

# Essential development cycle
just setup              # One-time environment setup
just build              # Build all crates
just test               # Run test suite
just validate           # Format, lint, and test

# Multi-node development
just devnet             # Start 3-node containerized federation
just health-check       # Validate federation health

# Development with different backends
just test-sled          # Test with Sled storage
just test-rocksdb       # Test with RocksDB storage

Frontend Development

# Frontend setup and development
just setup-frontend     # Setup Node.js environment
just dev-frontend       # Start all frontend applications

# Individual applications
just dev-web-ui         # Federation administration dashboard
just dev-explorer       # Network and DAG browser
just dev-agoranet       # Governance deliberation interface
just dev-wallet         # DID and key management

Full Stack Development

# Complete environment
just setup-all          # Setup both backend and frontend
just validate-all-stack # Complete validation across all components

πŸ“Š Implementation Status Overview

Working Components βœ…

Component Implementation Status Key Features
CCL Compiler ~70% complete WASM compilation, governance DSL, standard library
P2P Networking ~60% complete libp2p, gossipsub, Kademlia DHT, peer discovery
Governance ~65% complete Proposals, ranked choice voting, budget allocation
Economics ~60% complete Mana ledgers, resource tokens, mutual credit
Mesh Computing ~70% complete Job execution, bidding, WASM runtime, receipts
Identity ~55% complete DIDs, credentials, signing (needs security review)
Storage ~65% complete Multi-backend DAG store, content addressing
Frontend Apps ~60% complete Working UIs with real backend integration

Production Readiness Targets 🎯

  • Security Audit: Professional review of cryptographic implementations
  • Scale Testing: 10+ node federation validation under load
  • Operational Excellence: Monitoring, recovery, deployment automation
  • Documentation: Complete deployment and operational guides
  • Performance: Optimization for production workloads

πŸ—οΈ Architecture Patterns

Service Architecture

ICN uses trait-based service abstractions with multiple backend implementations:

// Multiple storage backends
pub trait DagStore: Send + Sync {
    async fn store_block(&self, block: DagBlock) -> Result<Cid, DagError>;
    async fn get_block(&self, cid: &Cid) -> Result<Option<DagBlock>, DagError>;
}

// Implementations: PostgreSQL, RocksDB, SQLite, Sled, Memory

Configuration-Driven Services

// Production vs development service selection
let mesh_service = match config.environment {
    Environment::Production => DefaultMeshNetworkService::new(libp2p_service),
    Environment::Development => DefaultMeshNetworkService::new_development(),
    Environment::Testing => StubMeshNetworkService::new(),
};

Comprehensive Error Handling

#[derive(Debug, thiserror::Error)]
pub enum RuntimeError {
    #[error("Insufficient mana: required {required}, available {available}")]
    InsufficientMana { required: u64, available: u64 },
    
    #[error("Job execution failed: {job_id} - {reason}")]
    JobExecutionFailed { job_id: JobId, reason: String },
}

πŸ” Security & Production Considerations

Current Security Measures βœ…

  • Ed25519 Cryptographic Signatures: All network messages and receipts signed
  • DID-based Authentication: Decentralized identity for all network participants
  • Content-Addressed Storage: Immutable DAG storage with cryptographic verification
  • WASM Sandboxing: Secure execution environment for governance contracts
  • Multi-backend Support: Defense against single points of failure

Security Review Requirements ⚠️

  • Cryptographic Implementation Audit: Professional review of all crypto code
  • Attack Vector Analysis: Comprehensive threat modeling and penetration testing
  • Key Management Review: HSM integration and secure key lifecycle procedures
  • Network Security: P2P network hardening and attack resistance validation
  • Economic Security: Game theory analysis and economic attack prevention

Production Readiness Checklist πŸ“‹

  • Security audit completion
  • Scale testing with 10+ nodes
  • Production monitoring and alerting
  • Error recovery and fault tolerance
  • Deployment automation and documentation
  • Performance optimization and benchmarking
  • Operational procedures and runbooks

🀝 Contributing & Community

Development Areas

  • Security Review: Cryptographic implementation audit and hardening
  • Production Readiness: Monitoring, error recovery, scale testing
  • Frontend Integration: Connecting UIs to working backend functionality
  • Documentation: Updating docs to match implementation reality
  • Testing: Additional test coverage for edge cases and integration scenarios

Getting Started with Development

  1. Read the Documentation: docs/DEVELOPER_GUIDE.md
  2. Setup Development Environment: just setup && just build
  3. Run Tests: just validate to ensure everything works
  4. Explore the Code: Start with ARCHITECTURE.md
  5. Join Development: See CONTRIBUTING.md

Community Resources

Stay Updated

  • Monthly Status Updates: Follow GitHub Discussions for project progress
  • Quarterly Roadmap Reviews: Major roadmap and priority updates
  • RFC Discussions: Participate in design decisions for major changes
  • GitHub Issues & Discussions: Bug reports, feature requests, and community discussion

🌟 Vision & Impact

ICN Core represents a sophisticated platform for cooperative digital infrastructure that enables communities to coordinate democratically without relying on extractive centralized systems.

Current Achievements πŸ†

  • Substantial Working Implementation: Beyond typical early-stage projects
  • Multi-Domain Integration: Governance, economics, identity, and computing working together
  • Real Networking: Actual P2P federation with working message passing
  • End-to-End Workflows: Complete user journeys from governance to execution
  • Cross-Platform Applications: Working UIs across web and mobile platforms

Production Vision 🌍

When production-ready, ICN Core will enable:

  • Democratic Governance without centralized control systems
  • Economic Coordination without extractive intermediaries
  • Resource Sharing across federation boundaries with cryptographic accountability
  • Privacy Preservation through zero-knowledge credential systems
  • Sovereign Infrastructure owned and operated by communities

ICN Core is advancing toward production-ready cooperative infrastructure. While substantial functionality already works, security review and operational excellence remain essential before production deployment.

About

Monorepo for ICN core Rust crates: common, identity, DAG, mesh, runtime, protocol, governance, economics, network, API & CLI

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

Packages

No packages published

Contributors 6