A lightweight and interactive web-based Bitcoin blockchain simulation. This project demonstrates the core mechanics of blockchain mining, transaction processing, and hash calculation in a fun and educational way.
- Real-time Blockchain Mining: Simulate the mining process with adjustable difficulty levels.
- Transaction Processing: Add and verify transactions in a block.
- Dynamic Nonce Adjustment: Visualize how the nonce changes to meet the block difficulty.
- Hashing Demonstration: Observe the SHA-256 hash generation in real-time.
- Responsive UI: Built with modern web technologies for seamless interaction.
- Rust: High-performance systems programming language.
- Leptos: Reactive front-end framework for Rust.
- SHA-256: Secure hashing algorithm for block and transaction validation.
- Install Rust
- Install
cargo-leptos
:cargo install cargo-leptos
-
Clone the repository:
git clone https://github.com/yourusername/bitcoin-simulation-bros.git cd bitcoin-simulation-bros
-
Build and run the project:
cargo leptos watch
-
Open your browser and navigate to:
http://localhost:8080
npx tailwindcss -i ./input.css -o ./tailwind.css --watch
trunk serve --open
trunk build --release
- Adjust Difficulty: Set the difficulty level for mining by changing the
DIFFICULTY
constant in the code. - Mine a Block: Click the "Let's Mining" button to start mining.
- View Real-Time Updates: Watch the
nonce
andhash
update dynamically as the block is mined. - Explore Transactions: Add custom transactions and observe their impact on the block’s hash.