r/bitmessage • u/Petersurda BM-2cVJ8Bb9CM5XTEjZK1CZ9pFhm7jNA1rsa6 • Jun 03 '16
Proposals for content data structure
As you know, the Bitmessage protocol only specifies content encoding for simple messages, see https://bitmessage.org/wiki/Protocol_specification#Message_Encodings. This makes it a challenge to include attachments, and pictures have to be kludged by base64 encoded html, which then needs to be detected and turned on by the recipient.
During the current development cycle I would like to extend this to arbitrary content. I did some tests: https://bitmessage.org/forum/index.php/topic,3320.msg11207.html#msg11207 and as I say there, I'm leaning towards bencode compressed with zlib (and keeping utf-8 for text components like it is now).
That still leaves the question open the data structure. Should there just be one structure for messages, with the possibility of using a different, arbitrary, structure, for other purposes, such as machine to machine communication, or should there be a master type, which is then subdivided into messages and others? Or should there be a combination, e.g. encoding 3 for messages, encoding 4 for arbitrary data (but still using bencode + zlib) and encoding 5 for "unspecified raw data"?
And what should the messages be like? Should we reuse the good parts of MIME (in particular content types)? How would the headers be stored (also how would the headers be stored in the sqlite database in PyBitmessage)? Should we reuse the format of email headers?
What about chunking messages into multiple objects, should that be standardised or not? And, should we raise the maximum message size? At the moment it's about 1.6MB if I recall correctly.
I'm looking for input here.
View all comments
Show parent comment
1
u/mirrorwish_ BM-87ZQse4Ta4MLM9EKmfVUFA4jJUms1Fwnxws Jun 08 '16 edited Jun 08 '16
That's a good idea. It's probably best to have both parent, parent-of-parent and so on until the root, as that would allow to place messages correctly even if some of them are missing.
Each item can be either the hash of the corresponding message, or the message itself. The sender can choose if he wants to do extra work to make sure the parent messages stay in the network, or if he just want to refer to them by their hash. Edit: On further thought it is probably best to only refer to messages by their hash here.
That's a good point.
Edit Another thing that would be nice would be to have votes (like on reddit). Something like this: