{"id":13610121,"url":"https://github.com/cosme12/SimpleCoin","last_synced_at":"2025-04-12T22:32:48.406Z","repository":{"id":39953765,"uuid":"117396598","full_name":"cosme12/SimpleCoin","owner":"cosme12","description":"Just a really simple, insecure and incomplete implementation of a blockchain for a cryptocurrency made in Python as educational material. In other words, a simple Bitcoin clone.","archived":false,"fork":false,"pushed_at":"2023-06-05T04:23:16.000Z","size":175,"stargazers_count":1783,"open_issues_count":33,"forks_count":396,"subscribers_count":85,"default_branch":"master","last_synced_at":"2024-10-29T17:26:03.738Z","etag":null,"topics":["bitcoin","blockchain","cryptocurrency","python"],"latest_commit_sha":null,"homepage":"http://copitosystem.com","language":"Python","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/cosme12.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-01-14T02:51:44.000Z","updated_at":"2024-10-19T08:46:34.000Z","dependencies_parsed_at":"2024-01-18T02:33:18.299Z","dependency_job_id":"bd5112a1-bd00-4428-a108-c6a1ba77c725","html_url":"https://github.com/cosme12/SimpleCoin","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/cosme12%2FSimpleCoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosme12%2FSimpleCoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosme12%2FSimpleCoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/cosme12%2FSimpleCoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/cosme12","download_url":"https://codeload.github.com/cosme12/SimpleCoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223095334,"owners_count":17086613,"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":["bitcoin","blockchain","cryptocurrency","python"],"created_at":"2024-08-01T19:01:41.436Z","updated_at":"2024-11-07T16:30:40.019Z","avatar_url":"https://github.com/cosme12.png","language":"Python","readme":"# SimpleCoin\n\n\n\u003ca href=\"https://www.buymeacoffee.com/cosme12\" target=\"_blank\"\u003e\u003cimg src=\"https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png\" alt=\"Buy Me A Coffee\" style=\"height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;\" \u003e\u003c/a\u003e\n\nJust a really simple, insecure and incomplete implementation of a blockchain for a cryptocurrency made in Python. The goal of this project is to make a working blockchain currency, keeping it as simple as possible and to be used as educational material.\n\n\u003eThis project is just being made for fun. If you want to make your own cryptocurrency you should probably take a look at the [Bitcoin Repository](https://github.com/bitcoin/bitcoin).\n\n\n## What is a blockchain?\n\nTaking a look at the [Bitcoin organization wiki website](https://en.bitcoin.it/wiki/Main_Page) we can find this definition:\n\n\u003eA block chain is a transaction database shared by all nodes participating in a system based on the Bitcoin protocol. A full copy of a currency's block chain contains every transaction ever executed in the currency. With this information, one can find out how much value belonged to each address at any point in history.\n\nIn simpler terms, blockchain can be seen as a distributed ledger recording each transaction in the network. Each transaction is identified by the public key of the block which is a hash function of the private key. The distributed ledger makes data manipulation in the blockchain difficult, nearly impossible. \n\nYou can find more information in the original [Bitcoin Paper](https://bitcoin.org/bitcoin.pdf).\n\n## How to run it\n\nFirst, install ```requirements.txt```.\n\n```\npip install -r requirements.txt\n```\n\nThen you have 2 options:\n\n- Run ```miner.py``` to become a node and start mining\n- Run ```wallet.py``` to become a user and send transactions (to send transactions you must run a node, in other words, you must run ```miner.py``` too)\n\n\u003e Important: DO NOT run it in the python IDLE, run it in your console. The ```miner.py``` uses parallel processing that doesn't work in the python IDLE.\n\n## How this code work?\n\nThere are 2 main scripts:\n\n- ```miner.py```\n- ```wallet.py```\n\n### Miner.py\n\nThis file is probably the most important. Running it will create a node (like a server). From here you can connect to the blockchain and process transactions (that other users send) by mining. As a reward for this work, you recieve some coins. The more nodes exist, the more secure the blockchain gets.\n\n```miner.py``` has 2 processes running in parallel:\n\n1. The first process takes care of mining, updating new blockchains and finding the proof of work.\n\n2. The second process runs the flask server where peer nodes and users can connect to ask for the entire blockchain or submit new transactions.\n\n\u003e Parallel processes don't run in python IDLE, so make sure you are running it from the console.\n\n![miner](https://k60.kn3.net/3/B/3/F/E/C/013.png)\n\nThe following flowchart provides a simple , high-level understanding of what the miner does\n![MinerFlowchart](images/flowchart.png)\n\n### Wallet.py\n\nThis file is for those who don't want to be nodes but simple users. Running this file allows you to generate a new address, send coins and check your transaction history (keep in mind that if you are running this in a local server, you will need a \"miner\" to process your transaction).\nWhen creating a wallet address, a new file will be generated with all your security credentials. You are supposed to keep it safe.\n\n![wallet](https://k60.kn3.net/6/F/E/3/8/2/887.png)\n\n\n## Contribution\n\nAnybody is welcome to collaborate in this project. Feel free to push any pull request (even if you are new to coding). See ```CONTRIBUTING.md``` to learn how to contribute.\n\nNote: the idea of this project is to build a **really simple** blockchain system, so make sure all your code is easy to read (avoid too much code in 1 line) and don't introduce complex updates if they are not critical. In other words, keep it simple.\n\n\n## Disclaimer\n\nBy no means this project should be used for real purposes, it lacks security and may contain several bugs.\n","funding_links":["https://www.buymeacoffee.com/cosme12"],"categories":["Python"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosme12%2FSimpleCoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcosme12%2FSimpleCoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcosme12%2FSimpleCoin/lists"}