Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/aksh-bansal-dev/blockchain-typescript-example
A simple blockchain built with typescript
https://github.com/aksh-bansal-dev/blockchain-typescript-example
Last synced: 25 days ago
JSON representation
A simple blockchain built with typescript
- Host: GitHub
- URL: https://github.com/aksh-bansal-dev/blockchain-typescript-example
- Owner: Aksh-Bansal-dev
- Created: 2021-05-21T11:02:03.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-05-21T17:14:07.000Z (over 3 years ago)
- Last Synced: 2024-11-20T11:05:32.806Z (3 months ago)
- Language: JavaScript
- Homepage:
- Size: 3.91 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Blockchain Example
A simple blockchain built with typescript
## How it works
A blockchain can be considered as a chain or collection of blocks and these blocks are made of data (or transactions in the case of a cryptocurrency).
Each block has a unique hash and also a hash of prev block. If anyone tries to change data in a block then its hash will also change. This ensures that the blockchain is not manipulated by anyone.
It's also important to prevent people from spamming blocks in the blockchain. To solve this problem, blockchains use something called ***proof of work***.
The person wanting to add a new block to the blockchain has to perform some work to get his block merged with blockchain. In this example, we
make sure that the hash of a block must start with 2 or more consecutive zeros(actual blockchains use a lot more than that) to keep things simple.
A person who generates this hash is often called a ***miner***. Miners also get some reward for doing this work(obviously not in this exampleπ).