From f36b119caa885d62266a8f302636b6cafc3565a6 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Thu, 2 Nov 2023 12:25:06 +0100 Subject: [PATCH 1/5] Add TIP-53: Tagged Data --- tips/TIP-0053/tip-0053.md | 76 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 76 insertions(+) create mode 100644 tips/TIP-0053/tip-0053.md diff --git a/tips/TIP-0053/tip-0053.md b/tips/TIP-0053/tip-0053.md new file mode 100644 index 000000000..3bd2f365b --- /dev/null +++ b/tips/TIP-0053/tip-0053.md @@ -0,0 +1,76 @@ +--- +tip: 53 +title: Tagged Data Payload +description: Block payload for arbitrary data +author: Philipp Gackstatter (@PhilippGackstatter) +discussions-to: https://github.com/iotaledger/tips/pull/156 +status: Draft +type: Standards +layer: Core +created: 2023-11-02 +replaces: 23 +--- + +# Abstract + +This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the 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): + +
+ Tagged Data +
Data with an optional tag.
+
+ + + + + + + + + + + + + + + + + + + + + +
+ Name + + Type + + Description +
Payload Typeuint8Set to value 0 to denote a Tagged Data Payload.
Tag(uint8)ByteArrayThe tag of the data.
Data(uint32)ByteArrayBinary data.
+ +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 of the `Tag` must not be larger than `64`. +- The length of `Data` must not be larger than `8192`. +- 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/). From 9e95e28c4420884b3ce8ba357fa2614f74ab7894 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Fri, 3 Nov 2023 11:08:27 +0100 Subject: [PATCH 2/5] Format Markdown --- tips/TIP-0053/tip-0053.md | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/tips/TIP-0053/tip-0053.md b/tips/TIP-0053/tip-0053.md index 3bd2f365b..72365850b 100644 --- a/tips/TIP-0053/tip-0053.md +++ b/tips/TIP-0053/tip-0053.md @@ -13,18 +13,22 @@ replaces: 23 # Abstract -This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the 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. +This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the 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. +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): +The following table describes the serialization of a _Tagged Data Payload_ following the notation from +[TIP-21](../TIP-0021/tip-0021.md):
Tagged Data @@ -59,17 +63,21 @@ The following table describes the serialization of a _Tagged Data Payload_ follo -It is important to note that `Tag` is not considered by the protocol, it just serves as a marker for second layer applications. +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 of the `Tag` must not be larger than `64`. - The length of `Data` must not be larger than `8192`. -- Given the type and length information, the _Tagged Data Payload_ must consume the entire byte array of the `Payload` field of the encapsulating object. +- 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. +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 From 8f340258ddaa4545653c167e5705faf2d731885e Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 20 Nov 2023 11:50:46 +0100 Subject: [PATCH 3/5] State lower bounds explicitly --- tips/TIP-0053/tip-0053.md | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/tips/TIP-0053/tip-0053.md b/tips/TIP-0053/tip-0053.md index 72365850b..986d23252 100644 --- a/tips/TIP-0053/tip-0053.md +++ b/tips/TIP-0053/tip-0053.md @@ -11,7 +11,7 @@ created: 2023-11-02 replaces: 23 --- -# Abstract +# Summary This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the 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 @@ -32,7 +32,7 @@ The following table describes the serialization of a _Tagged Data Payload_ follo
Tagged Data -
Data with an optional tag.
+
Optional Data with an optional tag.
@@ -68,10 +68,8 @@ applications. ## Syntactic Validation -- The length of the `Tag` must not be larger than `64`. -- The length of `Data` must not be larger than `8192`. -- Given the type and length information, the _Tagged Data Payload_ must consume the entire byte array of the `Payload` - field of the encapsulating object. +- 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 From bc250f4800cb342bb0eea530676702dbb7234929 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 20 Nov 2023 12:53:43 +0100 Subject: [PATCH 4/5] Capitalize Tag in description --- tips/TIP-0053/tip-0053.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips/TIP-0053/tip-0053.md b/tips/TIP-0053/tip-0053.md index 986d23252..589bd33ba 100644 --- a/tips/TIP-0053/tip-0053.md +++ b/tips/TIP-0053/tip-0053.md @@ -32,7 +32,7 @@ The following table describes the serialization of a _Tagged Data Payload_ follo
Tagged Data -
Optional Data with an optional tag.
+
Optional Data with an optional Tag.
From 0b349b66bc0095dc1a3ecac70d1a264b1368e795 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Mon, 27 Nov 2023 10:31:37 +0100 Subject: [PATCH 5/5] Update tips/TIP-0053/tip-0053.md Co-authored-by: Thibault Martinez --- tips/TIP-0053/tip-0053.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tips/TIP-0053/tip-0053.md b/tips/TIP-0053/tip-0053.md index 589bd33ba..b541169bf 100644 --- a/tips/TIP-0053/tip-0053.md +++ b/tips/TIP-0053/tip-0053.md @@ -13,7 +13,7 @@ replaces: 23 # Summary -This TIP is a slightly revised version of TIP-23 with updates to IOTA 2.0, like the the type prefix of the _Tagged Data_ +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.