-
Notifications
You must be signed in to change notification settings - Fork 51
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-23 Tagged Data Payload #54
Conversation
tips/TIP-0023/tip-0023.md
Outdated
| Payload Type | uint32 | Set to *value 5* to denote an _Tagged Data Payload_. | | ||
| Tag Length | uint8 | The length of the following tag field in bytes. | | ||
| Tag | ByteArray[Tag Length] | The tag of the data. | | ||
| Data | ByteArray | Binary data. | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how do we know the length of the arbitrary data, shouldn't have a Data Length
field?
Is max data length depend on parent number and tag length?
the Tagged Data Payload must consume the entire byte array of the Payload field of the encapsulating object.
Could you elaborate more about this sentence?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The ByteArray
serialization primitive is described here: https://github.com/Wollac/protocol-rfcs/blob/serialization/tips/TIP-0021/tip-0021.md
In short, it has a leading uint32
to denote its length
the Tagged Data Payload must consume the entire byte array of the Payload field of the encapsulating object.
All this means is that there can not be trailing bytes in the Payload. So the Tagged Data Payload with all its fields fits into Payload Length
of the message
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
according to TIP-18, all ByteArray paired with a length field in structures. for instance State Metadata
has State Metadata Length
in the Alias output. serialization of State Metadata would be uint16 + uint32 + data bytes
which is not correct.
the definition of ByteArray in TIP-21 is not true since the length limitation of ByteArray is vary depends on the object.
@lzpap we currently allow payloads with empty tag and empty data. Is this correct? |
For the indexation payload we allowed empty data, but not empty tag becasue you needed something to index with. Now that we don't do indexing with the Tagged Data Payload, we don't need to enforce the tag IMO. I see value in having empty payload, for example if you just want to issue messages to help confirmation, but you want to do the absolute minimum PoW for the msg. What do you think @alexsporn? |
@lzpap for absolute minimum PoW one would just use no payload |
yes, you are right. The |
This PR creates a new TIP containing the Tagged Data Payload.
It supersedes #50
Rendered Version