{"id":29467618,"url":"https://github.com/jose-blockchain/chaincraft","last_synced_at":"2026-03-07T16:31:48.645Z","repository":{"id":270746412,"uuid":"848428131","full_name":"jose-blockchain/chaincraft","owner":"jose-blockchain","description":"Chaincraft: The platform for blockchain education and prototyping decentralized protocols","archived":false,"fork":false,"pushed_at":"2026-02-17T19:19:16.000Z","size":519,"stargazers_count":2,"open_issues_count":6,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2026-02-18T00:50:20.442Z","etag":null,"topics":["blockchain","cryptocurrencies","decentralized","ipfs","libp2p","p2p-network","peer-to-peer","substrate"],"latest_commit_sha":null,"homepage":"","language":"Python","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-blockchain.png","metadata":{"files":{"readme":"README.md","changelog":null,"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":"2024-08-27T18:35:50.000Z","updated_at":"2026-02-17T19:19:30.000Z","dependencies_parsed_at":null,"dependency_job_id":"b0536d32-a94b-48c1-981a-9041747fb9ce","html_url":"https://github.com/jose-blockchain/chaincraft","commit_stats":null,"previous_names":["jio-gl/chaincraft","jose-blockchain/chaincraft"],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/jose-blockchain/chaincraft","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-blockchain%2Fchaincraft","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-blockchain%2Fchaincraft/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-blockchain%2Fchaincraft/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-blockchain%2Fchaincraft/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/jose-blockchain","download_url":"https://codeload.github.com/jose-blockchain/chaincraft/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/jose-blockchain%2Fchaincraft/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":30221508,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-03-07T14:02:48.375Z","status":"ssl_error","status_checked_at":"2026-03-07T14:02:43.192Z","response_time":53,"last_error":"SSL_read: 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","decentralized","ipfs","libp2p","p2p-network","peer-to-peer","substrate"],"created_at":"2025-07-14T10:00:35.132Z","updated_at":"2026-03-07T16:31:48.624Z","avatar_url":"https://github.com/jose-blockchain.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Chaincraft\n\n[![Python 3.8+](https://img.shields.io/badge/python-3.8+-blue.svg)](https://www.python.org/downloads/)\n[![Python Unit Tests](https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml/badge.svg)]([https://github.com/google/adk-python/actions/workflows/python-unit-tests.yml](https://github.com/jio-gl/chaincraft/blob/main/.github/workflows/python-app.yml))\n[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)\n[![Blockchain](https://img.shields.io/badge/blockchain-educational-blueviolet)](https://github.com/jio-gl/chaincraft)\n[![ECDSA](https://img.shields.io/badge/ECDSA-supported-green)](https://github.com/jio-gl/chaincraft)\n[![Project Status](https://img.shields.io/badge/status-in%20development-yellow)](https://github.com/jio-gl/chaincraft)\n[![PyPI version](https://badge.fury.io/py/chaincraft.svg)](https://pypi.org/project/chaincraft/)\n[![PyPI Downloads](https://static.pepy.tech/badge/cerebras-agent)](https://pepy.tech/projects/chaincraft)\n\n**A platform for blockchain education and prototyping**\n\nChaincraft is a Python-based framework for building and experimenting with blockchain protocols. It provides the fundamental components needed to create distributed networks, implement consensus mechanisms, and prototype blockchain applications.\n\n## Key Features\n\n- **Decentralized Network**: Built-in peer discovery, connection management, and message propagation  \n- **Shared Objects**: Extensible framework for maintaining distributed state across nodes  \n- **Cryptographic Primitives**: Implementation of essential blockchain cryptography  \n- **Persistence**: Optional persistent storage for nodes and messages  \n- **Data Validation**: Type checking and schema validation for messages  \n- **Merklelized Storage**: Support for efficient state synchronization  \n\n## Installation\n\n### Install from PyPI\n\nThe easiest way to install Chaincraft is via pip:\n\n```bash\npip install chaincraft\n```\n\n### Install from Source\n\nFor development or to get the latest features:\n\n```bash\ngit clone https://github.com/jio-gl/chaincraft.git\ncd chaincraft\npip install -e .\n```\n\n### Development Installation\n\nTo install with development dependencies:\n\n```bash\ngit clone https://github.com/jio-gl/chaincraft.git\ncd chaincraft\npip install -e \".[dev]\"\n```\n\n### Requirements\n\n- Python 3.8 or higher\n- `cryptography\u003e=44.0.1`\n\n## Import Guide\n\nAfter installing chaincraft, you can import its components using the package namespace:\n\n```python\n# Main node component\nfrom chaincraft import ChaincraftNode\n\n# Core components\nfrom chaincraft.shared_object import SharedObject\nfrom chaincraft.shared_message import SharedMessage\n\n# Exceptions\nfrom chaincraft.shared_object import SharedObjectException\n\n# Cryptographic primitives\nfrom chaincraft.crypto_primitives.pow import ProofOfWorkPrimitive\nfrom chaincraft.crypto_primitives.sign import ECDSASignaturePrimitive\n```\n\n## Quick Start\n\n### Command Line Interface\n\nAfter installation, you can use the `chaincraft-cli` command:\n\n```bash\n# Start a node with default settings\nchaincraft-cli\n\n# Start a node on a specific port\nchaincraft-cli -p 8000\n\n# Start a node and connect to a seed peer\nchaincraft-cli -s 127.0.0.1:21000\n\n# Enable debugging and use memory storage\nchaincraft-cli -d -m\n```\n\n### Python API\n\n```python\nimport chaincraft\n\n# Create and start a node\nnode = chaincraft.ChaincraftNode()\nnode.start()\n\n# Connect to another node\nnode.connect_to_peer(\"127.0.0.1\", 21000)\n\n# Create and broadcast a message\nnode.create_shared_message(\"Hello, Chaincraft!\")\n```\n\n## Architecture\n\nChaincraft is built on several core components:\n\n- `ChaincraftNode`: Handles networking, peer discovery, and message gossip  \n- `SharedMessage`: Wraps and serializes data for network transmission  \n- `SharedObject`: Abstract base class for implementing distributed data structures  \n- **Cryptographic primitives**: PoW, VDF, secure ECDSA, and VRF implementations  \n\n## Usage\n\n### Basic Node Setup\n\n```python\nfrom chaincraft import ChaincraftNode\n\n# Create a node with default settings\nnode = ChaincraftNode()\nnode.start()\n\n# Connect to another node\nnode.connect_to_peer(\"127.0.0.1\", 21000)\n\n# Create and broadcast a message\nnode.create_shared_message(\"Hello, Chaincraft!\")\n```\n\n### Creating a Custom Shared Object\n\n```python\nfrom chaincraft.shared_object import SharedObject\nfrom chaincraft.shared_message import SharedMessage\nimport hashlib\nimport json\n\nclass MySharedState(SharedObject):\n    def __init__(self):\n        self.state = {}\n        self.chain = []  # For merklelized sync\n    \n    def is_valid(self, message: SharedMessage) -\u003e bool:\n        # Validate incoming messages\n        return isinstance(message.data, dict) and \"key\" in message.data\n        \n    def add_message(self, message: SharedMessage) -\u003e None:\n        # Update state based on message\n        self.state[message.data[\"key\"]] = message.data[\"value\"]\n        self.chain.append(message.data)\n        \n    def is_merkelized(self) -\u003e bool:\n        return True\n        \n    def get_latest_digest(self) -\u003e str:\n        # Return latest state digest for sync\n        return hashlib.sha256(json.dumps(self.chain).encode()).hexdigest()\n    \n    # Additional required methods...\n```\n\n### Using Cryptographic Primitives\n\n```python\nfrom chaincraft.crypto_primitives.pow import ProofOfWorkPrimitive\n\n# Create a Proof of Work challenge\npow_primitive = ProofOfWorkPrimitive(difficulty_bits=16)\nchallenge = \"block_data_here\"\nnonce, hash_hex = pow_primitive.create_proof(challenge)\n\n# Verify the proof\nis_valid = pow_primitive.verify_proof(challenge, nonce, hash_hex)\n```\n\n## Blockchain Prototyping\n\nChaincraft provides the building blocks for implementing various blockchain designs:\n\n- **Proof of Work Blockchains**: Using the PoW primitive  \n- **State-Based Applications**: Using `SharedObject`s for consensus  \n- **Transaction Validation**: Using the message validation framework  \n- **Custom Consensus Mechanisms**: By extending `SharedObject`s with validation rules  \n\n## Examples\n\nThe project includes various **examples**:\n\n- **Simple Blockchain**: A basic blockchain with PoW consensus  \n- **Message Chain**: A merklelized append-only log of messages  \n- **ECDSA Transactions**: Signed transactions with balance tracking  \n- **Chatroom**: A real-time chat example with auto-accept membership  \n  - See [`examples/chatroom.md`](examples/chatroom.md) for details!\n\n## Running Tests\n\nRun **all tests**:\n\n```bash\npython -m unittest discover -v -s tests\n```\n\nRun a **specific test file**:\n\n```bash\npython -m unittest tests/test_blockchain_example.py\n```\n\nRun a **specific test**:\n\n```bash\npython -m unittest -v -k test_local_discovery_enabled tests/test_local_discovery.py\n```\n\n## Design Principles\n\nChaincraft is designed to help explore blockchain tradeoffs:\n\n- **Blockchain Trilemma**:  \n  - Security vs. Scalability vs. Decentralization\n- **Time Synchronization**:  \n  - Asynchronous vs. Time-Bounded vs. Synchronized\n- **Identity Models**:  \n  - Anonymous vs. Resource-Based vs. Identity-Based\n\n## Contributing\n\nContributions to Chaincraft are welcome! This is an educational project aimed at helping developers understand blockchain concepts through hands-on implementation.\n\n## Current Status (Roadmap)\n\n### Roadmap to version 1.0.0\n\n- ✅ Gossip Protocol: Sharing JSON messages between nodes  \n- ✅ Persistent Storage: Key-value storage for messages  \n- ✅ Peer Discovery: Global and local node discovery  \n- ✅ Message Validation: Field and type validation with peer banning  \n- ✅ Shared Objects: State synchronization between nodes  \n- ✅ Merklelized Storage: Efficient state synchronization  \n- ✅ Additional Cryptographic Primitives  \n- ✅ Indexing (Validated Message Type can have some indexed fields)  \n- ✅ Consensus Mechanisms  \n- ✅ Proof of Work\n- ✅ Practical Byzantine Fault Tolerance (PBFT) or Tenderming (simpler)\n- ⬜ Transaction Validation for Ledgers (Balance-based and UTXO-based) \n- ⬜ Proof of Stake  \n- ⬜ Proof of Authority  \n- ⬜ Proof of Elapsed Time  \n- ⬜ Smart Contracts  \n- ⬜ State Machine Replication  \n- ⬜ Sharding  \n\n### Ideas for version 2.0.0\n\n- Configurable Building Blocks:\n    * choose consensys protocol (PoS, PoW, PoA, etc)\n    * choose ledger type (UTXO, Account Balances, etc)\n    * choose gas auction (Lower Price First, Median Price, etc)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-blockchain%2Fchaincraft","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fjose-blockchain%2Fchaincraft","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fjose-blockchain%2Fchaincraft/lists"}