- Notifications
You must be signed in to change notification settings - Fork17
An implementation of blockchain from scratch - A student attendance system based on Blockchain technology
License
adeen-s/Blockendance
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
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.
- 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
classBlock:-index:Blockpositioninchain-timestamp:Blockcreationtime-data:Attendancerecords (JSON)-prev_hash:Previousblock'shash-hash:Currentblock'sSHA-256hash
- First block in the chain (index 0)
- No previous hash reference
- Initializes the blockchain
- Cryptographic hash verification
- Block linkage integrity
- Tamper detection algorithms
- Once written, data cannot be modified
- Any tampering breaks the chain
- Cryptographic proof of integrity
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
- 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
- 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
- Responsive Design: Modern Material Design UI
- Form Validation: Client and server-side validation
- Real-time Feedback: Live attendance counting
- Error Handling: Comprehensive error management
- Python 3.6 or higher
- pip package manager
- Clone the repository
git clone https://github.com/adeen-s/Blockendance.gitcd Blockendance
- Install dependencies
pip install Flask
- Run the application
python blockchain.py
- Access the applicationOpen your browser and navigate to
http://localhost:5001
defcreate_genesis_block():genesis_data= {"type":"genesis","message":"Genesis Block - Blockchain Initialized","creator":"Blockendance System" }returnBlock(0,datetime.now(),genesis_data,"0")
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)
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"
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
- Educational: Learn blockchain development
- Proof of Concept: Demonstrate blockchain applications
- Research: Study blockchain behavior
- Development: Base for larger blockchain projects
- 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)
Contributions are welcome! Please feel free to submit a Pull Request.
This project is licensed under the MIT License - see theLICENSE file for details.
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
Uh oh!
There was an error while loading.Please reload this page.