Constructs an LXMF message.
Optionalcontent?: stringOptionalfields?: Record<string, any> | Map<string, any>OptionalmessageId?: Uint8Array<ArrayBufferLike>SHA-256 of the hashed part (§5.5).
Optionalsignature?: Uint8Array<ArrayBufferLike>OptionalsignedPart?: Uint8Array<ArrayBufferLike>Optionalstamp?: Uint8Array<ArrayBufferLike>Optional proof-of-work stamp (§5.7).
Optionaltimestamp?: numberOptionaltitle?: stringSerializes the Message into the LXMF wire format.
If this.stamp is set (e.g. a proof-of-work stamp from the Stamper, or a
ticket-derived stamp), it is appended as the 5th payload element. The
signature and message_id are always computed over the 4-element payload
(§5.5), so adding or removing a stamp never invalidates the signature.
Serializes and encrypts the message into the paper delivery form, ready to
be encoded as an lxm:// URI or QR code (LXMessage.pack() PAPER branch).
The encrypted paper payload must fit within PAPER_MDU bytes (the
QR-code capacity); a TypeError is thrown otherwise, mirroring the
Python reference.
recipient lxmf.delivery destination (Direction.OUT; holds the
recipient public key + recalled ratchet).
Serializes, encrypts, and encodes the message as an lxm:// URI
(LXMessage.as_uri): the URL-safe base64 of the paper payload, padding
stripped, prefixed with the lxm scheme.
Packs this message into the propagation ("lxmf_data") form used when submitting to a propagation node or syncing between nodes (§5.3):
lxmf_data = destination_hash(16) || E_outbound(source_hash(16) || signature(64) || payload)
Only the leading destination hash is in cleartext (so the node can route
by recipient and compute the dedup key); the body is encrypted to the
recipient (using their recalled ratchet when one is known, §7.4). The
transientId is SHA-256 over the whole lxmf_data and is the store/
dedup key (LXMRouter.lxmf_propagation).
Serializes first if needed.
recipient lxmf.delivery destination (Direction.OUT; holds the
recipient public key + recalled ratchet). Must share this message's
destinationHash.
Verifies the message signature against a sender identity, tolerating msgpack encoder variance per §5.6.
Two candidate signed buffers are tried:
this.signedPart — computed from the raw wire payload (unstamped) or
the stamp-stripped re-pack (stamped).The sender's identity.
StaticdeserializeCreates a Message from wire data.
Accepts both the direct layout (dest+source+signature+payload) and the
opportunistic layout (source+signature+payload, with the destination hash
supplied separately via expectedDestinationHash).
If the payload carries an optional 5th stamp element (§5.7.1), it is
stripped and the first four elements are re-packed before the message_id
and signed_part are computed — exactly matching the upstream Python
unpack_from_bytes behaviour, so a stamp never invalidates the signature.
OptionalexpectedDestinationHash: Uint8Array<ArrayBufferLike>
Required for opportunistic delivery.
StaticfromDecrypts and reconstructs an LXMF message from raw paper data. The paper
form is byte-identical to the propagation lxmf_data form, so this
delegates to Message.fromPropagationData
(LXMRouter.lxmf_propagation with is_paper_message=True).
recipient's inbound lxmf.delivery destination.
null when decryption fails (wrong
recipient / unknown ratchet) or the input is too short.
StaticfromDecrypts and reconstructs an LXMF message from an lxm:// URI — the
inverse of Message.toPaperUri
(LXMRouter.ingest_lxm_uri + lxmf_propagation).
StaticfromDecrypts and reconstructs an LXMF message from its propagation
("lxmf_data") form (§5.3). The destination hash is taken from the leading
16 bytes; the remainder is decrypted with the recipient's inbound
lxmf.delivery destination (long-term key + owned ratchet ring, §7.4).
recipient's inbound lxmf.delivery destination.
null when decryption fails (wrong
recipient / unknown ratchet) or the input is too short.
StaticpaperParses an lxm:// URI back into the raw encrypted paper data
(LXMRouter.ingest_lxm_uri). The scheme match is case-insensitive and
any stray / characters in the body are tolerated, matching the Python
reference's lenient decoding.
StaticpaperFormats raw paper data as an lxm:// URI.
StatictransientComputes the propagation dedup key transient_id = SHA-256(lxmf_data)
(LXMRouter.lxmf_propagation). Identical on both client and node.
Represents an LXMF message.