# lhartikk/naivechain

A blockchain implementation in 200 lines of code

Repository: https://github.com/lhartikk/naivechain
Canonical: https://ross.abutalabs.com/products/naivechain
Language: JavaScript
License: Apache-2.0
License Family: permissive
Last push: 2020-04-13T09:14:37+00:00

## Health v2 (maintenance only)
Score: 32/100 (v2, computed 2026-09-02T17:46:02.011165+00:00)
- activity 0, release rhythm 35, longevity 100
- inputs: {"age_days": 3615, "days_push": 2333, "days_rel": null, "gap_med": null, "n_releases_24m": 0}
- flags: no_releases
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 5294, forks 1120 (observed 2026-08-28T04:09:15.197917+00:00)

## What it is
A deliberately minimal blockchain implementation in roughly 200 lines of JavaScript, created to make blockchain internals easy to understand by stripping away the complexity of systems like Bitcoin or Ethereum. Each node exposes an HTTP API for control and uses WebSockets for peer-to-peer block synchronization, with no persistence and no proof-of-work or proof-of-stake consensus.

## Use cases
- learn how a blockchain works by reading a tiny codebase
- run a local multi-node blockchain network to see peer synchronization
- teach blockchain fundamentals in a course or workshop
- understand p2p communication between blockchain nodes
- use as a starting point to build your own blockchain experiments
- see a minimal HTTP API for mining and querying blocks

## When to choose
- you want the shortest readable path to understanding blockchain data structures and node sync
- you need a teaching or demo artifact rather than production software
- you plan to extend a simple base with your own consensus or transaction logic (see also the related Naivecoin tutorial)

## When to avoid
- you need a production blockchain - there is no persistence, no proof-of-work/stake, and no real security model
- you want transactions, wallets, or cryptocurrency features - they are intentionally omitted
- you need a maintained, supported dependency rather than an educational reference

## Facets
- artifact type: learning-resource
- maturity: maintenance
- function: blockchain, p2p, http-server, websocket
- domain: blockchain, education, microservices, tutorials
- platform: -
- tags: educational, minimal-implementation, blockchain-demo, p2p-networking, block-mining, http-api, javascript, naivecoin, code-reading, nodejs, docker

## Member repositories
- lhartikk/naivechain (main) score 32

## Provenance
- Observed fields: from GitHub, fetched 2026-08-28T04:09:15.197917+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-29T17:59:11.602152+00:00, confidence not recorded.
  - readme: https://github.com/lhartikk/naivechain (fetched 2026-08-28T04:09:15.197917+00:00, sha ea6f820b38cd)
- Data as of 2026-08-30T08:39:29.467469+00:00.
