Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

An implementation of blockchain from scratch - A student attendance system based on Blockchain technology

License

NotificationsYou must be signed in to change notification settings

adeen-s/Blockendance

Repository files navigation

A Complete Blockchain-based Attendance System Built from the Ground Up

BlockchainPythonFlaskLicense


🚀 Project Overview

Blockendance is a complete blockchain implementation built from scratch in Python, demonstrating core blockchain concepts through a practical attendance management system. This project showcases how to build a functional blockchain without relying on existing blockchain frameworks.

🎯 What Makes This Special

  • Pure Python Implementation: Every component built from scratch
  • Complete Blockchain Architecture: Genesis block, block creation, chain validation
  • Cryptographic Security: SHA-256 hashing and block linking
  • Real-world Application: Practical attendance management use case
  • Educational Value: Perfect for understanding blockchain fundamentals

🔗 Blockchain Architecture

Core Components

1.Block Structure

classBlock:-index:Blockpositioninchain-timestamp:Blockcreationtime-data:Attendancerecords (JSON)-prev_hash:Previousblock'shash-hash:Currentblock'sSHA-256hash

2.Genesis Block

  • First block in the chain (index 0)
  • No previous hash reference
  • Initializes the blockchain

3.Chain Validation

  • Cryptographic hash verification
  • Block linkage integrity
  • Tamper detection algorithms

4.Data Immutability

  • Once written, data cannot be modified
  • Any tampering breaks the chain
  • Cryptographic proof of integrity

🛠️ Implementation Details

File Structure

Blockendance/├── block.py           # Block class with hashing and validation├── genesis.py         # Genesis block creation├── newBlock.py        # New block creation and addition├── getBlock.py        # Block retrieval and search├── checkChain.py      # Blockchain integrity verification├── blockchain.py      # Main Flask application└── templates/         # Web interface templates

Key Features

🔐Cryptographic Security

  • SHA-256 Hashing: Each block secured with cryptographic hash
  • Chain Linking: Blocks linked via previous block hashes
  • Tamper Detection: Any modification breaks the chain
  • Data Integrity: Immutable record storage

📊Blockchain Operations

  • Block Creation: Automated block generation with proper indexing
  • Chain Validation: Complete integrity checking algorithms
  • Data Retrieval: Efficient search through blockchain
  • Statistics: Real-time blockchain analytics

🌐Web Interface

  • Responsive Design: Modern Material Design UI
  • Form Validation: Client and server-side validation
  • Real-time Feedback: Live attendance counting
  • Error Handling: Comprehensive error management

🚀 Quick Start

Prerequisites

  • Python 3.6 or higher
  • pip package manager

Installation

  1. Clone the repository
git clone https://github.com/adeen-s/Blockendance.gitcd Blockendance
  1. Install dependencies
pip install Flask
  1. Run the application
python blockchain.py
  1. Access the applicationOpen your browser and navigate tohttp://localhost:5001

📖 How It Works

1.Genesis Block Creation

defcreate_genesis_block():genesis_data= {"type":"genesis","message":"Genesis Block - Blockchain Initialized","creator":"Blockendance System"    }returnBlock(0,datetime.now(),genesis_data,"0")

2.Adding New Blocks

defnext_block(last_block,data):this_index=last_block.index+1this_timestamp=datetime.now()this_data=copy.deepcopy(data)this_prev_hash=last_block.hashreturnBlock(this_index,this_timestamp,this_data,this_prev_hash)

3.Chain Validation

defcheck_integrity(chain):fori,blockinenumerate(chain):ifnotblock.is_valid():returnf"Error: Block #{i} has invalid hash"ifi>0andblock.prev_hash!=chain[i-1].hash:returnf"Error: Block #{i} not properly linked"return"Blockchain integrity verified"

🎓 Educational Value

This project demonstrates:

  • Blockchain Fundamentals: Core concepts without complexity
  • Cryptographic Hashing: SHA-256 implementation
  • Data Structures: Linked list of blocks
  • Web Development: Flask framework integration
  • Security Principles: Immutability and integrity

🔍 Use Cases

  • Educational: Learn blockchain development
  • Proof of Concept: Demonstrate blockchain applications
  • Research: Study blockchain behavior
  • Development: Base for larger blockchain projects

⚠️ Important Notes

  • Educational Purpose: This is a simplified blockchain for learning
  • No Consensus: Single-node implementation (no mining/proof-of-work)
  • Centralized: Runs on single Flask server
  • No Persistence: Data lost on restart (can be extended)

🤝 Contributing

Contributions are welcome! Please feel free to submit a Pull Request.

📄 License

This project is licensed under the MIT License - see theLICENSE file for details.

👨‍💻 Author

Adeen Shukla -Initial work -GitHub


Built with ❤️ to demonstrate blockchain technology from scratch

About

An implementation of blockchain from scratch - A student attendance system based on Blockchain technology

Topics

Resources

License

Stars

Watchers

Forks


[8]ページ先頭

©2009-2025 Movatter.jp