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.
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.
StaticknownStorage for known destinations.
StaticknownKnown ratchet X25519 public keys per destination (SPEC.md §4.5 step 6.2, §7.4). Maps hex destination hash → array of ratchet pubs (newest first). Populated from validated announces; consumed by the inbound-decrypt tolerance path once full ratchet support lands.
StaticMAX_Maximum number of retained ratchet keys for decryption tolerance.
StaticRATCHET_Default ratchet rotation interval (Destination.RATCHET_INTERVAL = 30 min). A destination with ratchets enabled rotates its key at most this often.
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.
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).
Generates the initial ratchet keypair. The newest ratchet public key is then embedded in subsequent announces, and inbound packets are decrypted against the private ring before the long-term key. Ratchet private keys are held in memory only for now (persistence lands with the storage layer); a restart therefore rotates the ratchet.
Encrypts data for this destination's identity.
Gets the salt for key derivation.
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.
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).
No-op when ratchets are not enabled.
Optionalforce: boolean = falseEncrypts the packet payload for this destination and sends it via the bound transport.
StaticcreateStaticGROUPCreates a GROUP destination.
StaticINStaticOUTStaticPLAINStaticrecallStaticrecallRecalls the ratchet ring for a destination (newest first), or null.
Consumed by the inbound-decrypt tolerance path (SPEC.md §7.4): a sender may have encrypted to a just-rotated previous ratchet, so the receiver tries each privkey in the ring before falling back to the long-term key.
StaticrememberRemember a destination.
StaticrememberRemembers a ratchet X25519 public key announced for a destination (SPEC.md
§4.5 step 6.2). Called only for validated announces where context_flag
was set and the ratchet is non-empty. Newest ratchets are prepended so the
ring is newest-first; duplicates are skipped.
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.