This repository was archived by the owner on Feb 18, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 52
TIP-53: Tagged Data #156
Draft
PhilippGackstatter
wants to merge
5
commits into
main
Choose a base branch
from
tip53
base: main
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
TIP-53: Tagged Data #156
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
f36b119
Add TIP-53: Tagged Data
PhilippGackstatter 9e95e28
Format Markdown
PhilippGackstatter 8f34025
State lower bounds explicitly
PhilippGackstatter bc250f4
Capitalize Tag in description
PhilippGackstatter 0b349b6
Update tips/TIP-0053/tip-0053.md
PhilippGackstatter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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) <philipp.gackstatter@iota.org> | ||
| 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`. | ||
| - 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/). | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.