Marmot-TS
    Preparing search index...

    Function deserializeApplicationData

    • Deserializes application data bytes back into a rumor, enforcing the Marmot inner-event encoding rules (foundation/application-messages.md §Encoding).

      Strict decode, matching what MDK accepts (cgka-traits MarmotAppEvent::decode):

      • the bytes are valid UTF-8 and one JSON object;
      • the object carries exactly the six members id, pubkey, created_at, kind, tags, content — no sig, no unknown member, no duplicate key;
      • created_at and kind are plain non-negative JSON integers;
      • pubkey and id are 64 lowercase hex characters, tags is an array of string arrays, and no string carries an unpaired surrogate;
      • id equals the canonical NIP-01 event id recomputed from the other members (lowercase-hex SHA-256 of [0, pubkey, created_at, kind, tags, content]).

      This is the integrity half of the authorship checks; the verifyApplicationRumorAuthorship layer adds the MLS-sender binding.

      Parameters

      • data: Uint8Array

        The serialized application data

      Returns Rumor

      The deserialized, id-verified Rumor

      if the bytes are not a strictly-conformant, id-consistent rumor