diff --git a/AGENTS.md b/AGENTS.md index cd927d5..0db4721 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,11 +6,14 @@ Orgchain is lineage's app for creating and operating lineage holdings on Super T - Lineage semantics live in one place, `src/orgchain/lineage.js`. The UI never interprets events itself, and every act is vetted by that reducer before it is signed. A new op means a reducer change, its tests and the README's table. - The engine (`src/adapters`, `src/upstream`, `src/storage.js`, `src/miner.js`) is Super Testnet's. Compose with it - rather than rewriting it, and keep its tests passing. Preserve upstream licenses and provenance. + rather than rewriting it, and keep its tests passing. Preserve upstream licenses and provenance. Its one local + change is P2WPKH payments in `src/adapters/chain.js` (PROVENANCE.md); keep it small and tested. +- Money lives in `src/orgchain/money.js`: beats pay the holding being worked in, and sends stay inside a holding and + spend SegWit coins only, so an inscription can never leave as change. Balances are read off the chain, never stored. - Keys follow the tree (`src/orgchain/keys.js`): store roots only (one per holding, one per graduated org) and derive every other key from its position. Every act is signed by whichever key holds the authorizing inscription. - A node's chain key is its account's BIP-86 Taproot key (`m/86'/1'/account'/0/0`); SegWit is BIP-84 at the same - account. Leaves are HKDF-SHA256 (salt `lineage/v0`) and must stay byte for byte with lineage's key tree page; + account and holds its money. Leaves are HKDF-SHA256 (salt `lineage/v0`) and must stay byte for byte with lineage's key tree page; `tests/keys.test.js` holds values read off that page. - Secrets show only behind Reveal, reset on every selection, and match the key tree page byte for byte (the tests pin hashes of the page's own output). diff --git a/PROVENANCE.md b/PROVENANCE.md index 28effeb..2ba5c79 100644 --- a/PROVENANCE.md +++ b/PROVENANCE.md @@ -13,13 +13,15 @@ The upstream CC0 legal text is retained unchanged at [`public/licenses/supertest Runtime dependencies are pinned in `package.json` and `package-lock.json`: -- **@cmdcode/tapscript 1.5.3**, Christopher Scott, [upstream](https://github.com/cmdruid/tapscript), CC-BY-1.0. Used for transaction encoding, signing/verification, Taproot commitments and addresses. Installed package license retained unchanged at [`public/licenses/tapscript.txt`](public/licenses/tapscript.txt). Library source is unmodified; Vite bundles/minifies it for the browser. -- **@noble/curves 1.9.7**, Paul Miller and contributors, [upstream](https://github.com/paulmillr/noble-curves), MIT. Used for key generation/validation and public keys: secp256k1 for chain and nostr keys, Ed25519 and X25519 for lineage's leaves. License retained at [`public/licenses/noble-curves.txt`](public/licenses/noble-curves.txt). -- **@noble/hashes 1.8.0**, Paul Miller and contributors, [upstream](https://github.com/paulmillr/noble-hashes), MIT. Used for synthetic block hashes, BIP-85's HMAC and the leaves' HKDF-SHA256. License retained at [`public/licenses/noble-hashes.txt`](public/licenses/noble-hashes.txt). +- **@cmdcode/tapscript 1.5.3**, Christopher Scott, [upstream](https://github.com/cmdruid/tapscript), CC-BY-1.0. Used for transaction encoding, signing/verification, Taproot commitments and addresses, and the BIP-143 digests and signatures of SegWit payments. Installed package license retained unchanged at [`public/licenses/tapscript.txt`](public/licenses/tapscript.txt). Library source is unmodified; Vite bundles/minifies it for the browser. +- **@noble/curves 1.9.7**, Paul Miller and contributors, [upstream](https://github.com/paulmillr/noble-curves), MIT. Used for key generation/validation and public keys, and to verify the low-S DER signatures of SegWit payments: secp256k1 for chain and nostr keys, Ed25519 and X25519 for lineage's leaves. License retained at [`public/licenses/noble-curves.txt`](public/licenses/noble-curves.txt). +- **@noble/hashes 1.8.0**, Paul Miller and contributors, [upstream](https://github.com/paulmillr/noble-hashes), MIT. Used for synthetic block hashes, BIP-85's HMAC, the leaves' HKDF-SHA256 and the RIPEMD-160 of P2WPKH key hashes. License retained at [`public/licenses/noble-hashes.txt`](public/licenses/noble-hashes.txt). - **@scure/base 1.2.6**, Paul Miller, [upstream](https://github.com/paulmillr/scure-base), MIT. Used for bech32 npubs and base64 leaf keys. License retained at [`public/licenses/scure-base.txt`](public/licenses/scure-base.txt). -- **@scure/bip32 1.7.0**, Patricio Palladino and Paul Miller, [upstream](https://github.com/paulmillr/scure-bip32), MIT. Used for HD derivation under the BIP-85, BIP-86 and NIP-06 paths. License retained at [`public/licenses/scure-bip32.txt`](public/licenses/scure-bip32.txt). +- **@scure/bip32 1.7.0**, Patricio Palladino and Paul Miller, [upstream](https://github.com/paulmillr/scure-bip32), MIT. Used for HD derivation under the BIP-85, BIP-86, BIP-84 and NIP-06 paths. License retained at [`public/licenses/scure-bip32.txt`](public/licenses/scure-bip32.txt). - **@scure/bip39 1.6.0**, Patricio Palladino and Paul Miller, [upstream](https://github.com/paulmillr/scure-bip39), MIT. Used for the 24-word lab roots and their seeds. License retained at [`public/licenses/scure-bip39.txt`](public/licenses/scure-bip39.txt). +One local change to the engine (Orgchain v1.5): `src/adapters/chain.js` also accepts native SegWit (P2WPKH) outputs and SIGHASH_ALL P2WPKH spends, verified per BIP-143, so lineage accounts can hold and send test BTC at their BIP-84 addresses. Everything about inscriptions stays Taproot-only. The change is original code, tested in `tests/money.test.js`; Super Testnet's tests (`tests/adapters.test.js`) pass unchanged. + Vite and Playwright are build/test dependencies, not runtime network services. Their installed package notices remain in the locked dependency installation. No unlicensed upstream code was copied. The bounded JSON/CBOR codec, byte-derived MetadataIndex, trusted event-counter reducer, local API facade and persisted auto-miner schedule are original adapter code. Metadata encoding and endpoint naming were checked against the [Ordinals metadata](https://docs.ordinals.com/inscriptions/metadata.html) and [endpoint](https://docs.ordinals.com/inscriptions/recursion.html) references; no ord source code was copied. diff --git a/README.md b/README.md index c3c0998..dbc49f4 100644 --- a/README.md +++ b/README.md @@ -12,6 +12,13 @@ chain itself records who did what, and when. - **Time.** A beat is a block. At the default tempo each act is its own beat; at 10, 30 or 60 seconds, acts are cued and land together on the next beat; on manual they wait for *Beat now*. The slider and *Replay* show a holding as it stood at any beat. +- **Money.** Each beat pays its 50 test BTC block reward to the holding being worked in, at the holding's SegWit + address (a closed holding, or one that predates lab keys, leaves it to the lab wallet). **Send** moves test BTC from + any active node to another in its holding, signed by the sender's BIP-84 key: at most two coins in, at most 50 test + BTC out, and the toy chain's fixed 500-sat fee. Sends land like acts, at once or cued, and *Beat now* mines a beat + even when nothing is cued. A graduation moves each re-keyed node's money to its new address along with its + inscription. Balances follow the slider, the timeline lists every beat's reward and every send, and Inspect has the + exact amounts and the raw transaction (`src/orgchain/money.js`). Inscription fees still come from the lab wallet. - **One interpretation.** `src/orgchain/lineage.js` folds `lineage/v0` events into trees, and vets every act before anything is signed. Events it rejects stay on the chain and show as rejected; they just don't change the tree. - **Keys.** Each holding gets its own 24-word lab root, and every node has lineage's keys at its place in the tree @@ -31,7 +38,7 @@ chain itself records who did what, and when. BIP-380 checksums), and its leaves' private keys (OpenSSH, DKIM, WireGuard, PKCS#8, Headscale). Hidden again on every selection; lab keys only. -Test coins and test keys only: a local chain, the lab wallet (the faucet that funds every key) and each holding's lab +Test coins and test keys only: a local chain, the lab wallet (the faucet that funds every key's acts) and each holding's lab root, kept in this browser (`localStorage`, key `orgchain:lab:v1`). Nothing here is a real key; minting a real root is the operator's call. @@ -55,7 +62,7 @@ reused. ``` npm ci -npm test # engine, reducer and lab (node --test) +npm test # engine, reducer, lab and money (node --test) npm run build # dist/ is the site; relative paths, so it works at any sub-path npm run test:e2e # Playwright on vite preview; PW_CHANNEL=chrome uses installed Chrome ``` @@ -68,8 +75,9 @@ Deploy: copy `dist/` to `ventures/lineage/orgchain/` on `teahubxyz/time` `gh-pag ## Built on Super Testnet The chain, wallet, inscriptions, metadata and index (`src/adapters`, `src/upstream`, with `src/storage.js` and -`src/miner.js`) are [Super Testnet](https://supertestnet.lol)'s, unchanged and with their tests -(`tests/adapters.test.js`). See `PROVENANCE.md` and `public/licenses/`. Lineage's key derivation and the claim and +`src/miner.js`) are [Super Testnet](https://supertestnet.lol)'s, with their tests (`tests/adapters.test.js`) and one +addition: the chain also moves native SegWit (P2WPKH) payments, BIP-143 signatures included (`tests/money.test.js`). +See `PROVENANCE.md` and `public/licenses/`. Lineage's key derivation and the claim and countersign handoff (`src/adapters/lineage-keys.js`, `src/adapters/handoff.js`, with their spec vectors in `tests/keys.test.js`) come from the `tree` branch. The full lab (explorer, delegates, recursion and the Inscriboor extension) lives at supertestnet.lol. diff --git a/index.html b/index.html index 01b22a8..a1d3c70 100644 --- a/index.html +++ b/index.html @@ -4,7 +4,7 @@ Orgchain · Lineage - + @@ -16,7 +16,7 @@

Lineage /

Orgchain

-

Found a holding, then birth its orgs and agents, award belts, record decisions, graduate and close. Each act is an inscription whose parent is the node that authorizes it, and each beat is a block. Lineage gives the structure; the chain adds time.

+

Found a holding, then birth its orgs and agents, award belts, record decisions, send test BTC, graduate and close. Each act is an inscription whose parent is the node that authorizes it, and each beat is a block that pays the holding 50 test BTC. Lineage gives the structure; the chain adds time.

Test coins only @@ -32,8 +32,8 @@ Tempo
-

Beat 0 · nothing cued

- +

Beat 0 · nothing cued · beats pay the lab wallet

+
@@ -76,7 +76,7 @@

Select a holding, or a node in its tree, to act through it.