From c0c274abd91ea9588a4db0489cce28c472affb08 Mon Sep 17 00:00:00 2001 From: Philipp Gackstatter Date: Thu, 21 Dec 2023 13:23:53 +0100 Subject: [PATCH] Motivate key-value pairs in metadata --- tips/TIP-0038/tip-0038.md | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/tips/TIP-0038/tip-0038.md b/tips/TIP-0038/tip-0038.md index a69f44125..295481a96 100644 --- a/tips/TIP-0038/tip-0038.md +++ b/tips/TIP-0038/tip-0038.md @@ -1049,6 +1049,23 @@ revert it. In conclusion, it is very difficult to backdate even with just accept waiting for higher levels of finality. This attack relates to the fundamental fact that the best approximation of time is the block's `Issuing Time` timestamp, which is is meant to be very difficult to falsify. +## Metadata Feature Map + +In Stardust, the Metadata Feature was defined as an arbitrary byte array to allow applications to be built on top of the +data stored in the ledger. However, only one such feature was allowed in a given output making it practically impossible +for two independent applications to both store data in the same output. Moreover, it was hard to identify what +application has written data into the metadata, making it tough for applications, such as wallets, that read these +values, to interpret the data correctly. To address this, the feature was changed to a map of key-value pairs, where the +keys are human-readable identifiers and the keys are arbitrary byte values. This additional level of abstraction allows +multiple applications to write data into the same output, as long as they use different keys. The keys are limited to +printable ASCII characters (excluding space) such that it's easy for a human to read which keys are in a given feature +(for example in explorers or when looking at the JSON response from an API). In order for applications to avoid naming +collisions in the key, another registry TIP could be considered where applications can reserve their keys. Although not +enforced by the protocol, this would help avoid collisions and, as a side-effect, means that the data writers can define +their encoding, compression or other relevant information for the correct interpretation of the data. That allows +wallets and other data readers to detect content based on the keys, which is much more resilient than attempting to +inspect the raw bytes for magic bytes, encoding or compression markers. + # Copyright Copyright and related rights waived via [CC0](https://creativecommons.org/publicdomain/zero/1.0/).