S7 — Consume LNbits sidecar bunker (was: NIP-46 bunker option) #12
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Part of #8. Closes gap G6 in full (
Account.prvkeyreadable from DB) and the residual part of G5.2026-05-26 — no longer "future / optional"
aiolabs/lnbits#9was reframed 2026-05-25: the bunker is now the steady-state architecture, not a sovereignty escape valve.aiolabs/lnbits#18(filed same day) is the concrete phase-2 plan: sidecarnsecbunkerdon every lnbits host,RemoteBunkerSigneras the defaultsigner_typefor new accounts,LocalSignerretained only as a transitional shim for migrating existing rows.S7 in this repo therefore becomes "consume the bunker once aiolabs/lnbits#18 ships." Our role shrinks dramatically — the heavy lifting (NIP-46 client, admin client, scoped-token issuance, NIP-05 publication) lives upstream.
Architecture (revised)
Daily ATM operations are unchanged in pattern from the original S7 sketch: the ATM signs kind-21000 with its own ephemeral keypair (the connection token's client identity), and the bunker mediates the operator-side signing of long-lived events (delegations are gone — replaced by token rows in nsecbunkerd's Prisma DB).
Changes in this repo
Satmachineadmin backend
POST /api/v1/dca/machines/:id/pairbuilds the seed URL by calling the lnbits admin client'screate_tokenAPI (introduced byaiolabs/lnbits#18): The seed URL embeds the returnedbunker_url.dca_machinesgets abunker_connection_idcolumn so we canrevoke_user/ re-issue.resolve_signer(operator_account).sign_event(event). No direct access to operator'sprvkey.Satmachineadmin frontend
revoke_useradmin RPC.LNbits side
aiolabs/lnbits#18. We consume; we don't implement.Acceptance
bunker_admin.create_token→ seed URL embeds the resultingbunker://...?secret=...→ ATM redeems on first boot → kind-21000 round-trip works.RemoteBunkerSignerpost-migration).accounts.prvkeyrows for any operator that owns satmachineadmin machines.Sequencing
Hard-blocked on
aiolabs/lnbits#18. Sprint 3, after Sprint 1 (S0+S1+S5) + Sprint 2 (S2+S3+S4) land. Practically: once lnbits#18 ships nsecbunkerd-on-aio-demo andRemoteBunkerSigner.sign_eventworks end-to-end, S7 here becomes a 1-week consumer-side task instead of a 4-6 week build.Reference
aiolabs/lnbits#9— operator-IdP framing (the why).aiolabs/lnbits#18— sidecar bunker integration (the how). §F is our alignment.github.com/kind-0/nsecbunkerd— the bunker we'll consume; seeOAUTH-LIKE-FLOW.md.~/dev/nostr-protocol/nips/46.md.docs/security-pathway-v1.md§5.1, §6.S7 — needs follow-up edit reflecting that the bunker is standard, not optional.Status 2026-06-16 — bunker primitives shipped; API + naming
Same unblock as #9:
RemoteBunkerSigner(sign_event + nip44_decrypt) andNsecBunkerAdminClient(policy + token issuance) are live onlnbitsdev, verified againstaiolabs/nsecbunkerd@fb1c239(lnbits#18 status 2026-06-16).API correction: token issuance is policy-based —
create_new_policy→create_new_token(key_name, client_name, policy_id)→get_key_tokens— not thecreate_token(target, perms, expiry)sketch above.Naming: this repo is now
aiolabs/spirekeeper. Operator-authored events already route throughresolve_signer(account)innostr_publish.py, so the S7 "no direct prvkey" property already holds for operators migrated toRemoteBunkerSigner— the demo super8b2498…is bunker-backed and proven (it signed the fee-config publish on 2026-06-16,event_id=dded6a3d…).Remaining S7 work is the per-machine token lifecycle (mint on pair, revoke on un-pair) — shares the
pairendpoint with S0/#9.