Orgchain v1.3: Taproot and SegWit addresses for every node
Every account now lists standard Bitcoin addresses, so no one has to derive them: Taproot (BIP-86, m/86'/1'/account'/0/0), which holds the node's inscription, signs its acts and receives inscriptions, and SegWit (BIP-84, m/84'/1'/account'/0/0) for payments, beside its npub (NIP-06). An org is account 0 of its seed and its agents are accounts 1..n, so a wallet that opens an account finds the same addresses. The lineage key tree page derives the same branches on mainnet paths and lists the addresses in each agent's keyring. The v1.2 tapkey (the npub's key, tweaked) is replaced by the standard BIP-86 key; labs keyed by v1.1 or v1.2 keep their chain keys until they are reset. Tests pin BIP-86 and BIP-84's own vectors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01H4upF5LVwmPDDqrhdUfnXh
This commit is contained in:
1 parent
00a35613c5
commit
0af51dc9cd
8 files changed
+107
-62
No files matched your search
+12
-8
@@ -5,7 +5,7 @@ import { MetadataIndex } from './adapters/metadata-index.js';
|
||||
import { census, lineageEvents, reduce, rows, slug, summary, trail } from './orgchain/lineage.js';
|
||||
import { LAB_KEY, beat, decodeLab, emptyLab, encodeLab, mutate, readLab, setTempo, tick } from './orgchain/store.js';
|
||||
import { SAMPLE, act, seedSample } from './orgchain/actions.js';
|
||||
import { holderOf, keyOf, leavesOf } from './orgchain/keys.js';
|
||||
import { addressesOf, holderOf, keyOf, leavesOf } from './orgchain/keys.js';
|
||||
import { readEnvelope } from './adapters/inscription.js';
|
||||
|
||||
const $ = id => document.getElementById(id);
|
||||
@@ -225,8 +225,8 @@ function nodeView(n) {
|
||||
keysView(n)),
|
||||
];
|
||||
}
|
||||
// Lineage's keys for a node as of the viewed beat: its tapkey and npub, where they come from, who holds its inscription
|
||||
// now, and its leaves with the public lines to paste. The leaves are the ones the lineage key tree page derives.
|
||||
// Lineage's keys for a node as of the viewed beat: its Taproot, SegWit and nostr addresses, where they come from, who
|
||||
// holds its inscription now, and its leaves with the public lines to paste (the ones the lineage key tree page derives).
|
||||
const HELD = { own: 'its own key', lab: 'the lab wallet', parent: "its parent's key (its handoff is cued)", other: 'a key outside this lab' };
|
||||
const LEAF = { ssh: 'shell access, certified by the CA', git: 'commit signing', dkim: 'mail signing', wg: 'WireGuard peer key',
|
||||
'ssh-ca': 'SSH certificate authority', mtls: 'TLS identity between nodes', noise: 'Headscale noise key' };
|
||||
@@ -234,13 +234,17 @@ function keysView(n) {
|
||||
const k = keyOf(lab.keys, view, n), holder = holderOf(lab, live, n.id);
|
||||
const held = ['Held now by', holder ? HELD[holder.who] : 'nobody: its inscription has been spent'];
|
||||
if (!k) return h('div', { class: 'keys' }, h('p', { class: 'lab', text: 'Keys' }),
|
||||
h('dl', { class: 'fl' }, [['Signs with', 'the lab wallet: this holding predates lab keys, so it has no tapkey or leaves'], held].map(fact)));
|
||||
const agent = n.kind === 'agent', leaves = leavesOf(lab.keys, view, n), lines = leaves.map(([, , line]) => line).filter(Boolean);
|
||||
const chain = k.tapkey ? ['Tapkey', k.wallet.address, 'Its npub with the BIP-86 tweak: one secret signs its nostr events and its chain spends.']
|
||||
: ['Chain key', k.wallet.address, "A separate key at m/86', the way v1.1 keyed this lab. Reset the lab to key it by tapkey."];
|
||||
h('dl', { class: 'fl' }, [['Signs with', 'the lab wallet: this holding predates lab keys, so it has no addresses or leaves'], held].map(fact)));
|
||||
const agent = n.kind === 'agent', a = addressesOf(lab.keys, view, n), leaves = leavesOf(lab.keys, view, n);
|
||||
const lines = leaves.map(([, , line]) => line).filter(Boolean), reset = 'Reset the lab for standard BIP-86 keys.';
|
||||
const holds = agent ? "Holds this seat's inscription, and inscriptions sent to it land here." : "Holds this org's inscription and signs its acts. Inscriptions sent to it land here.";
|
||||
const taproot = { bip86: `BIP-86 at ${a.taproot.path}. ${holds}`, tapkey: `Its npub's key with the BIP-86 tweak, the way v1.2 keyed this lab. ${holds} ${reset}`,
|
||||
wallet: `An untweaked key at ${a.taproot.path}, the way v1.1 keyed this lab. ${holds} ${reset}` }[k.scheme];
|
||||
const facts = [['Taproot', a.taproot.address, taproot], ['SegWit', a.segwit.address, `BIP-84 at ${a.segwit.path}. For payments; this toy chain only moves Taproot.`],
|
||||
['npub', a.npub.address, `NIP-06 at ${a.npub.path}. Its nostr name; the leaves below hang off it.`], ['From', `${k.from} · account ${k.account}`], held];
|
||||
return h('div', { class: 'keys' },
|
||||
h('p', { class: 'lab', text: 'Keys' }),
|
||||
h('dl', { class: 'fl' }, [chain, ['npub', k.npub], ['Derived', k.path], held].map(fact)),
|
||||
h('dl', { class: 'fl' }, facts.map(fact)),
|
||||
h('p', { class: 'lab' }, 'Leaves', h('span', { text: ` · HKDF-SHA256 from its ${agent ? 'nostr secret' : 'seed'}` })),
|
||||
h('ul', { class: 'list leaves' }, leaves.map(([label, value]) =>
|
||||
h('li', {}, h('b', { text: label }), h('span', { class: 'when', text: ` ${LEAF[label]}` }), h('code', { text: value })))),
|
||||
|
||||
Reference in new issue
Block a user