{"id":50675219,"url":"https://github.com/ziuus/dynamic-blockchain","last_synced_at":"2026-06-08T15:03:05.062Z","repository":{"id":355011288,"uuid":"1226401965","full_name":"ziuus/Dynamic-Blockchain","owner":"ziuus","description":"⛓️ A hybrid blockchain with ephemeral off-chain state channels for infinite TPS — Dynamic Interconnection Model","archived":false,"fork":false,"pushed_at":"2026-05-01T11:19:41.000Z","size":804,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2026-05-01T13:18:38.382Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","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/ziuus.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","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":"2026-05-01T10:54:17.000Z","updated_at":"2026-05-01T11:19:45.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/ziuus/Dynamic-Blockchain","commit_stats":null,"previous_names":["ziuus/dynamic-blockchain"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/ziuus/Dynamic-Blockchain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziuus%2FDynamic-Blockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziuus%2FDynamic-Blockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziuus%2FDynamic-Blockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziuus%2FDynamic-Blockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ziuus","download_url":"https://codeload.github.com/ziuus/Dynamic-Blockchain/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ziuus%2FDynamic-Blockchain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34067353,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-08T02:00:07.615Z","response_time":111,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"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":[],"created_at":"2026-06-08T15:02:59.574Z","updated_at":"2026-06-08T15:03:05.056Z","avatar_url":"https://github.com/ziuus.png","language":"JavaScript","funding_links":["https://github.com/sponsors/ziuus"],"categories":[],"sub_categories":[],"readme":"# ⛓️ Dynamic Interconnection Blockchain\n\n\u003e A next-generation hybrid blockchain architecture that offloads high-frequency transactions from the main chain to **dynamic, ephemeral peer-to-peer state channels** — dramatically improving throughput while preserving on-chain security and finality.\n\n[![Node.js](https://img.shields.io/badge/Node.js-18%2B-green?logo=node.js)](https://nodejs.org)\n[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](./LICENSE)\n[![Architecture: Hybrid](https://img.shields.io/badge/Architecture-Hybrid%20Blockchain-purple)]()\n[![GitHub Sponsors](https://img.shields.io/badge/Sponsor-%E2%9D%A4-pink?logo=github-sponsors)](https://github.com/sponsors/ziuus)\n[![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg)](./CONTRIBUTING.md)\n\n---\n\n## 🧠 The Problem\n\nTraditional blockchains suffer from the **scalability trilemma**: as transaction volume grows, the network faces:\n\n- ⏱️ **Congestion** — mempool backlogs, slow confirmations\n- 💸 **High fees** — gas wars during peak load\n- 📉 **Degraded throughput** — Bitcoin ~7 TPS, Ethereum ~15–30 TPS\n\n## 💡 The Solution: Ephemeral Off-Chain Channels\n\nThis model introduces **Dynamic Interconnection Channels** — ephemeral, bilateral state channels that:\n\n1. **Lock** initial balances on-chain (one transaction)\n2. **Transact** off-chain at infinite speed with no fees\n3. **Settle** final state back on-chain (one transaction)\n\nThe result: **∞ TPS** for channel participants, with on-chain security guarantees for final settlement.\n\n---\n\n## 📊 Benchmark Results\n\n```\nMain Chain (PoW, difficulty 2):     ~3,846 TPS\nEphemeral Channels (off-chain):         ∞ TPS\nSettlement overhead:                    0 ms\nOn-chain footprint per channel:    2 txs (open + close)\n```\n\n---\n\n## 🏗️ Architecture\n\n```\n┌─────────────────────────────────────────────────────┐\n│                    REST API Layer                    │\n│              Express HTTP (port 3000+)               │\n└──────────────────────┬──────────────────────────────┘\n                       │\n┌──────────────────────▼──────────────────────────────┐\n│                    Node Layer                        │\n│         Identity · Peers · State Management          │\n└────────────┬─────────────────────┬──────────────────┘\n             │                     │\n┌────────────▼──────┐  ┌──────────▼──────────────────┐\n│   Main Chain      │  │   Ephemeral Channel Layer    │\n│  Block · PoW      │  │  Channel · ChannelManager    │\n│  Merkle · Txs     │  │  Off-chain State · Settle    │\n└────────────┬──────┘  └──────────────────────────────┘\n             │\n┌────────────▼──────────────────────────────────────┐\n│                  P2P Network Layer                  │\n│            WebSocket Gossip Protocol                │\n└────────────────────────────────────────────────────┘\n```\n\n### Module Map\n\n| Path | Responsibility |\n|------|---------------|\n| `core/Block.js` | Block structure, PoW mining, Merkle root |\n| `core/Blockchain.js` | Chain management, validation, balance tracking |\n| `core/Transaction.js` | Transaction format, hashing, signature validation |\n| `ephemeral/Channel.js` | Bilateral off-chain state channel lifecycle |\n| `ephemeral/ChannelManager.js` | Multi-channel orchestration per node |\n| `network/Node.js` | Node identity, peer management, state |\n| `network/P2P.js` | WebSocket-based P2P gossip protocol |\n| `api/server.js` | REST API (blockchain, channels, mining, P2P) |\n| `simulation/runNetwork.js` | Multi-node network simulation |\n| `simulation/benchmark.js` | Throughput comparison benchmark |\n\n---\n\n## 🚀 Quick Start\n\n### Prerequisites\n\n- Node.js 18+\n- pnpm (`npm install -g pnpm`)\n\n### Install\n\n```bash\ngit clone https://github.com/ziuus/Dynamic-Blockchain.git\ncd Dynamic-Blockchain\npnpm install\n```\n\n### Run the API Server\n\n```bash\npnpm start\n# API available at http://localhost:3000\n```\n\n### Run the Network Simulation (3 nodes)\n\n```bash\npnpm simulate\n# Spins up 3 nodes with P2P sync, channels, and mining\n```\n\n### Run the Benchmark\n\n```bash\npnpm benchmark\n# Compares main chain TPS vs ephemeral channel TPS\n```\n\n---\n\n## 🔌 REST API Reference\n\n### Blockchain\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/api/blockchain` | Full chain state |\n| `GET` | `/api/blockchain/height` | Current block height |\n| `GET` | `/api/blockchain/valid` | Chain validity check |\n| `GET` | `/api/block/:index` | Block by index |\n\n### Transactions\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/transactions` | Submit a transaction |\n| `GET` | `/api/transactions/pending` | Mempool |\n| `GET` | `/api/transactions/history/:address` | Address history |\n| `POST` | `/api/mine` | Mine pending transactions |\n| `GET` | `/api/balance/:address` | Address balance |\n\n### Ephemeral Channels\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `POST` | `/api/channels` | Open a new channel |\n| `GET` | `/api/channels` | List all channels |\n| `GET` | `/api/channels/:id` | Channel details |\n| `GET` | `/api/channels/for/:address` | Channels for address |\n| `POST` | `/api/channels/:id/transactions` | Off-chain transaction |\n| `POST` | `/api/channels/:id/settle` | Settle channel on-chain |\n| `POST` | `/api/channels/:id/close` | Force close channel |\n| `GET` | `/api/channels/stats` | Channel statistics |\n\n### Node \u0026 P2P\n\n| Method | Endpoint | Description |\n|--------|----------|-------------|\n| `GET` | `/api/node/status` | Node health \u0026 stats |\n| `GET` | `/api/p2p/peers` | Connected peers |\n| `POST` | `/api/p2p/connect` | Connect to peer |\n| `POST` | `/api/p2p/sync` | Trigger sync |\n| `GET` | `/api/health` | Health check |\n\n---\n\n## 🔬 How Ephemeral Channels Work\n\n```\nAlice                    Channel Contract              Bob\n  │                           │                         │\n  │──── open(1000, 1000) ────►│                         │\n  │                           │◄── open(1000, 1000) ────│\n  │                           │  [On-chain: 1 tx]        │\n  │                                                      │\n  │◄──────────────── off-chain transactions ────────────►│\n  │   (tx1: Alice→Bob 50)  (tx2: Bob→Alice 20)  ...     │\n  │   [Instant, zero fees, unlimited]                    │\n  │                                                      │\n  │──── settle() ──────────────────────────────────────►│\n  │   [On-chain: 1 settlement tx with final balances]   │\n```\n\n**Security:** All off-chain state is cryptographically signed. Either party can force-close using the latest agreed state at any time.\n\n---\n\n## 🗺️ Roadmap\n\n- [x] Core blockchain (PoW, Merkle, validation)\n- [x] Ephemeral state channels\n- [x] P2P WebSocket gossip\n- [x] REST API\n- [x] Simulation \u0026 benchmark suite\n- [ ] Dashboard UI (real-time network visualizer)\n- [ ] Proof-of-Stake consensus layer\n- [ ] Multi-hop channel routing (payment network)\n- [ ] RSA keypair-based transaction signing\n- [ ] Persistent storage (LevelDB)\n- [ ] Docker / multi-node devnet setup\n\n---\n\n## 📁 Project Structure\n\n```\nDynamic-Blockchain/\n├── core/\n│   ├── Block.js           # Block with PoW + Merkle root\n│   ├── Blockchain.js      # Main chain state machine\n│   └── Transaction.js     # Transaction format \u0026 validation\n├── ephemeral/\n│   ├── Channel.js         # Off-chain state channel\n│   └── ChannelManager.js  # Channel lifecycle manager\n├── network/\n│   ├── Node.js            # P2P node identity \u0026 state\n│   └── P2P.js             # WebSocket gossip protocol\n├── api/\n│   └── server.js          # Express REST API\n├── simulation/\n│   ├── runNetwork.js      # 3-node network simulator\n│   └── benchmark.js       # Throughput benchmarking\n├── docs/\n│   └── ARCHITECTURE.md    # Deep-dive architecture docs\n├── .gitignore\n├── package.json\n└── README.md\n```\n\n---\n\n## 🤝 Contributing\n\nAll contributions are welcome — from beginners to experts. You don't need to know everything about blockchain to help!\n\n**Ways to contribute:**\n\n| Type | How |\n|------|-----|\n| 🐛 Bug report | [Open an issue](https://github.com/ziuus/Dynamic-Blockchain/issues/new) |\n| 💡 Feature idea | [Start a discussion](https://github.com/ziuus/Dynamic-Blockchain/discussions) |\n| 🔧 Code | Fork → branch → PR (see [CONTRIBUTING.md](./CONTRIBUTING.md)) |\n| 📖 Docs | Fix typos, improve explanations, add examples |\n| ⭐ Star | Helps the project get discovered — much appreciated! |\n\n---\n\n## 💖 Support the Project\n\nThis is an independent open-source project built and maintained in spare time. If it's useful to you — or you just want to see it grow — any support means a lot:\n\n- ⭐ **Star the repo** — it's free and helps enormously with discovery\n- 🐦 **Share it** — tweet it, post it, tell a friend\n- 💰 **Sponsor** — [github.com/sponsors/ziuus](https://github.com/sponsors/ziuus)\n- 🛠️ **Contribute** — code, docs, tests, ideas — all welcome\n- 🐛 **Report bugs** — helps everyone using the project\n\n\u003e Every star, share, and contribution directly funds time to work on the roadmap:\n\u003e PoS consensus · LevelDB storage · multi-hop routing · test suite · Docker devnet\n\n---\n\n## 📄 License\n\nMIT © [ziuus](https://github.com/ziuus)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziuus%2Fdynamic-blockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fziuus%2Fdynamic-blockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fziuus%2Fdynamic-blockchain/lists"}