Low-level constructor. Prefer the static factories (Destination.IN,
Destination.OUT, etc.) which also compute the destination hashes.
The application name.
The direction of this destination.
The type of this destination.
The identity associated with this destination.
An object that manages destinations and dispatches link requests.
Per-destination app_data override (§4.5). When set it takes precedence
over identity.appData in announces, so destinations sharing an identity
(e.g. lxmf.delivery and lxmf.propagation) can each advertise their
own app_data.
Registered REQUEST handlers keyed by hex(SHA-256(path)[:16])
(PROTOCOL-SPEC.md §11.3). The path string itself is never sent on the
wire — only its 16-byte truncated hash — so a client must already know
the path to fetch the resource at it.
StaticDEFAULT_Default periodic re-announce interval. There is no protocol-mandated default for application destinations — the reference implementations' transport-internal management announce cadences (2 h) and interface-discovery cadences (6 h) are not what end-user destinations announce at. PROTOCOL-SPEC.md §9.7 recommends 30–60 min for a desktop client and notes Sideband emits roughly every 30 min; 30 min keeps cached mesh paths fresh against transit-relay TTLs without dominating airtime.
StaticMAX_Maximum number of retained ratchet keys for decryption tolerance.
StaticMIN_Floor below which a requested interval is clamped. PROTOCOL-SPEC.md §9.7: "AVOID < 60 s — short intervals trigger ingress rate limiting (§4.5 step 8) and burn ratchet-ring slots without benefit". Sub-minute intervals are clamped to this value with a warning rather than rejected outright.
StaticPR_Seconds a path-response announce payload stays reusable for retransmitted
path? requests with the same tag.
StaticRATCHET_How long a learned peer ratchet stays valid, in milliseconds (default 30
days). Mirrors RNS.Identity.RATCHET_EXPIRY. Past this a peer ratchet is
dropped and the long-term key is used until a fresh announce arrives.
StaticRATCHET_Default ratchet rotation interval (Destination.RATCHET_INTERVAL = 30 min). A destination with ratchets enabled rotates its key at most this often.
The active re-announce interval in milliseconds. This is the default
(DEFAULT_ANNOUNCE_INTERVAL_MS) until startAnnouncing is
called with an explicit intervalMs, after which it reflects the
(clamped) requested value.
The addEventListener() method of the EventTarget interface sets up a function that will be called whenever the specified event is delivered to the target.
Optionaloptions: boolean | AddEventListenerOptionsBroadcasts an Announce packet advertising this destination's public key, name hash and signed metadata so peers can learn and remember it.
Emits with context = NONE (a regular periodic announce). Use
announcePathResponse to answer a path? request.
Broadcasts a path-response announce — identical body to a regular
announce (§4.1) but with the outer packet's context byte set to
PATH_RESPONSE = 0x0B (§7.2.4). Emitted in answer to an inbound path?
request so the requester can learn a route back to us. The announce body
validates identically under §4.5; only the context byte distinguishes it.
When called with the requesting PR's tag, the signed announce payload
is cached for PR_TAG_WINDOW_SECS seconds and retransmissions with the
same tag reuse it — a path-response cache keeps PR floods from forcing a
fresh signature (and ratchet rotation) per retransmitted request.
Optionaltag: Uint8Array<ArrayBufferLike> | null = null
The path? request tag that triggered
this response, when known.
Initiates an encrypted link to this remote (OUT) destination.
Delegates to Link.initiate, which generates the ephemeral keypair, builds
and sends the LINKREQUEST, registers the link with the transport, and
transitions to HANDSHAKE. This method then awaits Link.whenActive() so
that the returned link is fully established (LRPROOF validated, session
keys derived) and ready to carry application DATA — e.g. it is safe to call
link.identify(...) immediately on the resolved value.
Decrypts data that was encrypted for this destination's identity.
Tries each owned ratchet private key (newest first) before the long-term
key (§7.4), so messages encrypted to a just-rotated ratchet still decrypt.
Returns null when decryption fails (wrong recipient / unknown key).
The dispatchEvent() method of the EventTarget sends an Event to the object, (synchronously) invoking the affected event listeners in the appropriate order. The normal event processing rules (including the capturing and optional bubbling phase) also apply to events dispatched manually with dispatchEvent().
Enables forward-secrecy ratchets on this destination (§7.4).
The owned ratchet private-key ring is persisted (signed by this destination's identity) so a restart can still decrypt messages encrypted to prior ratchets. On the first run (no persisted ring) an initial key is generated immediately; otherwise the persisted ring is loaded and a fresh key is rotated on the next announce. Inbound packets are decrypted against the private ring before the long-term key.
Encrypts data for this destination's identity.
Gets the salt for key derivation: the destination hash itself.
Whether the periodic re-announce loop is currently running.
Handles incoming packets routed to this destination.
Registers a server-side REQUEST handler for a path string (PROTOCOL-SPEC.md §11.3, §11.4).
The path is hashed to SHA-256(path)[:16] and stored keyed by that hash;
the path string itself never appears on the wire. When a REQUEST arrives
on a Link whose responder destination is this one, Link._handleRequest
looks the handler up by the path hash, enforces the allow mode, and
invokes responseGenerator to produce the response value.
Opaque path token (e.g. "/page/index.mu").
Optionalallow?: numberAuthorization mode.
OptionalallowedList?: Uint8Array<ArrayBufferLike>[]Identity hashes permitted under Allow.LIST.
OptionalautoCompress?: booleanHint for the (future) Resource response path.
Produces the response value.
the 16-byte path hash the handler is keyed under.
The removeEventListener() method of the EventTarget interface removes an event listener previously registered with EventTarget.addEventListener() from the target. The event listener to be removed is identified using a combination of the event type, the event listener function itself, and various optional options that may affect the matching process; see Matching event listeners for removal.
Optionaloptions: boolean | EventListenerOptionsRemoves a previously registered REQUEST handler.
true if a handler was removed.
Responds to an incoming LINKREQUEST by accepting the link.
Delegates to Link.accept, which derives the link_id, generates the
responder ephemeral key, derives the session keys, builds and sends the
LRPROOF, and registers the link with the transport.
OptionalreceivingInterface: Interface | null = null
Interface the LINKREQUEST arrived on; captured as the link's return
path (Link.attachedInterface). Callers should pass what they got from
the link_request event (its detail.receivingInterface field).
Rotates the ratchet ring when the interval has elapsed
(Destination.RATCHET_INTERVAL), inserting the newest key at index 0 and
capping the ring to Destination.MAX_RATCHETS. Pass force to
generate a key unconditionally (used for the initial key). The rotated
ring is persisted (signed by the identity) so a restart retains the
private keys.
No-op when ratchets are not enabled.
Optionalforce: boolean = falseEncrypts the packet payload for this destination and sends it via the bound transport.
The proof receipt tracked by the transport for an opportunistic
CTX_NONE DATA packet (observable via whenSettled()), or null for
any other packet shape.
Starts periodically re-announcing this destination so cached mesh paths stay fresh (PROTOCOL-SPEC.md §7.5 / §9.7 — "non-optional": without it, transit relays evict the path within minutes and peers can no longer reach you).
The first announce fires immediately (so the destination becomes
reachable as soon as the loop starts), then repeats every intervalMs.
Each tick emits an announce (context NONE); a failed tick is logged and
does not stop the loop. An announce whose cadence is superseded while it
is mid-flight (restart/stop) is dropped before broadcasting, so updating
the cadence never emits a straggler.
Calling this while the loop is already running updates the cadence: the existing timer is cleared and a new one armed at the (possibly new) interval, without emitting an extra immediate announce.
intervalMs defaults to DEFAULT_ANNOUNCE_INTERVAL_MS and is
clamped to MIN_ANNOUNCE_INTERVAL_MS (sub-minute intervals trigger
ingress rate limiting and waste airtime — §9.7).
Optionaloptions: { intervalMs?: number } = {}
OptionalintervalMs?: numberCadence in ms (clamped to the floor).
Stops the periodic re-announce loop started by startAnnouncing. Safe to call when not running (no-op).
StaticcleanDrops expired and obsolete peer ratchets from a known-ratchets map. Called
once at startup after persistence hydration (mirrors
RNS.Identity._clean_ratchets): an entry is removed when it is past
Destination.RATCHET_EXPIRY_MS or its destination is no longer in
knownDestinations (the peer was forgotten).
The ratchet map to clean (a transport's instance cache).
The corresponding identity map.
the number of entries removed.
StaticcreateStaticGROUPCreates a GROUP destination.
StaticINStaticOUTStaticPLAINStaticrecalledCreates an OUT destination from a known destination hash (work document
#34) — dialing a peer whose destination hash the application learned
through its own channels (e.g. an rns:// URL) instead of from a stored
Identity.
The peer's public key is required to verify the LRPROOF during link establishment (it is not carried on the wire, so a link request alone cannot authenticate the responder), so the identity is hydrated from the transport's known-destinations cache; when unknown, a path request is sent and the peer's announce awaited — its announce carries the public key that proves the peer's identity during the link proof phase.
16-byte destination hash.
An object that manages destinations and dispatches link requests.
OptionaltimeoutMs: number = 30_000
How long to await the peer's announce when the identity is not cached.
StaticrecallRecalls a learned identity from an explicit map (work doc #37). Called by
TransportCore.recallIdentity with its instance-scoped cache.
StaticrecallRecalls the newest non-expired ratchet public key from an explicit map
(work doc #37). Called by TransportCore.recallRatchet with its
instance-scoped cache.
StaticrememberCaches a learned identity into an explicit map (work doc #37). Called by
TransportCore.rememberIdentity with its instance-scoped cache.
StaticrememberCaches an announced ratchet public key into an explicit map (work doc
#37). Called by TransportCore.rememberRatchet with its instance-scoped
cache.
32-byte ratchet X25519 public key.
StaticSINGLECreates a SINGLE destination.
Represents a Reticulum destination — an addressable endpoint that can announce, receive packets, encrypt/decrypt, and establish Links.