{"id":48515328,"url":"https://github.com/jose-compu/chaincraft-rust","last_synced_at":"2026-04-07T19:01:15.642Z","repository":{"id":298394858,"uuid":"999838087","full_name":"jose-compu/chaincraft-rust","owner":"jose-compu","description":"Chaincraft: A high-performance framework for blockchain prototyping and production-ready decentralized protocols","archived":false,"fork":false,"pushed_at":"2026-03-17T13:31:24.000Z","size":437,"stargazers_count":2,"open_issues_count":31,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-04-03T21:35:57.963Z","etag":null,"topics":["blockchain","cryptocurrencies","decentralization","framework","gossip-protocol","p2p","rust","self-sovereign"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/jose-compu.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2025-06-10T21:40:19.000Z","updated_at":"2026-03-19T10:19:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"b3906d54-1dac-44e6-bd54-54fc05e5de76","html_url":"https://github.com/jose-compu/chaincraft-rust","commit_stats":null,"previous_names":["jio-gl/chaincraft-rust","jose-blockchain/chaincraft-rust","jose-compu/chaincraft-rust"],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/jose-compu/chaincraft-rust","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fchaincraft-rust","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fchaincraft-rust/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fchaincraft-rust/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fchaincraft-rust/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jose-compu","download_url":"https://codeload.github.com/jose-compu/chaincraft-rust/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-compu%2Fchaincraft-rust/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31524531,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-07T16:28:08.000Z","status":"ssl_error","status_checked_at":"2026-04-07T16:28:06.951Z","response_time":105,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["blockchain","cryptocurrencies","decentralization","framework","gossip-protocol","p2p","rust","self-sovereign"],"created_at":"2026-04-07T19:01:14.842Z","updated_at":"2026-04-07T19:01:15.633Z","avatar_url":"https://github.com/jose-compu.png","language":"Rust","readme":"\u003cdiv align=\"center\"\u003e\n\n# Chaincraft Rust\n\n**Chaincraft: A high-performance framework for blockchain prototyping and production-ready decentralized protocols**\n\n[![Crates.io](https://img.shields.io/crates/v/chaincraft.svg)](https://crates.io/crates/chaincraft)\n[![Documentation](https://docs.rs/chaincraft/badge.svg)](https://docs.rs/chaincraft)\n[![CI](https://github.com/jose-blockchain/chaincraft-rust/actions/workflows/ci.yml/badge.svg)](https://github.com/jose-blockchain/chaincraft-rust/actions)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT)\n\n[![Rust](https://img.shields.io/badge/rust-1.82%2B-orange.svg)](https://www.rust-lang.org/)\n[![Crates.io Downloads](https://img.shields.io/crates/d/chaincraft.svg)](https://crates.io/crates/chaincraft)\n\n\u003c/div\u003e\n\n## Overview\n\nChaincraft: A high-performance library for blockchain prototyping and production-ready decentralized protocols. Chaincraft Rust provides a clean, well-documented implementation of core blockchain concepts with a focus on performance, security, and production-stability.\n\n## Features\n\n- **High Performance**: Built with Rust for maximum performance and memory safety\n- **Educational Focus**: Well-documented code with clear explanations of blockchain concepts\n- **Modular Design**: Pluggable consensus mechanisms, storage backends, and network protocols\n- **Cryptographic Primitives**: Ed25519, ECDSA/secp256k1, VRF, Proof-of-Work, VDF, symmetric encryption (Fernet)\n- **Network Protocol**: P2P networking with peer discovery and message propagation\n- **Flexible Storage**: Memory and persistent storage options with optional SQLite indexing\n- **CLI Interface**: Easy-to-use command-line interface for node management\n\n## Quick Start\n\n### Installation\n\n#### From Crates.io\n\n```bash\ncargo install chaincraft\n```\n\n#### From Source\n\n```bash\ngit clone https://github.com/jose-blockchain/chaincraft-rust.git\ncd chaincraft-rust\ncargo build --release\n```\n\n### Running a Node\n\nStart a Chaincraft node with default settings:\n\n```bash\nchaincraft-cli start\n```\n\nOr with custom configuration:\n\n```bash\nchaincraft-cli start --port 8080 --max-peers 20 --debug\n```\n\n### Generate a Keypair\n\n```bash\nchaincraft-cli keygen\n```\n\n## Usage as a Library\n\nAdd Chaincraft Rust to your `Cargo.toml`:\n\n```toml\n[dependencies]\nchaincraft = \"0.3.2\"\n```\n\n### Basic Example\n\n```rust\nuse chaincraft::{ChaincraftNode, Result};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    let mut node = ChaincraftNode::builder()\n        .port(21000)\n        .max_peers(10)\n        .build()?;\n\n    println!(\"Starting node {} on port {}\", node.id(), node.port());\n    \n    node.start().await?;\n    \n    // Your application logic here\n    \n    node.stop().await?;\n    Ok(())\n}\n```\n\n### Advanced Configuration\n\n```rust\nuse chaincraft::{ChaincraftNode, Result};\n\n#[tokio::main]\nasync fn main() -\u003e Result\u003c()\u003e {\n    let mut node = ChaincraftNode::builder()\n        .port(21000)\n        .max_peers(50)\n        .with_persistent_storage(true)  // requires feature \"persistent\"\n        .local_discovery(true)\n        .persist_peers(true)\n        .build()?;\n\n    node.start().await?;\n    \n    // Node is now running with persistent storage and local discovery\n    \n    Ok(())\n}\n```\n\n## Architecture\n\nChaincraft Rust is built with a modular architecture:\n\n- **Core**: Basic blockchain data structures and validation logic\n- **Consensus**: Pluggable consensus mechanisms (Tendermint-style, randomness beacon)\n- **Network**: P2P networking layer with peer discovery\n- **Storage**: Flexible storage backends (memory, persistent, indexed)\n- **Crypto**: Cryptographic primitives and utilities\n- **CLI**: Command-line interface for node management\n\n### Network Architecture (Rust Version)\n\nThe Rust implementation uses **raw UDP sockets** (no libp2p) for simplicity and control:\n\n1. **Bind**: Each node binds a UDP socket to `host:port` (port `0` = ephemeral).\n2. **Gossip Loop**: A background task periodically rebroadcasts stored message hashes to all known peers.\n3. **Receive Loop**: Incoming datagrams are parsed as JSON `SharedMessage`, deduplicated, stored, and rebroadcast.\n4. **Local Discovery**: In-process nodes register in a static `LOCAL_NODES` map for automatic peer discovery within the same process.\n5. **Message Flow**: `create_shared_message_with_data()` stores a message, processes it through `ApplicationObject`s, and broadcasts to peers.\n\n### Running Multi-Node Demos\n\nStart multiple nodes in separate terminals or use the multi-node script:\n\n```bash\n# Terminal 1\nchaincraft-cli start --port 9001\n\n# Terminal 2\nchaincraft-cli start --port 9002 --peer 127.0.0.1:9001\n\n# Terminal 3\nchaincraft-cli start --port 9003 --peer 127.0.0.1:9001 --peer 127.0.0.1:9002\n```\n\nOr run the shared objects example (in-process multi-node):\n\n```bash\ncargo run --example shared_objects_example\n```\n\n### Python vs Rust Feature Mapping\n\n| Python (chaincraft)   | Rust (chaincraft)  |\n|-----------------------|-------------------------|\n| `node.py`             | `src/node.rs`           |\n| `SharedMessage`       | `shared::SharedMessage` |\n| `ApplicationObject`   | `shared_object::ApplicationObject` |\n| `SimpleSharedNumber`  | `shared_object::SimpleSharedNumber` |\n| `SimpleChainObject`   | `shared_object::MerkelizedChain`    |\n| Message chain         | `shared_object::MessageChain`       |\n| ECDSA ledger          | `examples::ecdsa_ledger::ECDSALedgerObject` |\n| `dbm` / on-disk storage | `sled` (feature `persistent`) |\n| `local_discovery`     | `NodeConfig::local_discovery` + `LOCAL_NODES` registry |\n| `gossip` loop         | Gossip task in `start_networking()` |\n| UDP broadcast         | `broadcast_bytes()` via `UdpSocket` |\n\n## Features\n\n### Default Features\n\n- `compression`: Enable message compression for network efficiency\n\n### Optional Features\n\n- `persistent`: Enable persistent storage using sled\n- `indexing`: Enable SQLite-based transaction indexing\n- `vdf-crypto`: Enable VDF (Verifiable Delay Function) support via [vdf](https://crates.io/crates/vdf) crate. Requires GMP: `apt install libgmp-dev` or `brew install gmp`\n\nEnable features in your `Cargo.toml`:\n\n```toml\n[dependencies]\nchaincraft = { version = \"0.3.2\", features = [\"persistent\", \"indexing\"] }\n```\n\n## Development\n\n### Prerequisites\n\n- Rust 1.82 or later\n- Git\n\n### Building\n\n```bash\ngit clone https://github.com/jose-blockchain/chaincraft-rust.git\ncd chaincraft-rust\ncargo build\n```\n\n### Running Tests\n\n```bash\n# Run all tests\ncargo test\n\n# Run tests with all features enabled\ncargo test --all-features\n\n# Run example integration tests\ncargo test --test examples_integration\n```\n\n### Running Benchmarks\n\n```bash\ncargo bench\n```\n\n### Code Coverage\n\n```bash\ncargo install cargo-tarpaulin\ncargo tarpaulin --out Html\n```\n\n## API Documentation\n\nFull API documentation is available on [docs.rs](https://docs.rs/chaincraft).\n\nTo build documentation locally:\n\n```bash\ncargo doc --open --all-features\n```\n\n## Examples\n\nCheck out the `examples/` directory for more usage examples:\n\n- `basic_node.rs`: Simple node setup and operation\n- `keypair_generation.rs`: Cryptographic keypair generation and signing\n- `chatroom_example.rs`: Decentralized chatroom protocol (create rooms, post messages)\n- `randomness_beacon_example.rs`: Verifiable randomness beacon\n- `shared_objects_example.rs`: Multi-node network with shared object propagation\n- `proof_of_work_example.rs`: Proof of Work mining and verification\n\nRun examples with:\n\n```bash\ncargo run --example basic_node\ncargo run --example chatroom_example\ncargo run --example shared_objects_example\n```\n\n## Contributing\n\nWe welcome contributions via pull requests.\n\n### Development Workflow\n\n1. Fork the repository\n2. Create a feature branch (`git checkout -b feature/amazing-feature`)\n3. Make your changes\n4. Add tests for your changes\n5. Ensure all tests pass (`cargo test --all-features`)\n6. Run clippy (`cargo clippy --all-features`)\n7. Format your code (`cargo fmt`)\n8. Commit your changes (`git commit -am 'Add amazing feature'`)\n9. Push to the branch (`git push origin feature/amazing-feature`)\n10. Open a Pull Request\n\n## Performance\n\nChaincraft Rust is designed for high performance:\n\n- Zero-copy serialization where possible\n- Efficient async networking with tokio\n- Optimized cryptographic operations\n- Configurable resource limits\n\n## Security\n\nSecurity is a top priority:\n\n- Memory-safe Rust implementation\n- Cryptographic operations use well-audited libraries\n- Network protocol includes message authentication\n- Input validation and sanitization throughout\n\n## License\n\nThis project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.\n\n## Acknowledgments\n\n- Built with [Tokio](https://tokio.rs/) for async runtime\n- Cryptography powered by [RustCrypto](https://github.com/RustCrypto)\n- Custom UDP-based P2P networking (no libp2p dependency)\n\n## Roadmap\n\n- [X] Advanced consensus mechanisms (PBFT)\n- [ ] Smart contract support\n- [ ] Enhanced monitoring and metrics\n- [ ] WebAssembly runtime integration\n\n---\n\nFor more information, visit our [documentation](https://docs.rs/chaincraft) or [repository](https://github.com/jose-blockchain/chaincraft-rust). \n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-compu%2Fchaincraft-rust","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjose-compu%2Fchaincraft-rust","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-compu%2Fchaincraft-rust/lists"}