> For the complete documentation index, see [llms.txt](https://docs.ltonetwork.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.ltonetwork.com/protocol/private/events/event.md).

# Event

An event on the event chain can be compared to a transaction on a blockchain. An event has the following structure

<table><thead><tr><th width="183">Field</th><th></th></tr></thead><tbody><tr><td><code>mediaType</code></td><td>MIME type of the data</td></tr><tr><td><code>data</code></td><td>Binary</td></tr><tr><td><code>previous</code></td><td>The hash of the previous event</td></tr><tr><td><code>timestamp</code></td><td>Unix timestamp in milliseconds. Time of when the event was signed</td></tr><tr><td><code>signKey</code></td><td>Public key with key type</td></tr><tr><td><code>signature</code></td><td>Signature of the binary representation of the event</td></tr><tr><td><code>hash</code></td><td>Hash of the binary representation of the event</td></tr></tbody></table>

### JSON

```json
{
  "timestamp": 1519883600,
  "previous": "BRFnaH3UFnABQ1gV1SvT9PLo5ZMFzH7NhqDSgyn1z8wD",
  "signKey": {
    "keyType": "ed25519",
    "publicKey": "2KduZAmAKuXEL463udjCQkVfwJkBQhpciUC4gNiayjSJ"
  },
  "signature": "2hqLhbmh2eX2WhAgbwHhBZqzdpFcjWBYYN5WBj8zcYVKzVbnVH7mESCC9c9acihxWFwfvufnFYxxgFMgJPbpbU4N",
  "hash": "9Y9DhjXHdrsUE93TZzSAYBWZS5TDWWNKKh2mihqRCGXh",
  "mediaType": "application/json",
  "data": "base64:eyJmb28iOiJiYXIiLCJjb2xvciI6ImdyZWVuIn0="
}
```

* `previous`, `signKey.publicKey`, `signature`, and `hash` are base58 encoded
* `data` is base64 encoded, and must be prefixed with `base64`.

### Binary schema

The binary representation is used for signing and hashing the event.

{% tabs %}
{% tab title="v2" %}

| Field                 | Type                     | Length   |
| --------------------- | ------------------------ | -------- |
| Previous              | Hash (Bytes)             | 32       |
| Key type              | KeyType (Byte)           | 1        |
| Public key            | PublicKey (Array\[Byte]) | 32 \| 33 |
| Timestamp             | Long                     | 8        |
| Media type length (N) | Short                    | 2        |
| Media type            | Array\[Byte]             | N        |
| Data length (M)       | Short                    | 2        |
| Data                  | Array\[Byte]             | M        |
| {% endtab %}          |                          |          |

{% tab title="v1 (deprecated)" %}

| Field         | Type                     | Length   |
| ------------- | ------------------------ | -------- |
| Previous      | Hash (Bytes)             | 32       |
| Key type      | KeyType (Byte)           | 1        |
| Public key    | PublicKey (Array\[Byte]) | 32 \| 33 |
| Timestamp     | Long                     | 8        |
| Media type    | Array\[Byte]             | ?        |
| Data          | Array\[Byte]             | ?        |
| {% endtab %}  |                          |          |
| {% endtabs %} |                          |          |


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.ltonetwork.com/protocol/private/events/event.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
