argus/src/lib/resolver-web.d.ts
Local Dev e185ca43a0 bns: REL — an owner can release a name, and resolvers notice a burned certificate
A burned certificate used to leave a name in the index forever: listed,
resolvable with its last records, and impossible to update or re-register.
REL is the declared burn. A transaction that spends the certificate from a
beacon transaction, recreates no output of its category and carries the REL
payload removes the name from the index.

The proof is read from an input because a burn leaves no output to read it
from. Resolvers hold only the beacon history, so the spent output must belong
to a beacon transaction; a certificate moved by a plain transfer is anchored
with an UPD first. That keeps the rule a pure function of the snapshot every
client already has.

A released name can be registered again only in a later block than the
confirmed release. Same-block re-registration would be decided by txid order
between a release and a snipe sitting in the mempool together.

This is the first step of ROADMAP-MAINNET.md §9: it puts burn detection in
the resolvers on its own, before any covenant depends on it. Specified in
PROTOCOL-ADDENDUM-release.md; shared resolver and its Ariadne copy here.
2026-10-04 01:39:14 +02:00

84 lines
2.9 KiB
TypeScript

export function normalizeName(input: any): string;
export function buildIndex({ electrum, WebSocket: WS, client, directIP }?: {
electrum?: {
url: string;
ip: string;
}[] | undefined;
directIP?: boolean | undefined;
}): Promise<Map<any, any>>;
export function resolveName(input: any, opts?: {}): Promise<any>;
export function parseElectrumRecord(records: any): ({
url: string;
ip: string;
} | {
url: string;
ip?: undefined;
})[];
export function getElectrumServers(index: any): ({
url: string;
ip: string;
} | {
url: string;
ip?: undefined;
})[];
export function fetchElectrumServers(opts?: {}): Promise<({
url: string;
ip: string;
} | {
url: string;
ip?: undefined;
})[]>;
export function parseTldsRecord(records: any): string[];
export function getBcnrTlds(index: any): string[];
export function fetchBcnrTlds(opts?: {}): Promise<string[]>;
export function isBcnrNativeTld(tldOrList: any, tld: any): boolean;
export interface ElectrumServer { url: string; ip?: string }
export interface BnsNetwork {
id: "chipnet" | "mainnet";
label: string;
prefix: "bchtest" | "bitcoincash";
beacon: string | null;
beaconScripthash: string | null;
tldBeacon: string | null;
tldBeaconScripthash: string | null;
electrum: ElectrumServer[];
beaconOnly: RegExp;
electrumListName: string;
rootTldName: string;
bootstrapTlds: string[];
startHeight: number | null;
hostingBucket: string;
nameListUrl: string;
cdnIndexUrl: string;
nostrTags: { names: string; tlds: string };
explorerTx: string;
faucets: { name: string; url: string }[];
operatorAddress: string | null;
accountPath: string;
bchnRpcPort: number;
}
/** REL: does `tx` burn `entry`'s certificate, spending it from a beacon transaction in `txs`? */
export function burnsCertificate(tx: any, entry: { category: string }, txs: Map<string, any>): boolean;
/** One-block gap after a release. `releasedAt` undefined = never released. */
export function mayReRegister(releasedAt: number | undefined, height: number): boolean;
export const NETWORKS: { chipnet: BnsNetwork; mainnet: BnsNetwork };
export const DEFAULT_NETWORK_ID: "chipnet";
export function networkIdFromEnv(): string;
export function getNetwork(idOrRecord?: string | BnsNetwork): BnsNetwork;
export const NETWORK: BnsNetwork;
export function requireBeacons(network?: string | BnsNetwork): BnsNetwork;
export const BEACON: string | null;
export const BEACON_SCRIPTHASH: string | null;
export const TLD_BEACON: string | null;
export const TLD_BEACON_SCRIPTHASH: string | null;
export const ELECTRUM: ElectrumServer[];
export const PREFIX: "BNS1";
export const TLD: ".bch";
export const DEFAULT_TLD: "bch";
export const CHIPNET_ELECTRUM: {
url: string;
ip: string;
}[];
export const ELECTRUM_LIST_NAME: string;
export const ROOT_TLD_NAME: string;
export const BOOTSTRAP_TLDS: string[];