From 43b6d2a4e16f1991a02a77f2198bc83bb71deb04 Mon Sep 17 00:00:00 2001 From: Adam Soltys Date: Wed, 25 Nov 2026 09:25:18 -0700 Subject: names: ignore registrar records held by blocked keys Names whose v3 record belongs to a key in names:blocked_holders are treated as unclaimed: lightning address, NIP-05 and legacy forwarding stay with the local account. Fails open if the registrar or db cannot answer. Co-Authored-By: Claude Opus 5.5 Claude-Session: https://claude.ai/code/session_01VMan6SEnsbshZrUDtTsxAX --- lib/v3forward.ts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib/v3forward.ts') diff --git a/lib/v3forward.ts b/lib/v3forward.ts index 34f634ef..525c1be1 100644 --- a/lib/v3forward.ts +++ b/lib/v3forward.ts @@ -19,6 +19,7 @@ import { PaymentType } from "$lib/types"; // account's own session named in a migration grant (`granted`). A name that // merely exists on v3 is never forwarded to. +import { holderBlocked } from "$lib/names"; const NAMES_URL = process.env.NAMES_URL || "https://names.coinos.io"; const DOMAIN = "coinos.io"; const TYPES = [PaymentType.lightning, PaymentType.bolt12, PaymentType.bitcoin, PaymentType.liquid]; @@ -53,6 +54,7 @@ async function v3Holder(username: string): Promise<{ pk: string | null; granted: export async function v3Destination(user): Promise { if (!user?.username || !user?.pubkey || user.username.length > 64) return null; const { pk, granted } = await v3Holder(user.username); + if (pk && (await holderBlocked(user.username))) return null; return pk && (granted || pk === user.pubkey) ? user.username.toLowerCase() : null; } -- cgit v1.2.3