<spanclass="c1">// Lamport timestamp of the event as described in [Status Payload Specs](status-payload-specs.md#clock-vs-timestamp-and-message-ordering)</span>
<spanclass="na">CHAT_CREATED</span><spanclass="o">=</span><spanclass="mi">1</span><spanclass="p">;</span><spanclass="c1">// See [CHAT_CREATED](#chat-created)</span>
<spanclass="na">NAME_CHANGED</span><spanclass="o">=</span><spanclass="mi">2</span><spanclass="p">;</span><spanclass="c1">// See [NAME_CHANGED](#name-changed)</span>
<spanclass="na">MEMBERS_ADDED</span><spanclass="o">=</span><spanclass="mi">3</span><spanclass="p">;</span><spanclass="c1">// See [MEMBERS_ADDED](#members-added)</span>
<spanclass="na">MEMBER_JOINED</span><spanclass="o">=</span><spanclass="mi">4</span><spanclass="p">;</span><spanclass="c1">// See [MEMBER_JOINED](#member-joined)</span>
<spanclass="na">MEMBER_REMOVED</span><spanclass="o">=</span><spanclass="mi">5</span><spanclass="p">;</span><spanclass="c1">// See [MEMBER_REMOVED](#member-removed)</span>
<spanclass="na">ADMINS_ADDED</span><spanclass="o">=</span><spanclass="mi">6</span><spanclass="p">;</span><spanclass="c1">// See [ADMINS_ADDED](#admins-added)</span>
<spanclass="na">ADMIN_REMOVED</span><spanclass="o">=</span><spanclass="mi">7</span><spanclass="p">;</span><spanclass="c1">// See [ADMIN_REMOVED](#admin-removed)</span>
</code></pre></div></div><h3id="payload"><ahref="#payload"class="anchor-heading"aria-labelledby="payload"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Payload </h3><p><codeclass="language-plaintext highlighter-rouge">MembershipUpdateMessage</code>:</p><divclass="table-wrapper"><table><thead><tr><th>Field</th><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>chat-id</td><td><codeclass="language-plaintext highlighter-rouge">string</code></td><td>The chat id of the chat where the change is to take place</td></tr><tr><td>2</td><td>events</td><td>See details</td><td>A list of events that describe the membership changes, in their encoded protobuf form</td></tr><tr><td>3</td><td>message</td><td><codeclass="language-plaintext highlighter-rouge">ChatMessage</code></td><td>An optional message, described in <ahref="./6-payloads.md#message">Message</a></td></tr></tbody></table></div><p><codeclass="language-plaintext highlighter-rouge">MembershipUpdateEvent</code>:</p><divclass="table-wrapper"><table><thead><tr><th>Field</th><th>Name</th><th>Type</th><th>Description</th></tr></thead><tbody><tr><td>1</td><td>clock</td><td><codeclass="language-plaintext highlighter-rouge">uint64</code></td><td>The clock value of the event</td></tr><tr><td>2</td><td>members</td><td><codeclass="language-plaintext highlighter-rouge">[]string</code></td><td>An optional list of hex encoded (prefixed with <codeclass="language-plaintext highlighter-rouge">0x</code>) public keys, the targets of the action</td></tr><tr><td>3</td><td>name</td><td><codeclass="language-plaintext highlighter-rouge">name</code></td><td>An optional name, for those events that make use of it</td></tr><tr><td>4</td><td>type</td><td><codeclass="language-plaintext highlighter-rouge">EventType</code></td><td>The type of event sent, described below</td></tr></tbody></table></div><h3id="chat-id"><ahref="#chat-id"class="anchor-heading"aria-labelledby="chat-id"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Chat ID </h3><p>Each membership update MUST be sent with a corresponding <codeclass="language-plaintext highlighter-rouge">chatId</code>. The format of this chat ID MUST be a string of <ahref="https://tools.ietf.org/html/rfc4122">UUID</a>, concatenated with the hex-encoded public key of the creator of the chat, joined by <codeclass="language-plaintext highlighter-rouge">-</code>. This chatId MUST be validated by all clients, and MUST be discarded if it does not follow these rules.</p><h3id="signature"><ahref="#signature"class="anchor-heading"aria-labelledby="signature"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Signature </h3><p>The node calculates the signature for each event by encoding each <codeclass="language-plaintext highlighter-rouge">MembershipUpdateEvent</code> in its protobuf representation and prepending the bytes of the chatID, lastly the node signs the <codeclass="language-plaintext highlighter-rouge">Keccak256</code> of the bytes using the private key by the author and added to the <codeclass="language-plaintext highlighter-rouge">events</code> field of MembershipUpdateMessage.</p><h3id="group-membership-event"><ahref="#group-membership-event"class="anchor-heading"aria-labelledby="group-membership-event"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> Group membership event </h3><p>Any <codeclass="language-plaintext highlighter-rouge">group membership</code> event received MUST be verified by calculating the signature as per the method described above. The author MUST be extracted from it, if the verification fails the event MUST be discarded.</p><h4id="chat_created"><ahref="#chat_created"class="anchor-heading"aria-labelledby="chat_created"><svgviewBox="0 0 16 16"aria-hidden="true"><usexlink:href="#svg-link"></use></svg></a> CHAT_CREATED </h4><p>Cha