{"id":13493594,"url":"https://github.com/Savjee/SavjeeCoin","last_synced_at":"2025-03-28T12:31:59.332Z","repository":{"id":25830820,"uuid":"105263520","full_name":"Savjee/SavjeeCoin","owner":"Savjee","description":"A simple blockchain in Javascript. For educational purposes only.","archived":false,"fork":false,"pushed_at":"2025-02-15T09:20:47.000Z","size":897,"stargazers_count":1750,"open_issues_count":1,"forks_count":750,"subscribers_count":87,"default_branch":"master","last_synced_at":"2025-03-23T03:02:39.635Z","etag":null,"topics":["blockchain","cryptography","wallet"],"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/Savjee.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}},"created_at":"2017-09-29T11:09:55.000Z","updated_at":"2025-03-15T14:02:56.000Z","dependencies_parsed_at":"2025-03-01T16:00:21.873Z","dependency_job_id":"66aabc27-1aad-4590-a695-4d4074ed155f","html_url":"https://github.com/Savjee/SavjeeCoin","commit_stats":{"total_commits":115,"total_committers":12,"mean_commits":9.583333333333334,"dds":"0.33913043478260874","last_synced_commit":"cd1dca61d896ed73016df65f9b777f3777f829c3"},"previous_names":["savjeetutorials/savjeecoin"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savjee%2FSavjeeCoin","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savjee%2FSavjeeCoin/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savjee%2FSavjeeCoin/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Savjee%2FSavjeeCoin/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Savjee","download_url":"https://codeload.github.com/Savjee/SavjeeCoin/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246030543,"owners_count":20712397,"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","cryptography","wallet"],"created_at":"2024-07-31T19:01:16.907Z","updated_at":"2025-03-28T12:31:54.322Z","avatar_url":"https://github.com/Savjee.png","language":"JavaScript","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"\" rel=\"noopener\"\u003e\n \u003cimg width=200px height=200px src=\"https://i.imgur.com/VELRxXl.png\" alt=\"Project logo\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\n\u003ch3 align=\"center\"\u003eSavjeeCoin\u003c/h3\u003e\n\n\u003cdiv align=\"center\"\u003e\n\n  [![.github/workflows/ci.yml](https://github.com/Savjee/SavjeeCoin/actions/workflows/ci.yml/badge.svg)](https://github.com/Savjee/SavjeeCoin/actions/workflows/ci.yml)\n  [![Coverage Status](https://coveralls.io/repos/github/Savjee/SavjeeCoin/badge.svg?branch=master)](https://coveralls.io/github/Savjee/SavjeeCoin?branch=master)\n  [![GitHub Issues](https://img.shields.io/github/issues/Savjee/SavjeeCoin.svg)](https://github.com/Savjee/SavjeeCoin/issues)\n  [![GitHub Pull Requests](https://img.shields.io/github/issues-pr/Savjee/SavjeeCoin.svg)](https://github.com/Savjee/SavjeeCoin/pulls)\n  [![License](https://img.shields.io/badge/license-MIT-blue.svg)](/LICENSE)\n\n\u003c/div\u003e\n\n---\n\n*⚠️ For education purposes only. This is by no means a complete implementation and it is by no means secure!*\n\n## Features\n\n* Simple proof-of-work algorithm\n* Verify blockchain (to prevent tampering)\n* Generate wallet (private/public key)\n* Sign transactions\n\n## 🏁 Getting Started \u003ca name = \"getting_started\"\u003e\u003c/a\u003e\n\n### Install library\n```\nnpm install --save savjeecoin\n```\n\n### Generate a keypair\nTo make transactions on this blockchain you need a keypair. The public key becomes your wallet address and the private key is used to sign transactions.\n\n```js\nconst EC = require('elliptic').ec;\nconst ec = new EC('secp256k1');\n\nconst myKey = ec.genKeyPair();\n```\n\nThe `myKey` object now contains your public \u0026 private key:\n\n```js\nconsole.log('Public key:', myKey.getPublic('hex'));\nconsole.log('Private key:', myKey.getPrivate('hex'));\n```\n\n### Create a blockchain instance\nNow you can create a new instance of a Blockchain:\n\n```js\nconst {Blockchain, Transaction} = require('savjeecoin');\n\nconst myChain = new Blockchain();\n```\n\n### Adding transactions\n```js\n// Transfer 100 coins from my wallet to \"toAddress\"\nconst tx = new Transaction(myKey.getPublic('hex'), 'toAddress', 100);\ntx.sign(myKey);\n\nmyChain.addTransaction(tx);\n```\n\nTo finalize this transaction, we have to mine a new block. We give this method our wallet address because we will receive a mining reward:\n\n```js\nmyChain.minePendingTransactions(myKey.getPublic('hex'));\n```\n\n\n---\n\n## 📽 Video tutorial\nThis source code comes from [my video series on YouTube](https://www.youtube.com/watch?v=zVqczFZr124\u0026list=PLzvRQMJ9HDiTqZmbtFisdXFxul5k0F-Q4). You can check them here:\n\n| Video 1: Simple implementation | Video 2: Adding Proof-of-work |\n:-------------------------:|:-------------------------:\n[![](https://img.youtube.com/vi/zVqczFZr124/maxresdefault.jpg)](https://www.youtube.com/watch?v=zVqczFZr124) | [![](https://img.youtube.com/vi/HneatE69814/maxresdefault.jpg)](https://www.youtube.com/watch?v=HneatE69814)\n| Video 3: Mining rewards \u0026 transactions | Video 4: Signing transactions |\n[![](https://img.youtube.com/vi/fRV6cGXVQ4I/maxresdefault.jpg)](https://www.youtube.com/watch?v=fRV6cGXVQ4I) | [![](https://img.youtube.com/vi/kWQ84S13-hw/maxresdefault.jpg)](https://www.youtube.com/watch?v=kWQ84S13-hw)\n| Video 5: Building a front-end in Angular\n[![](https://img.youtube.com/vi/AQV0WNpE_3g/maxresdefault.jpg)](https://www.youtube.com/watch?v=AQV0WNpE_3g) |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSavjee%2FSavjeeCoin","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FSavjee%2FSavjeeCoin","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FSavjee%2FSavjeeCoin/lists"}