diff --git a/AGENTS.md b/AGENTS.md index 0db4721..6ac8797 100644 --- a/AGENTS.md +++ b/AGENTS.md @@ -6,10 +6,13 @@ 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. 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. + rather than rewriting it, and keep its tests passing. Preserve upstream licenses and provenance. Its local + changes are P2WPKH payments and a coinbase split across up to 64 outputs, both in `src/adapters/chain.js` + (PROVENANCE.md); keep them small and tested. +- Money lives in `src/orgchain/money.js`: beats pay the holdings (split by hashrate, or all to the last act), sends + spend SegWit coins only, so an inscription can never leave as change, and balances are read off the chain, never + stored. Gas (`src/orgchain/actions.js`): every act is paid by the actor's own keys and checked before anything is + signed; the lab wallet pays only for foundings and for holdings that predate lab keys. - 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 diff --git a/PROVENANCE.md b/PROVENANCE.md index 2ba5c79..41702cd 100644 --- a/PROVENANCE.md +++ b/PROVENANCE.md @@ -20,7 +20,7 @@ Runtime dependencies are pinned in `package.json` and `package-lock.json`: - **@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. +Two local changes to the engine, both original code in `src/adapters/chain.js`, tested in `tests/money.test.js`, with Super Testnet's tests (`tests/adapters.test.js`) passing unchanged. Orgchain v1.5: the chain 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. Orgchain v1.6: a coinbase may split the block reward across up to 64 outputs (`mineTo`; `mine` still pays one script), so one beat can pay several holdings. 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. diff --git a/README.md b/README.md index dbc49f4..e6a0f2f 100644 --- a/README.md +++ b/README.md @@ -12,13 +12,20 @@ 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. +- **Money.** Test BTC lives at each node's SegWit address. **Mining** is a lab setting: under *Split* (the default) + every active holding mines, and each beat's 50 test BTC splits pro rata by hashrate, a dial from 0 to 9 on each + holding (1 unless set), one coinbase output per holding; under *Last act* the holding that acts takes the whole + beat, and *Beat now* pays the one being worked in. **Send** moves test BTC from any active node to any other, in + its holding or another, 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 reward, send and gas top-up, and Inspect has the exact amounts and the + raw transaction (`src/orgchain/money.js`). +- **Gas.** Every act is paid by the acting node's own keys: its inscription's two fees and postage (2,000 sats), + plus 500 for each handoff it makes. They come out of its gas tank, the plain coins at its Taproot key, which tops + up from its own money 0.0001 test BTC at a time. A node with neither can't act until someone sends it money, and a + graduating org pays for the claim on its new root itself. The lab wallet pays only for foundings (a holding owns + nothing until it mines) and for holdings that predate lab keys. - **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 @@ -38,7 +45,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's acts) and each holding's lab +Test coins and test keys only: a local chain, the lab wallet (the faucet that pays for foundings) 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. @@ -75,8 +82,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, 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`). +`src/miner.js`) are [Super Testnet](https://supertestnet.lol)'s, with their tests (`tests/adapters.test.js`) and two +additions: the chain also moves native SegWit (P2WPKH) payments, BIP-143 signatures included, and a coinbase may +split its reward across up to 64 outputs (`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 diff --git a/index.html b/index.html index a1d3c70..8b8023d 100644 --- a/index.html +++ b/index.html @@ -16,7 +16,7 @@
Lineage /
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.
+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, paid for with the actor's own gas, and each beat is a block whose 50 test BTC the holdings mine. Lineage gives the structure; the chain adds time.
A holding is the root of a lineage tree: the LLC that births orgs and agents. Found one, or load the sample, the yolopreneur tree from the Lineage docs over six beats.