{"id":50716922,"url":"https://github.com/systemslibrarian/crypto-lab-bitcoin-wallet","last_synced_at":"2026-06-09T19:01:48.842Z","repository":{"id":363543810,"uuid":"1263805853","full_name":"systemslibrarian/crypto-lab-bitcoin-wallet","owner":"systemslibrarian","description":"Browser-based Bitcoin wallet demo — real secp256k1 address derivation (P2PKH + P2WPKH), BIP-39 seed phrases, BIP-32 HD wallets. Validated against the official BIP test vectors. For learning, never real funds","archived":false,"fork":false,"pushed_at":"2026-06-09T10:22:08.000Z","size":63,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2026-06-09T11:22:58.883Z","etag":null,"topics":["address-derivation","base58check","bech32","bip32","bip39","bip44","bitcoin","crypto-lab","cryptography","hash160","hd-wallet","mnemonic","secp256k1","seed-phrase"],"latest_commit_sha":null,"homepage":"https://systemslibrarian.github.io/crypto-lab-bitcoin-wallet/","language":"TypeScript","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/systemslibrarian.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-09T09:30:14.000Z","updated_at":"2026-06-09T10:29:32.000Z","dependencies_parsed_at":null,"dependency_job_id":null,"html_url":"https://github.com/systemslibrarian/crypto-lab-bitcoin-wallet","commit_stats":null,"previous_names":["systemslibrarian/crypto-lab-bitcoin-wallet"],"tags_count":null,"template":false,"template_full_name":null,"purl":"pkg:github/systemslibrarian/crypto-lab-bitcoin-wallet","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-bitcoin-wallet","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-bitcoin-wallet/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-bitcoin-wallet/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-bitcoin-wallet/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/systemslibrarian","download_url":"https://codeload.github.com/systemslibrarian/crypto-lab-bitcoin-wallet/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/systemslibrarian%2Fcrypto-lab-bitcoin-wallet/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":34121022,"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-09T02:00:06.510Z","response_time":63,"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":["address-derivation","base58check","bech32","bip32","bip39","bip44","bitcoin","crypto-lab","cryptography","hash160","hd-wallet","mnemonic","secp256k1","seed-phrase"],"created_at":"2026-06-09T19:01:46.718Z","updated_at":"2026-06-09T19:01:48.835Z","avatar_url":"https://github.com/systemslibrarian.png","language":"TypeScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# crypto-lab-bitcoin-wallet\n\n## What It Is\n\nA working model of **Bitcoin wallet mechanics** — the chain that turns 32 random bytes into a spendable address, and 12 words into a hierarchical-deterministic wallet — using **real cryptography in the browser**. The page composes the audited [`@noble/secp256k1`](https://github.com/paulmillr/noble-secp256k1) and [`@noble/hashes`](https://github.com/paulmillr/noble-hashes) libraries to walk the full pipeline: secp256k1 private key → compressed public key → HASH160 (SHA-256 → RIPEMD-160) → P2PKH `1...` (Base58Check, BIP-13) and P2WPKH `bc1...` (Bech32, BIP-173); BIP-39 entropy → 12-word mnemonic with checksum → PBKDF2-HMAC-SHA512 seed; BIP-32 master key → hardened/normal child derivation along a path like `m/44'/0'/0'/0/0`. The derivation logic is validated at boot against the official **BIP-32 Test Vector 1** and **BIP-39** test phrase (`abandon × 11, about` with passphrase `TREZOR` → seed prefix `c55257c360c07c72`), plus the textbook privkey = 1 P2PKH address `1BgGZ9tcN4rm9KBzDn7KprQz87SZ26SAMH`. This is mainnet-style derivation **for education only** — do not hold real funds on any key generated here.\n\n## When to Use It\n\n- **Understanding what a Bitcoin address actually is** — show the secp256k1 → HASH160 → Base58Check / Bech32 chain step by step, instead of treating an address as opaque.\n- **Teaching seed phrases honestly** — make BIP-39 visible: 16 random bytes become 12 words *because* the last word carries a SHA-256 checksum, and PBKDF2 stretches the phrase into the seed every wallet derives from.\n- **Demonstrating HD wallets and derivation paths** — change the index of `m/44'/0'/0'/0/0` and watch one seed produce successive receive addresses; that is exactly how every modern wallet generates its address book.\n- **Showing the address checksum doing its job** — paste a phrase, mangle a word, and watch the BIP-39 checksum reject it; the typo-protection check is the same idea as the four-byte Base58Check tail on `1...` addresses.\n- **Do NOT use this for real funds.** A browser tab is not a secure place to generate or hold money. Use a hardware wallet (Ledger, Trezor, Coldcard) or audited wallet software for anything you cannot afford to lose. Never paste a phrase that controls real Bitcoin into any web page — including this one.\n\n## Live Demo\n\n[**https://systemslibrarian.github.io/crypto-lab-bitcoin-wallet/**](https://systemslibrarian.github.io/crypto-lab-bitcoin-wallet/)\n\nThe page has two interactive flows. **Generate key** makes a fresh secp256k1 private key, then walks the five-stage pipeline — private key (hex + WIF), compressed public key, HASH160, P2PKH `1...`, and P2WPKH `bc1...` — every transform shown with its real bytes. **Generate mnemonic** produces 16 bytes of entropy via `crypto.getRandomValues`, encodes them as a 12-word BIP-39 phrase, stretches the phrase with PBKDF2-HMAC-SHA512 into a 64-byte seed, and derives the BIP-32 master key. A **validate-mnemonic** input runs the checksum check on any pasted phrase (pass / fail badge — do not paste a real wallet phrase). A **path** field (default `m/44'/0'/0'/0/0`) plus a **receive index** spinner walk the BIP-32 derivation to a real address; bumping the index produces the next address from the same seed, which is what a wallet does every time you click \"new address\". The page is dark by default with a top-right `🌙/☀️` toggle that persists across visits.\n\n## How to Run Locally\n\n```bash\ngit clone https://github.com/systemslibrarian/crypto-lab-bitcoin-wallet.git\ncd crypto-lab-bitcoin-wallet\nnpm install\nnpm run dev       # local dev server with HMR\nnpm run build     # tsc + production build to dist/\nnpm run preview   # serve the built dist/ locally\nnpm run test:e2e  # headless Chromium e2e + axe-core WCAG 2.2 a11y gate\n```\n\nNo environment variables, no API keys, no servers. Everything runs client-side. The build bundles `@noble/secp256k1`, `@noble/hashes`, and the in-repo BIP-39 wordlist + QR-code encoder into a single static JS file (~73 kB) deployed straight to GitHub Pages — no remote services, no telemetry. The e2e suite drives a real Chromium through every interactive path (key generation, mnemonic generation, validate, derive, memorize-and-test, theme toggle, mobile no-overflow at 375px) and fails the build on any critical/serious axe-core WCAG violation.\n\n## Part of the Crypto-Lab Suite\n\nThis is one demo in a wider portfolio of interactive cryptography labs — see [systemslibrarian.github.io/crypto-lab](https://systemslibrarian.github.io/crypto-lab/) for the rest, including the five PQC families overview, hybrid TLS, harvest-now-decrypt-later timelines, key-exchange generations, WebAuthn passkeys, and deep-dives on individual schemes.\n\n---\n\n\"So whether you eat or drink or whatever you do, do it all for the glory of God.\" — 1 Corinthians 10:31\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-bitcoin-wallet","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-bitcoin-wallet","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsystemslibrarian%2Fcrypto-lab-bitcoin-wallet/lists"}