Skip to content

morion4000/javascript-blockchain

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

43 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

JavaScript Blockchain

Abstract

This is a naive implementation of a Blockchain. It is for learning purposes and it tries to simplify the complex technology stack and concepts of a real Blockchain. There are no optimisations or security practises implemented.

Functionality

  • simple transactions (UTXO)
  • static difficulty
  • static mining rewards
  • basic wallet (secp256k1)
  • transaction fee
  • block size limit
  • miner configurations (min transaction fee)
  • persistent storage (sqlite, file)
  • communication protocol (sockets, JSON-RPC, REST)
  • P2P network (socket.io, libp2p)
  • transaction broadcasting
  • consensus protocol (longest chain, BFT)
  • validations (transactions, blocks)
  • CLI tools (wallet, miner, node)
  • consensus algorithms (POW (SHA256), POS, DPOS)
  • mining pool (Stratum, Getwork, Getblocktemplate)
  • payment mechanisms (PPS, PPLNS)
  • Merkle tree for transactions
  • SPV
  • complex transactions (script)
  • dynamic difficulty
  • dynamic mining rewards (halving)
  • transactions anti-spam mechanism
  • serialization
  • smart contracts
  • calculate hashrate

References

Specifications

Commands

Run a node

npm start -- --port 4000 --rpc --rpcport 3000

Run a solo miner

npm run miner

Run the wallet utility

npm run wallet

Installation

npm install

About

JavaScript (naive) implementation of a Blockchain

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published