{"id":24594452,"url":"https://github.com/itsksaurabh/blockchain-cryptocurrency-node","last_synced_at":"2026-04-06T03:31:32.721Z","repository":{"id":144393177,"uuid":"137387654","full_name":"itsksaurabh/Blockchain-Cryptocurrency-Node","owner":"itsksaurabh","description":"A powerful and secure decentralised Blockchain Network with CryptoCurrency.","archived":false,"fork":false,"pushed_at":"2020-03-15T18:23:51.000Z","size":127,"stargazers_count":10,"open_issues_count":0,"forks_count":6,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-30T13:15:02.623Z","etag":null,"topics":["api","blockchain","blockchain-technology","cryptocurrency","cryptocurrency-exchanges","cryptography","nodejs"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","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/itsksaurabh.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"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,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-06-14T17:17:26.000Z","updated_at":"2024-05-28T12:25:07.000Z","dependencies_parsed_at":null,"dependency_job_id":"4cd144ba-f7a3-43d6-815f-027e96df2702","html_url":"https://github.com/itsksaurabh/Blockchain-Cryptocurrency-Node","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/itsksaurabh/Blockchain-Cryptocurrency-Node","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsksaurabh%2FBlockchain-Cryptocurrency-Node","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsksaurabh%2FBlockchain-Cryptocurrency-Node/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsksaurabh%2FBlockchain-Cryptocurrency-Node/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsksaurabh%2FBlockchain-Cryptocurrency-Node/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/itsksaurabh","download_url":"https://codeload.github.com/itsksaurabh/Blockchain-Cryptocurrency-Node/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/itsksaurabh%2FBlockchain-Cryptocurrency-Node/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31458837,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-05T21:22:52.476Z","status":"online","status_checked_at":"2026-04-06T02:00:07.287Z","response_time":112,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["api","blockchain","blockchain-technology","cryptocurrency","cryptocurrency-exchanges","cryptography","nodejs"],"created_at":"2025-01-24T11:14:49.964Z","updated_at":"2026-04-06T03:31:32.715Z","avatar_url":"https://github.com/itsksaurabh.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Node-Blockchain-CryptoCurrency\n\n[![itsksaurabh](https://circleci.com/gh/itsksaurabh/Blockchain-Cryptocurrency-Node.svg?style=shield)](https://app.circleci.com/jobs/github/itsksaurabh/Blockchain-Cryptocurrency-Node/14)\n[![MIT License](https://img.shields.io/github/license/itsksaurabh/Blockchain-Cryptocurrency-Node)](http://opensource.org/licenses/MIT)\n___\nA powerful and secure decentralized Blockchain Network with CryptoCurrency.\n\n- References : \u003ca href=\"https://bitcoin.org/bitcoin.pdf\"\u003eBitcoin White Paper - Bitcoin: A Peer-to-Peer Electronic Cash System By Satoshi Nakamoto\u003c/a\u003e\n\n# Features\n\n- It includes an API to interact with the Blockchain.\n- It signs Transactions with \u003cstrong\u003ecryptography\u003c/strong\u003e and \u003cstrong\u003edigital signature\u003c/strong\u003e.\n- Secured Wallets\n- Supports Real-time exchange of CryptoCurrency.\n- Generate hashes for blocks in the chain.\n- Real-time connected peer-to-peer server using \u003cstrong\u003eWebSockets\u003c/strong\u003e.\n- Proof-of-work algorithm implemented.\n- Transaction Pool for a real-time list of incoming data.\n- Mining \n\n# Installation\n\nYou can Run the following command using Terminal/CMD:\n```\n$npm install\n```\n\n\n# Usage\n\nThe API is built with NodeJS and Express.You can interact with the API.\n\u003cbr\u003e\nFor demonstration:\n\n```Note :```Requires Nodemon\n- Run the server:\n  ```\n  $npm run dev \n  ```\n  Output :\n  ```\n  \u003e nodemon ./app\n\n  [nodemon] 1.17.5\n  [nodemon] to restart at any time, enter `rs`\n  [nodemon] watching: *.*\n  [nodemon] starting `node ./app.js`\n  Listening for Peer-to-Peer connections on port : 5000\n  server started on port 3000\n\n\n  ```\n  \n- To start another instance (peer)\n  ```\n  $ HTTP_PORT=3001 P2P_PORT=5001 PEERS=ws://localhost:5000 npm run dev\n  ```\n  Output :\n  ```\n   \u003e nodemon ./app\n\n   [nodemon] 1.17.5\n   [nodemon] to restart at any time, enter `rs`\n   [nodemon] watching: *.*\n   [nodemon] starting `node ./app.js`\n   Listening for Peer-to-Peer connections on port : 5001\n   server started on port 3001\n   Socket Connected!\n   Received chain is not longer than the current chain.\n\n  ```\n# Methods  \n- To get all the blocks of the blockchain \n \n  \u003cstrong\u003eGET\u003c/strong\u003e ```http://localhost:3000/blocks```\n    \n  Response:\n  ```\n  [\n    {\n        \"timeStamp\": \"Genesis Time\",\n        \"lastHash\": \"----\",\n        \"hash\": \"k1S2-P1s2\",\n        \"data\": [],\n        \"nonce\": 0,\n        \"difficulty\": 4\n    }\n   ]\n  ```\n- To get own Public Key\n \n  \u003cstrong\u003eGET\u003c/strong\u003e ```http://localhost:3000/publicKey```\n    \n  Response:\n  ```\n  {\n    \"PublicKey\": \"049130b76348c0ff2ff7c268f1c3344c50859309e9b767f34bd63e3683aa12bb3442cba91de6fd6e5f75868cdd955b0f34e23adfc305c18f39c54c2e588d361926\"\n  }\n  ```\n- Mine or add blocks to the blockchain\n \n  \u003cstrong\u003ePOST\u003c/strong\u003e ```http://localhost:3000/mine```\n  \n  JSON Input :\n  ```\n  {\n  \"data\" : \"foo-bar\"\n  }\n  ```\n\n\n  Response:\n  ```\n    [\n    {\n        \"timeStamp\": \"Genesis Time\",\n        \"lastHash\": \"----\",\n        \"hash\": \"k1S2-P1s2\",\n        \"data\": [],\n        \"nonce\": 0,\n        \"difficulty\": 4\n    },\n    {\n        \"timeStamp\": 1529268657715,\n        \"lastHash\": \"k1S2-P1s2\",\n        \"hash\": \"000fa69a765a699bfc58c24781412ba738232f5af29e3bde0f9fba47d16d3006\",\n        \"data\": \"foo-bar\",\n        \"nonce\": 7211,\n        \"difficulty\": 3\n    }\n    ]\n  ```\n  \n- To perform Transaction And Send Cryptocurrency using someone's Public key\n \n  \u003cstrong\u003ePOST\u003c/strong\u003e ```http://localhost:3000/transact```\n  \n  \n   JSON Input :\n  ```\n  {\n\t\"recipient\" : \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\",\n\t\"amount\"\t: 50\n  }\n  ```\n    \n  Response:\n  ```\n  [\n    {\n        \"id\": \"8676c910-7272-11e8-86ef-85c52672e7ed\",\n        \"input\": {\n            \"timeStamp\": 1529269684257,\n            \"amount\": 500,\n            \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\",\n            \"signature\": {\n                \"r\": \"861d22558e1387ea4e081c156dd796b24fd2ba783b218ffc7a853207f2361b68\",\n                \"s\": \"cf5677f392142cd083df68189b3200a19e32e2ea1da34d63c2a188ef8a0a6186\",\n                \"recoveryParam\": 0\n            }\n        },\n        \"outputs\": [\n            {\n                \"amount\": 450,\n                \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\"\n            },\n            {\n                \"amount\": 50,\n                \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n            }\n        ]\n    }\n  ]\n  ```\n  \n- To get all valid transactions\n \n  \u003cstrong\u003eGET\u003c/strong\u003e ```http://localhost:3000/transactions```\n    \n  Response:\n  ```\n   [\n    {\n        \"id\": \"8676c910-7272-11e8-86ef-85c52672e7ed\",\n        \"input\": {\n            \"timeStamp\": 1529269684257,\n            \"amount\": 500,\n            \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\",\n            \"signature\": {\n                \"r\": \"861d22558e1387ea4e081c156dd796b24fd2ba783b218ffc7a853207f2361b68\",\n                \"s\": \"cf5677f392142cd083df68189b3200a19e32e2ea1da34d63c2a188ef8a0a6186\",\n                \"recoveryParam\": 0\n            }\n        },\n        \"outputs\": [\n            {\n                \"amount\": 450,\n                \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\"\n            },\n            {\n                \"amount\": 50,\n                \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n            }\n        ]\n    },\n    {\n        \"id\": \"3f0f8f70-7273-11e8-a5c5-f977b3bc0a96\",\n        \"input\": {\n            \"timeStamp\": 1529269993959,\n            \"amount\": 500,\n            \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\",\n            \"signature\": {\n                \"r\": \"9087affe4996cf63431214ed6e6081739cefdf2dba090b36b71c017a34eb5d87\",\n                \"s\": \"e7bce503b37bee6246faf42822e8ba5f5a9e9ab07cabf66eb754674322939047\",\n                \"recoveryParam\": 1\n            }\n        },\n        \"outputs\": [\n            {\n                \"amount\": 400,\n                \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n            },\n            {\n                \"amount\": 100,\n                \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\"\n            }\n        ]\n    }\n    ]\n  ```\n- Mine transactions to add rewards to the Miners\n \n \u003cp\u003eBy default each miner will get 50 Reward points for mining \u003c/p\u003e\n \n  \u003cstrong\u003eGET\u003c/strong\u003e ```http://localhost:3001/mine-transactions```\n    \n  Response:\n  ```\n  [\n    {\n        \"timeStamp\": \"Genesis Time\",\n        \"lastHash\": \"----\",\n        \"hash\": \"k1S2-P1s2\",\n        \"data\": [],\n        \"nonce\": 0,\n        \"difficulty\": 4\n    },\n    {\n        \"timeStamp\": 1529270176969,\n        \"lastHash\": \"k1S2-P1s2\",\n        \"hash\": \"00009971fd40b7bf881bf5972cef499ebdf1628d97457d599e2162d9dcf8a846\",\n        \"data\": [\n            {\n                \"id\": \"8676c910-7272-11e8-86ef-85c52672e7ed\",\n                \"input\": {\n                    \"timeStamp\": 1529269684257,\n                    \"amount\": 500,\n                    \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\",\n                    \"signature\": {\n                        \"r\": \"861d22558e1387ea4e081c156dd796b24fd2ba783b218ffc7a853207f2361b68\",\n                        \"s\": \"cf5677f392142cd083df68189b3200a19e32e2ea1da34d63c2a188ef8a0a6186\",\n                        \"recoveryParam\": 0\n                    }\n                },\n                \"outputs\": [\n                    {\n                        \"amount\": 450,\n                        \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\"\n                    },\n                    {\n                        \"amount\": 50,\n                        \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n                    }\n                ]\n            },\n            {\n                \"id\": \"3f0f8f70-7273-11e8-a5c5-f977b3bc0a96\",\n                \"input\": {\n                    \"timeStamp\": 1529269993959,\n                    \"amount\": 500,\n                    \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\",\n                    \"signature\": {\n                        \"r\": \"9087affe4996cf63431214ed6e6081739cefdf2dba090b36b71c017a34eb5d87\",\n                        \"s\": \"e7bce503b37bee6246faf42822e8ba5f5a9e9ab07cabf66eb754674322939047\",\n                        \"recoveryParam\": 1\n                    }\n                },\n                \"outputs\": [\n                    {\n                        \"amount\": 400,\n                        \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n                    },\n                    {\n                        \"amount\": 100,\n                        \"address\": \"0423141eab6d1875ae22a96dac794328ba962913bdbbb6a7e1c9cfb4ffd0e7989fac58a722d79b4a5891fb8875831e20e9e54e58856ac074ef15eb7d6ef3a0a761\"\n                    }\n                ]\n            },\n            {\n                \"id\": \"abfa8e50-7273-11e8-a5c5-f977b3bc0a96\",\n                \"input\": {\n                    \"timeStamp\": 1529270176693,\n                    \"amount\": 500,\n                    \"address\": \"0480773fa0af4a2978eb78863df0576aa4105d92dba27cdc39559e1ff1720053f05b6e799221243e6721cb59d33ebd6d4f0fbba0e88c73abc5abcce0900e67a228\",\n                    \"signature\": {\n                        \"r\": \"32784816ab2fcb83f3521d41ac2044fc036fd3900e98fee42b93c59307badd\",\n                        \"s\": \"f2b20c66d961e740cf90c9f75e92b290dc7faacc7bd05fdb70b136ae96f66db0\",\n                        \"recoveryParam\": 0\n                    }\n                },\n                \"outputs\": [\n                    {\n                        \"amount\": 50,\n                        \"address\": \"047648c967013eec3f332d103227eee7decde237cac3984bb9523f70f6cbc486060906f412f19039d70f8892a9b388a51664a740adca61e7386a038cb99ce42864\"\n                    }\n                ]\n            }\n        ],\n        \"nonce\": 10134,\n        \"difficulty\": 3\n    }\n  ]\n  ```\n# Integration Tests\n\nYou can run integration tests using the following command :\n   ```\n   $npm run test\n   ```\n   ```Note ```: Testing requires \u003ca href=\"https://facebook.github.io/jest/\"\u003eJEST\u003c/a\u003e\n   \n# Requirements\n- Node.js \n\n# Dependencies\n - body-parser ^1.18.3 \n - crypto-js   ^3.1.9-1\n - elliptic    ^6.4.0\n - express     ^4.16.3\n -  uuid       ^3.2.1\n -  WebSockets ^5.2.0\n \n# Dev Dependencies\n\n- jest ^23.1.0 \n- nodemon ^1.17.5\n\n# Contributing\nI welcome pull requests, bug fixes and issue reports. Before proposing a change, please discuss your change by raising an issue.\n\n# License\nThis is distributed under the MIT license found in the \u003ca href=\"https://github.com/itsksaurabh/Blockchain-Cryptocurrency-Node/blob/master/LICENSE\"\u003eLICENSE\u003c/a\u003e file.\n\n\n# Author\n\u003cul\u003e\n  \u003cli\u003e\u003ca href=\"https://in.linkedin.com/in/itsksaurabh\"\u003eKumar Saurabh\u003c/a\u003e\u003c/li\u003e\n\u003c/ul\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsksaurabh%2Fblockchain-cryptocurrency-node","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fitsksaurabh%2Fblockchain-cryptocurrency-node","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fitsksaurabh%2Fblockchain-cryptocurrency-node/lists"}