Skip to content

calimero-network/core

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Welcome to Calimero Network

Discord License Issues - calimero

Build Self-Sovereign Applications with CRDT-Powered P2P Sync

Calimero Network is a framework for building distributed, peer-to-peer applications with automatic conflict-free data synchronization, data ownership, and verifiable off-chain computing.

Key Features:

  • ✅ DAG-based CRDT Sync - Automatic conflict resolution, works offline
  • ✅ Event-driven Architecture - Real-time notifications across nodes
  • ✅ Encrypted P2P - Secure data sharing with end-to-end encryption
  • ✅ WASM Runtime - Write apps in Rust, compile to WebAssembly
  • ✅ Multi-chain Integration - NEAR, ICP, Ethereum, Stellar, ZKSync
  • ✅ Local-first - Your data, your node, your control

Quick Navigation:

Documentation

📚 Component Documentation:

🔧 Guides:

Why Calimero?

Data Ownership & Privacy - Self-sovereign apps on user-controlled nodes with encrypted storage and selective sharing.

Automatic Synchronization - CRDT technology provides conflict-free merges, offline support, and causal ordering with eventual consistency.

Verifiable Off-Chain Computing - Efficient local consensus with cross-chain proof verification and horizontal scalability.

Architecture

Calimero's architecture consists of four main layers:

  1. Application Layer - WASM apps using the Calimero SDK
  2. Node Layer - DAG-based delta synchronization and event handling
  3. Storage Layer - CRDT storage with Merkle trees for efficient state comparison
  4. Network Layer - P2P communication via libp2p (Gossipsub + Streams)

How It Works

Transaction Flow:

  1. Client calls WASM method → generates CRDT actions
  2. Actions committed as DAG delta → broadcast via Gossipsub
  3. Peers receive delta → apply to local state
  4. Event handlers execute → UI updates in real-time

Sync Flow:

  • Primary: Gossipsub broadcasts (100-200ms latency)
  • Fallback: Periodic P2P sync (every 10-30s)
  • Recovery: DAG buffering handles out-of-order delivery

For detailed architecture diagrams and flows, see:

Core Components

1. CRDT Storage

Conflict-free data types with automatic merging: UnorderedMap, Vector, Counter, and Merkle trees for state comparison.

→ Storage Documentation - Data types, merge semantics, and usage

2. DAG-based Synchronization

Causal delta tracking with out-of-order handling, fork detection, and automatic cascade application.

→ DAG Documentation - DAG structure, algorithms, and performance
→ Node Documentation - Runtime integration and sync protocols
→ Sync Configuration - Tuning parameters

3. Event-Driven Architecture

Real-time event emission, propagation, and handler execution across the network.

→ SDK Documentation - API reference and examples
→ Event Handling Guide - Event flow and handlers

4. P2P Networking

libp2p-based communication with Gossipsub broadcasts, reliable streams, DHT peer discovery, and Noise encryption.

→ Network Documentation - Protocols and configuration

5. Multi-Chain Integration

Cross-chain proof verification for NEAR Protocol, ICP, Ethereum, Stellar, and zkSync.

→ Contracts Directory - Smart contracts for each chain

Core Principles

  1. Data Ownership - Your data on your devices, you control access
  2. Privacy by Default - End-to-end encryption
  3. Distributed by Design - P2P architecture, no single point of failure
  4. Developer-Friendly - Simple API with powerful CRDT primitives

Project Structure

calimero/core/
├── apps/                      # Example applications
│   ├── kv-store/              # Simple key-value store
│   ├── kv-store-with-handlers/# KV store with events
│   └── blobs/                 # Blob sharing example
│
├── crates/                    # Core Rust crates
│   ├── sdk/                   # Application SDK
│   ├── storage/               # CRDT storage layer
│   ├── dag/                   # DAG logic (pure)
│   ├── node/                  # Node runtime
│   ├── network/               # P2P networking
│   ├── server/                # JSON-RPC server
│   ├── auth/                  # Authentication
│   └── meroctl/               # CLI tool
│
├── contracts/                 # Cross-chain contracts
│   ├── near/                  # NEAR contracts
│   ├── icp/                   # ICP canisters
│   ├── ethereum/              # Solidity contracts
│
└── e2e-tests/                 # End-to-end test suite

Quick Start

Installation

# Clone the repository
git clone https://github.com/calimero-network/core.git
cd core

# Build the project
cargo build --release

# Run tests
cargo test

Running a Node

# Start coordinator node
merod --node-type coordinator

# Connect peer node
merod --node-type peer --swarm-addrs /ip4/127.0.0.1/tcp/2428

Building an Application

# Create new app from template
cd apps/
cp -r kv-store my-app

# Build the WASM
cd my-app && ./build.sh

For detailed guides, see:

Use Cases

Calimero enables a wide range of decentralized applications:

  • Collaborative Editing - Real-time document collaboration without servers
  • Decentralized Social - User-controlled social networks
  • P2P Gaming - Multiplayer games with automatic state sync
  • IoT Networks - Decentralized device coordination
  • Supply Chain - Transparent, multi-party tracking
  • Healthcare - Private, patient-controlled medical records

See example applications for working implementations.

Performance

Calimero is designed for efficiency:

  • Latency: 100-200ms delta propagation (Gossipsub)
  • Throughput: 100-1000 deltas/sec per context
  • Memory: ~10MB per context (1000 deltas)
  • Scalability: Horizontal (more contexts = more throughput)

For detailed performance analysis and tuning:

Troubleshooting

Common issues and solutions:

Community & Contributing

Get Involved:

Contributing:

We welcome contributions! See Contributing Guide for details.

All contributors must read the Developer Certificate of Origin and sign all commits.

Releases

Calimero uses centralized version management. Current version: 0.1.1

For publishing instructions, see Contributing Guide.

License

This repository contains Calimero, covered under the Apache License 2.0, except where noted (Calimero logos and trademarks are not covered).

Calimero is a product produced from this open source software, exclusively by Calimero, Ltd. It is distributed under our commercial terms.

Others may make their own distribution of the software, but cannot use any Calimero trademarks, cloud services, etc.

We explicitly grant permission for you to make a build that includes our trademarks while developing Calimero itself. You may not publish or share the build for other purposes.


Built with ❤️ by the Calimero Network team

For questions, reach out on Discord.