reticulum-js
    Preparing search index...

    Function unwrapChannelMessage

    • Decrypts and reconstructs an LXMF message from a channel inner_blob.

      Inverse of wrapChannelMessage: EC-decrypts with the channel identity, verifies the RTID magic, extracts the embedded sender public key, and feeds the reconstructed LXMF wire block to Message.deserialize. The sender identity is cached via the transport's instance-scoped cache (work doc #37) so subsequent messages from the same sender validate without the prelude.

      The prelude key is bound to the message before anything is remembered: the key's own lxmf.delivery destination hash must equal the source_hash taken verbatim from the LXMF tail, or the post is rejected and nothing is cached (RFed/SPEC.md "Key binding" — without it, anyone who knows the channel name could overwrite a contact's cached key). The returned signatureValid is then the integrity check of the accepted post: a forged sender_identity_pub produces a signature mismatch.

      Parameters

      • opts: {
            channelDeliveryHash: Uint8Array<ArrayBufferLike>;
            channelIdentity: Identity;
            innerBlob: Uint8Array<ArrayBufferLike>;
            rns: Reticulum;
        }
        • channelDeliveryHash: Uint8Array<ArrayBufferLike>

          Channel's lxmf.delivery destination hash (prepended to the LXMF tail before deserialisation).

        • channelIdentity: Identity

          Channel's derived Identity (holds the private key used to EC-decrypt).

        • innerBlob: Uint8Array<ArrayBufferLike>

          EC-encrypted channel message (no channel-hash prefix, no stamp).

        • rns: Reticulum

          Reticulum instance whose transport caches the sender identity (work doc #37: there is no class-level shared cache anymore).

      Returns Promise<
          {
              message: Message;
              senderIdentity: Identity;
              senderPub: Uint8Array;
              signatureValid: boolean;
              sourceHash: Uint8Array;
          },
      >

      when decryption fails, the magic is absent, or the LXMF tail cannot be parsed.