Skip to content

Commit

Permalink
TIP-23 Tagged Data Payload (#54)
Browse files Browse the repository at this point in the history
* add tip-23

* Update tip-0023.md

* Update tip-0023.md

* Update dynamic bytearray defs (#25)

* Update with "Message" to "Block" renaming to align with IOTA 2.0 terminology

Co-authored-by: Levente Pap <levente.pap@iota.org>
  • Loading branch information
Wollac and lzpap committed Jul 13, 2022
1 parent f768b40 commit 25382ab
Showing 1 changed file with 46 additions and 0 deletions.
46 changes: 46 additions & 0 deletions tips/TIP-0023/tip-0023.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
---
tip: 23
title: Tagged Data Payload
description: Block payload for arbitrary data
author: Wolfgang Welz (@Wollac) <wolfgang.welz@iota.org>
discussions-to: https://github.com/iotaledger/tips/pull/54
status: Draft
type: Standards
layer: Core
created: 2022-01-24
---

# Abstract

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

## Serialized Layout

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

| Name | Type | Description |
|--------------|-------------------|----------------------------------------------------------|
| Payload Type | uint32 | Set to *value 5* to denote an _Tagged Data Payload_. |
| Tag | (uint8)ByteArray | The tag of the data. A leading uint8 denotes its length. |
| Data | (uint32)ByteArray | Binary data. A leading uint32 denotes its length. |

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

- `length(Tag)` must not be larger than [`Max Tag Length`](../TIP-0022/tip-0022.md).
- Given the type and length information, the _Tagged Data Payload_ must consume the entire byte array of the `Payload` field of the encapsulating object.

# 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/).

0 comments on commit 25382ab

Please sign in to comment.