{"id":48617675,"url":"https://github.com/webceyhan/vite-chain","last_synced_at":"2026-04-09T02:12:55.550Z","repository":{"id":37213015,"uuid":"483562295","full_name":"webceyhan/vite-chain","owner":"webceyhan","description":"ViteChain - Blockchain Demo","archived":false,"fork":false,"pushed_at":"2024-04-03T17:55:13.000Z","size":1137,"stargazers_count":1,"open_issues_count":8,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2024-05-28T21:08:10.084Z","etag":null,"topics":["bitcoin","blockchain","bootstrap","cryptography","css","express","html","javascript","nodejs","p2p","proof-of-work","rest","sse","typescript","vite","vue","web3","websocket"],"latest_commit_sha":null,"homepage":"https://webceyhan-vite-chain.onrender.com/","language":"TypeScript","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/webceyhan.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}},"created_at":"2022-04-20T08:03:47.000Z","updated_at":"2024-05-28T21:08:10.084Z","dependencies_parsed_at":"2023-12-24T12:29:45.127Z","dependency_job_id":"f029c9a0-92b4-4af4-9cad-02812b8048cc","html_url":"https://github.com/webceyhan/vite-chain","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/webceyhan/vite-chain","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webceyhan%2Fvite-chain","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webceyhan%2Fvite-chain/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webceyhan%2Fvite-chain/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webceyhan%2Fvite-chain/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/webceyhan","download_url":"https://codeload.github.com/webceyhan/vite-chain/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/webceyhan%2Fvite-chain/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":31581889,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-08T14:31:17.711Z","status":"online","status_checked_at":"2026-04-09T02:00:06.848Z","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":["bitcoin","blockchain","bootstrap","cryptography","css","express","html","javascript","nodejs","p2p","proof-of-work","rest","sse","typescript","vite","vue","web3","websocket"],"created_at":"2026-04-09T02:12:55.390Z","updated_at":"2026-04-09T02:12:55.511Z","avatar_url":"https://github.com/webceyhan.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003c!-- AUTOMATION BADGES --\u003e\n\n[![CodeQL](https://github.com/webceyhan/vite-chain/actions/workflows/github-code-scanning/codeql/badge.svg)](https://github.com/webceyhan/vite-chain/actions/workflows/github-code-scanning/codeql)\n\n\u003c!-- LOGO (OPTIONAL) --\u003e\n\n\u003c!-- \u003cimg src=\"./src/assets/logo.png\" width=\"100px\"\u003e --\u003e\n\n \u003c!-- HEADER ///////////////////////////////////////////////////////////// --\u003e\n\n# ViteChain - Blockchain Application\n\nThis is a tiny blockchain application that demonstrates the core concepts of blockchain technology.\n\nIt consists of a backend node and a frontend application.\n\nBackend node is a node that runs on a server and is responsible for storing and retrieving data from the blockchain.\nCore functionality is to create a new block (mining), add data to the block (transactions), and add the block to the blockchain.\nEach node can interact with other nodes using the P2P protocol to provide a distributed system and keep in sync with each other.\n\nBackend server is built on ExpressJs and responsible for serving the compiled frontend app as static content,\nproviding rest API and SSE events to the frontend, and listening to P2P connections using Websockets for real-time communication.\n\nFrontend application is used to interact with the backend node and to visualize the blockchain. It works in the same way\nas Etherscan website does to display the blockchain information and transactions. App is built with Vite + Vue + Bootstrap.\nClient can fetch real-time blockchain data using SSE (Server-Sent Events) to show on the dashboard.\n\n\u003cbr\u003e\n\u003c!-- BLOCKCHAIN /////////////////////////////////////////////////////// --\u003e\n\n## Blockchain Concepts and Architecture\n\n-   Core architecture:\n    -   **Chain**: Collection of blocks.\n    -   **Block**: A piece of data that is stored in the blockchain.\n    -   **Transaction**: A record to transfer funds from one account to another.\n    -   **CoinPool**: A pool that keeps track of the total amount of coins associated with each account in the blockchain.\n-   Network:\n    -   **P2P**: A network of computers (peers) that can communicate with each other without a central server.\n    -   **Rest API**: A way to access blockchain data from public (wallets, dapps, blockchain explorers, etc.)\n        -   **Explorer**: A way to visualize the blockchain on the web.\n        -   **Wallet**: A digital wallet that stores and manages your funds.\n\n### Chain\n\nChain is a collection of blocks that are linked together.\n\nIt keeps track of the history of transactions, current state of the CoinPool (amount of coins in circulation), and the current state of the blockchain.\n\nIt contains the logic to create a new block, process transactions of the block, update / replace the state of the blockchain, calculate the current block difficulty and max supply of coins.\n\nFor the simplicity of the demo, i don't use UTXO (Unspent Transaction Output) model.\nInstead, CoinPool is used to keep track of the amount of coins in circulation.\n\n### Block\n\nA block is a piece of data that is stored in the blockchain in a chainable way.\nIt contains the index number, the hash of the previous block, the hash of the block itself, a list of transactions, difficulty, nonce, and a timestamp.\n\nEvery block is linked to the previous block by the hash of the previous block.\nBlock index is a sequential number that starts from 0 (the genesis block).\n\n### Transaction\n\nIn ViteChain, there are 2 type of transactions:\n\n1. Transfer transaction:\n   When a user transfers funds to another user, a transfer transaction is created.\n   Sender has to sign the transaction and send it to the blockchain.\n   After transaction is verified using signature and public key of the sender,\n   it will be added to the blockchain (confirmed).\n\n2. Coinbase transaction:\n   When a new block is created, a coinbase transaction is created by the node that mines the block. It is a special transaction that is used to reward miners.\n   The amount is a sum of transaction fees and mining reward of that block.\n\n### Wallet\n\nA wallet is a set of private and public keys that are used to sign transactions.\nIt also contains the address of the wallet which is derived from the public key using base58Check encoding and prefixed with 'vt' (referred to the first 2 characters of VTC ViteChain Coin).\n\nYou can create a new wallet with random keys or import a wallet from a private key in different formats such as WiF, mnemonic, raw private key, etc.\n\nIn this demo, we use raw private key or WiF (Wallet Import Format) to export / import a wallet.\n\n### Node\n\nNode is a computer that runs on a server and is responsible for storing and retrieving data from the blockchain.\n\nIt tries to keep the blockchain in sync with other nodes, while trying to mine new blocks and reward the miner that runs the node.\n\nDuring the mining process, the node will try to find a valid block that satisfies the difficulty requirement using the proof of work algorithm. If a valid block is found, it will be added to the blockchain with pending transactions.\n\n\u003cbr\u003e\n\u003c!-- REQUIREMENTS /////////////////////////////////////////////////////// --\u003e\n\n## Requirements\n\nYou need to install the [Node.js](https://nodejs.dev/)\nand `npm` package manager first.\n\n\u003e Recommended IDE:\n\u003e [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=johnsoncodehk.volar)\n\n\u003cbr\u003e\n\u003c!-- INSTALLATION //////////////////////////////////////////////////////// --\u003e\n\n## Installation\n\n1. Clone the repository.\n    ```sh\n    git clone https://github.com/webceyhan/vite-chain.git\n    ```\n2. Get inside the cloned project folder.\n    ```sh\n    cd vite-chain\n    ```\n3. Install NPM packages.\n    ```sh\n    npm install\n    ```\n\n\u003cbr\u003e\n\u003c!-- USAGE /////////////////////////////////////////////////////////////// --\u003e\n\n## Usage\n\nYou can use following commands to do various task with the project.\n\n```sh\nnpm start               # run application\nnpm run dev             # start watching backend \u0026 frontend concurrently\nnpm run dev2            # start 2nd instance of the application to simulate P2P network\nnpm run dev:backend     # start nodemon to watch blockchain node\nnpm run dev:frontend    # start vite to watch frontend app\nnpm run build           # build for production\nnpm run preview         # preview built app\nnpm run test            # run unit tests\nnpm run test:watch      # run unit tests in watch mode\n```\n\n\u003e Take a look at the other scripts in [`package.json`](./package.json)\n\n\u003cbr\u003e\n\u003c!-- DEVELOPMENT ///////////////////////////////////////////////////////// --\u003e\n\n## Development\n\nYou have to run both backend server and frontend development server concurrently to be able to develop application properly.\n\n```sh\nnpm run dev\n```\n\nTo simulate P2P network, you can run 2nd instance of the application.\n\n```sh\nnpm run dev2\n```\n\n\u003cbr\u003e\n\u003c!-- BUILDING //////////////////////////////////////////////////////////// --\u003e\n\n## Building\n\nBuild the frontend application for production.\n\n```sh\nnpm run build\n```\n\nTo preview, you still have to run the backend server which will serve the app and provide socket connectivity in order to make it work properly.\n\n```sh\nnpm run preview\n```\n\n\u003cbr\u003e\n\u003c!-- DEPLOYMENT ////////////////////////////////////////////////////////// --\u003e\n\n## Deployment (Render)\n\nProject is linked to [Render](https://render.com/) for deployment.\n\n\u003e It will automatically deploy the project to Render on every push.\n\n\u003cbr\u003e\n\u003c!-- REFERENCES ////////////////////////////////////////////////////////// --\u003e\n\n## References\n\n-   [Node.js](https://nodejs.dev/)\n-   [Vite](https://vitejs.dev/)\n-   [Vue.js](https://vuejs.org/)\n-   [Bootstrap](https://getbootstrap.com)\n-   [Express.js](https://expressjs.com/)\n-   [SSE](https://developer.mozilla.org/en-US/docs/Web/API/Server-sent_events)\n-   [WebSockets](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API)\n-   [WebSocket (WS)](https://github.com/websockets/ws)\n-   [Mastering Bitcoin](https://www.oreilly.com/library/view/mastering-bitcoin/9781491902639/ch01.html)\n    -   [Naivecoin](https://github.com/lhartikk/naivecoin)\n    -   [SavjeeCoin](https://github.com/Savjee/SavjeeCoin)\n    -   [Build your own Blockchain in Javascript](https://github.com/nambrot/blockchain-in-js)\n    -   [python_blockchain_app](https://github.com/satwikkansal/python_blockchain_app)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebceyhan%2Fvite-chain","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwebceyhan%2Fvite-chain","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwebceyhan%2Fvite-chain/lists"}