{"id":51059605,"url":"https://github.com/interchained/lab","last_synced_at":"2026-06-23T00:30:56.585Z","repository":{"id":362556872,"uuid":"1259729951","full_name":"interchained/lab","owner":"interchained","description":null,"archived":false,"fork":false,"pushed_at":"2026-06-04T20:10:57.000Z","size":1613,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-04T21:38:39.500Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/interchained.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"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,"zenodo":null,"notice":null,"maintainers":null,"copyright":null,"agents":null,"dco":null,"cla":null}},"created_at":"2026-06-04T19:55:49.000Z","updated_at":"2026-06-04T20:11:23.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/interchained/lab","commit_stats":null,"previous_names":["interchained/lab"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/interchained/lab","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interchained%2Flab","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interchained%2Flab/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interchained%2Flab/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interchained%2Flab/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/interchained","download_url":"https://codeload.github.com/interchained/lab/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/interchained%2Flab/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34671045,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-06-22T02:00:06.391Z","response_time":106,"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":[],"created_at":"2026-06-23T00:30:56.097Z","updated_at":"2026-06-23T00:30:56.574Z","avatar_url":"https://github.com/interchained.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Interchained Playground — a blockchain in your browser\n\nA genuine, in-browser blockchain you can run, mine, and learn from. No Ethereum, no node, no install, no backend — every hash is real SHA‑256 computed live in the tab. It's built as a **Bitcoin‑style educator**: send tokens, watch them collect in the mempool, mine them into blocks with real proof‑of‑work, and see why confirmed history is hard to rewrite.\n\n---\n\n## What it does\n\n- **Real SHA‑256 + proof‑of‑work.** A synchronous SHA‑256 implementation hashes `block + nonce` in a tight loop until the digest starts with N zeros. The hashing is genuine (it self‑tests against the standard `abc` and empty‑string vectors on load).\n- **Hashpower benchmark.** On load it measures your machine's actual SHA‑256 throughput and shows it in the header, plus an estimate of how long a block will take at the current difficulty.\n- **Transactions \u0026 mempool.** Move tokens between wallets; pending transfers sit in the mempool until a miner bundles them into a block. New coins only ever enter through the block reward (the coinbase) — just like Bitcoin.\n- **Live chain view.** Blocks render as a linked column showing index, transactions, nonce, hash (leading zeros highlighted), and the previous block's hash. Each new block animates in.\n- **Inspect internals.** Expand any block to see the exact string that gets hashed and a per‑block validity breakdown (hash matches data / meets difficulty / links to previous).\n- **Immutability lesson.** Confirmed amounts are editable so you can play the attacker. Editing one changes that block's hash, which stops clearing the proof‑of‑work target and breaks the link to the next block — so honest nodes reject it. \"Re‑mine\" redoes the work from the break forward, so you feel exactly how expensive rewriting history is.\n- **Spin up your own chain.** Name it, pick a ticker, set the block reward, seed genesis balances, and create a fresh genesis block.\n\n## Educational framing — what's real vs. simplified\n\nThe mechanics are genuine: a mempool, a coinbase reward, a real nonce search, and blocks linked by SHA‑256. For clarity the model simplifies a few things versus Bitcoin:\n\n| Concept | This playground | Bitcoin |\n|---|---|---|\n| Hash | single SHA‑256 | double SHA‑256 |\n| Difficulty target | \"hash starts with N zeros\" | full 256‑bit target number |\n| Accounting | account balances | UTXOs |\n\nAmounts support decimals (the default reward is `0.1030199 ITC`).\n\n---\n\n## How it works\n\n### The engine (`playground/engine.js`)\nPlain JS, exposed on `window.PG`. No framework dependencies.\n\n- `sha256(str)` / `hash(str)` — genuine synchronous SHA‑256 (UTF‑8 normalized).\n- `mineBlock(block, difficulty, opts)` — async PoW search. Runs in batches via `setTimeout` (not `requestAnimationFrame`, so mining keeps going even when the tab is backgrounded) and throttles progress callbacks to ~10/sec so the loop spends its time hashing, not re‑rendering.\n- `validateChain(blocks, difficulty)` — recomputes every hash and checks PoW + prev‑hash links per block (each block validates against the difficulty it was mined at).\n- `computeBalances(blocks, wallets)` — balances aren't stored; they're replayed from every coinbase + transfer.\n- `benchmark(ms)` — measures real hashes/sec for the hashpower readout.\n\n### The UI (React + Babel, in‑browser)\n- `pg-shared.jsx` — `Icon`, `Reveal`, formatters (`fmtCoin`, `fmtRate`, `HashColored`).\n- `pg-state.jsx` — `useChain()`, the state machine: wallets, blocks, mempool, the miner, and the async mine / re‑mine / tamper actions.\n- `lab.jsx` — wallets, transaction form, mempool, mining HUD, chain + block cards.\n- `intro.jsx` — header, hero (a live self‑building mini‑chain), concept beats, genesis lab, recap, footer.\n- `app.jsx` — composes everything and wires the Tweaks panel.\n- `pg-styles.css` — playground styles layered on the Interchained design tokens (`explainer/styles.css`).\n- `tweaks-panel.jsx` — the Tweaks shell.\n\n## Tweaks\n\nOpen the Tweaks panel to adjust, live:\n\n- **Difficulty** (2–5 leading zeros) — each extra zero multiplies the work by ~16. Drop to 2–3 for near‑instant blocks; raise for a longer, more dramatic search.\n- **Animation speed**\n- **Immutability lesson** — show/hide the tamper section.\n- **Chain name** and **token ticker** — rebrands live.\n- **Accent color**\n\n## Running it\n\nOpen `Blockchain Playground.html`. It loads React, Babel, and Lucide from CDN; everything else is local. Because it transpiles JSX in the browser, the very first paint takes a moment, and on a flaky connection a script can occasionally fail to load (refresh fixes it). For a fully offline, single‑file version, the project can be bundled into one self‑contained HTML file.\n\n## Notes\n\n- Mining time is **real**, so at difficulty 4 a block averages ~1 second but has honest variance — the HUD counts the whole time.\n- Everything runs 100% client‑side. There is no network, no wallet, and no real asset involved — it's a teaching tool.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterchained%2Flab","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Finterchained%2Flab","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Finterchained%2Flab/lists"}