Skip to content
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

MIP - Uint64Bytes #216

Open
robdefeo opened this issue Jul 19, 2019 · 3 comments
Open

MIP - Uint64Bytes #216

robdefeo opened this issue Jul 19, 2019 · 3 comments
Assignees
Labels
mip Mailchain Improvement Proposal

Comments

@robdefeo
Copy link
Member

robdefeo commented Jul 19, 2019

Simple Summary

Create a new "data type" that combines a variable size int with a byte array.

Abstract

Data stored in a transaction costs. Messages location MUST be kept private if the sender chooses to send in this way. Using Message Store Identifier (MSI) an int to locate a schema+domain, when adding this value to the transaction data it requires encrypting. MSI is typically 1 byte (max 10). CipherText pads the text if the payload is too small, this will create inefficient storage as bytes are added for padding purposes only.

Specification

  • small int values should take up less bytes than larger ones. E.g. <256 = 1 byte
  • first byte should contain the length of the integer value to efficiently store small int and support large int values.
  • unsigned int should be used as there is no use case for negative values
  • empty byte array is acceptable

Rationale

Combining varint and byte array creates an efficient byte array especially when needing to store multiple fields which need encoding.

Backwards Compatibility

When using this data type in protobuf files and others it should be prefixed with UIB to ensure developers know how to handle the value

Related MIP

@tboeckmann
Copy link
Member

I understand the reason behind this, but I'm not totally sure on the outcome.

Can you add some examples of what this might look like? Or how the padding is handled?

@robdefeo
Copy link
Member Author

robdefeo commented Jul 26, 2019

@robdefeo
Copy link
Member Author

Note "3-byte-number" is repeated as a name the second case should be "zero-value-int"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
mip Mailchain Improvement Proposal
Projects
None yet
Development

No branches or pull requests

2 participants