Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

TIP-53: Tagged Data #156

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
82 changes: 82 additions & 0 deletions tips/TIP-0053/tip-0053.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,82 @@
---
tip: 53
title: Tagged Data Payload
description: Block payload for arbitrary data
author: Philipp Gackstatter (@PhilippGackstatter) <[email protected]>
discussions-to: https://github.com/iotaledger/tips/pull/156
status: Draft
type: Standards
layer: Core
created: 2023-11-02
replaces: 23
---

# Summary

This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the type prefix of the _Tagged Data_
Payload type and its syntactic validation. The payload concept offers a very flexible way to combine and encapsulate
information in the IOTA protocol. This document proposes a basic payload type that allows the addition of arbitrary
data.

# Motivation

The most flexible way to extend an existing object is by the addition of arbitrary data. This payload provides a way to
do just that. An optional tag can be used to categorize the data.

# Specification

## Tagged Data

The following table describes the serialization of a _Tagged Data Payload_ following the notation from
[TIP-21](../TIP-0021/tip-0021.md):

<details>
<summary>Tagged Data</summary>
<blockquote>Optional Data with an optional Tag.</blockquote>
</details>
<table>
<tr>
<td>
<b>Name</b>
</td>
<td>
<b>Type</b>
</td>
<td>
<b>Description</b>
</td>
</tr>
<tr>
<td>Payload Type</td>
<td>uint8</td>
<td>Set to <strong>value 0</strong> to denote a <i>Tagged Data Payload</i>.</td>
</tr>
<tr>
<td>Tag</td>
<td>(uint8)ByteArray</td>
<td>The tag of the data.</td>
</tr>
<tr>
<td>Data</td>
<td>(uint32)ByteArray</td>
<td>Binary data.</td>
</tr>
</table>

It is important to note that `Tag` is not considered by the protocol, it just serves as a marker for second layer
applications.

## Syntactic Validation

- The length `Len` of the `Tag` field must satisfy: `0 <= Len <= 64`.
PhilippGackstatter marked this conversation as resolved.
Show resolved Hide resolved
- The length `Len` of the `Data` field must satisfy: `0 <= Len <= 8192`.

# Rationale

As the tag is not considered by the protocol, it could also be removed completely. However, Legacy IOTA and Chrysalis
supported sending of arbitrary data indexed with a tag. Thus, in order to simplify the migration of second layer
applications using these protocols, the optional `Tag` has been added which can be used in a similar manner.

# Copyright

Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).
Loading