{"id":19197179,"url":"https://github.com/hawshemi/blockchain","last_synced_at":"2025-08-21T06:31:19.362Z","repository":{"id":64262439,"uuid":"572825814","full_name":"hawshemi/Blockchain","owner":"hawshemi","description":"A Simple Blockchain","archived":false,"fork":false,"pushed_at":"2023-08-22T11:42:08.000Z","size":449,"stargazers_count":127,"open_issues_count":0,"forks_count":55,"subscribers_count":4,"default_branch":"master","last_synced_at":"2024-12-11T20:11:05.285Z","etag":null,"topics":["blockchain","cs50x","flask","python","webapp"],"latest_commit_sha":null,"homepage":"https://blockchain.up.railway.app","language":"HTML","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/hawshemi.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2022-12-01T05:29:12.000Z","updated_at":"2024-11-06T15:00:50.000Z","dependencies_parsed_at":"2023-01-28T14:02:38.101Z","dependency_job_id":null,"html_url":"https://github.com/hawshemi/Blockchain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawshemi%2FBlockchain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawshemi%2FBlockchain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawshemi%2FBlockchain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/hawshemi%2FBlockchain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/hawshemi","download_url":"https://codeload.github.com/hawshemi/Blockchain/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":230494921,"owners_count":18235046,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["blockchain","cs50x","flask","python","webapp"],"created_at":"2024-11-09T12:15:45.388Z","updated_at":"2024-12-19T20:08:39.984Z","avatar_url":"https://github.com/hawshemi.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# **Blockchain**\n\n## **A Simple Blockchain By Hawshemi**\n### **Live Website: https://blockchain.up.railway.app**\n#### Video Demo: https://youtu.be/iEPosDOyiPg\n_This project submitted at CS50 Final Project._\n\n\n---\n## Website Features\n- Registration and Logins with password hashing.\n- Password Validation Check\n- Handle Errors with codes.\n- Check the Blockchain integrity.\n- Make a Transaction on the blockchain.\n- Review the Transaction History Table.\n- Ability to export to XLS.\n- Ability to Reset the blockchain.\n- Logout\n\n## The Blockchain\n- Stores the block information on a JSON file.\n- Read the JSON and view to blocks.\n- Validate the blocks using their hash.\n- Store the JSON and blocks in a Database.\n\n## Database and Tables\nThe database consists of 3 tables:\n- The _users_ containing userid, username and hashed password.\n- The _sequence_ that stores the number of users and transactions.\n- The _transcaction_ table contains all block information, including number, receiver, sender, amount, timestamp, and transaction_id.\n\nUsers can see the blockchain integrity on the main page after login. But they can only see their transactions in the history tab.\n\n## Tech Stack\nThe site was built using Flask(Python), SQLite3 for the database, CSS for Styling and some Javascript for button actions, exports, and background particles.\n\n---\n# How to run\n## This repo is hosted on [blockchain.up.railway.app](https://blockchain.up.railway.app).\n\n### For Local Run:\n0. Clone the GitHub project.\n\n1. go to `main.py` and at the end of the file, edit:\n\n    ```\n    if __name__ == \"__main__\":\n        app.run(debug=True, host='0.0.0.0', port=os.getenv(\"PORT\", default=5000))\n    ```\n    To:\n\n    ```\n    if __name__ == \"__main__\":\n        app.run(debug=True)\n    ```\n\n\n2. Create a virtual environment of python and then run:\n\n    ```\n    pip install -r requirements.txt\n    ```\n\n    And then: \n\n    ```\n    python main.py\n    ```\n\n---\n# How this works?\nFirst, we have a `blockchain` folder which contains the blocks JSON.\n\nThe blocks are created in the `block.py` file (`def write_block`). The Genesis block is file number `1` in the folder(DO NOT DELETE THIS FILE). For hashing, it uses the `hashlib` library. \n\n`hashlib.md5(content).hexdigest()`\n\nWhen a new block is created, it generates a hash, and then the old hash is compared to the new one for an integrity check.\n\nIn `main.py`, the flask app would run, and all the routing for HTML.\n\n---\nFor more information of how blockchians work:\nhttps://www.investopedia.com/terms/b/blockchain.asp\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawshemi%2Fblockchain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhawshemi%2Fblockchain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhawshemi%2Fblockchain/lists"}