CoralChain is a lightweight, web-based blockchain simulation framework built with Ruby and Sinatra. It brings together a collection of visual, interactive gadgets designed to illustrate key concepts such as blockchain structure, multi-node synchronization, and consensus mechanism comparison. This project offers an approachable and hands-on way to explore the fundamental behaviors of blockchain systems in simplified, illustrative scenarios.
-
Block Operations & Verification
- Create and inspect blocks with customizable data and consensus selection
- Validate chain integrity via hash links, indexing, and digital signatures
- Simulate tampering and observe its effects through real-time visual feedback
-
Multi-Node Interaction & Synchronization
- Run concurrent blockchains on Node A, Node B, and a Byzantine Node X
- Simulate Byzantine behavior, including fake chain broadcasting and override attempts
- Visualize chain differences, forks, and synchronization across nodes
- Apply longest-valid-chain rules to resolve conflicts
-
Consensus & Network Simulation
- Explore PoW, PoS, and PoA mechanisms with adjustable parameters
- Benchmark and compare consensus performance using live charts and statistics
- Export chain data and experiment results as CSV or Markdown reports
- Simulate gossip-based message propagation with visual delays and adversarial interference
- Language: Ruby
- Framework: Sinatra
- Frontend: ERB templates, Chart.js
To run the project, simplly do the following:
# Clone the repository
git clone https://github.com/Xinjian-Zhang/coralchain.gitcd coralchain# Install dependencies
bundle install# Start the server
ruby app.rbThe application will be available at http://localhost:4567 by default.
To quickly run CoralChain in a containerized environment using Docker, follow these steps:
# Clone the repository
git clone https://github.com/Xinjian-Zhang/coralchain.git
cd coralchain# Build and start the container
docker-compose up --buildOnce running, visit:
This will launch CoralChain in a self-contained Docker container, making it easy to explore without installing Ruby or dependencies manually.
Author: Xinjian Zhang
Institution: University of Tartu
Date: May 2025
Special thanks to Dr. Mubashar Iqbal for his guidance and support throughout this project.
This project is licensed under the MIT License. See the LICENSE file for details.