Initial MTX Messaging layer proposal #71
Draft
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.
This commit proposes suggested validation logic for a messaging layer
that would exist as an extension to the existing MTX logic available
from v2.4.1 of the codebase. The messaging layer would allow a sender
of a transaction to append a message (known in the code as a memo) to
the last destination tag of an MTX, using any remaining space available
in the dst[] field.
Messaging layer specification:
To maintain transaction type conformity, a transaction identified as a
MTX Memo transaction SHALL have a memo exist in the transaction.
To distinguish a memo from the dst[] tags, a memo SHALL always begin
and end with a zero (0) byte (null termination char).
To avoid binary abuse of the messaging layer, a memo SHALL contain only
printable characters, as per the default C locale, and any remaining
dst[] array space AFTER the the end of a memo SHALL be zero filled.
To offset the validation costs of longer messages, the fee incurred for
a memo of a certain length shall be equal to the fees incurred by tags
that would otherwise use such a length.
The fee formula:
(messagefees) = (fee) * (1 + ((messagelength + 1) / sizeof(MDST)))
'1 + ...' ensures that a fee is always paid by messages that do not
utilize the entire space (MDST) of a dst[] field.
'... (messagelength + 1) ...' ensures the initial zero (0) byte,
which utilizes dst[] tag space, is accounted for in fee calculation.
Notes...
Currently the fee calculation does not include the required ending zero
byte terminating character. This allows a message to include a network
fee for the first 19 characters and a subsequent network fee for every
20 characters thereafter. Accounting for the ending zero byte will
introduce further (and objectively) unecessary validation processes.