Mai 11, 2020

Discover IOTA Streams

Discover IOTA Streams

The IOTA Foundation announced the alpha version of the IOTA Streams library - which is a rework and rebranding of MAM - Masket Authenticated Messaging. With the new name, people should directly know the purpose of streams - data get streamed through the tangle.

Like on Youtube - there are authors and subscribers. Authors can publish signed and tagged messages into their channel. The subscriber can fetch and read the messages, if he has access to the channel.

The Streams library is written in Rust and builded and maintained by Vlad Semenov [IF] #8334.

The  IOTA Experience Team (X-Team) has an Initiative with the focus on IOTA Streams. You can watch the Project Kickoff here.

Examples and PoC

Members of the X-Team developed some examples, how to use the Streams library which we discover now.

The first one is a Proof of Concept of IOTA Streams developed by reiloy#1823. You can create channels and subscribe to it directly in the terminal.

https://github.com/gallegogt/poc-iota-streams

An short interview with the developer reiloy#1823:

What did you try to solve?
At the moment it is just proof of concept and help me understand the new concepts.

Did you solve it?
Partly yes

Is there anything blocking you?
Little documentation, and little integration of the other components or library developed by the foundation(bee, iota-rs, streams). Many of the functionalities of bee are repeated within streams- * instead of reusing those modules and achieving a better coupling between all

Simple Streams

The second project tries to simplify the usage of IOTA Streams, so that developers don't need to know much about IOTA and IOTA Streams and can just use it. It’s developed by AleB#6661.

With simple functions like channel_author.open() and channel_subscriber.connect(), there is a whole example how it works.

https://github.com/AleBuser/iota-channels-lite

A short interview with the developer AleB#6661.

What did you try to solve?
As with every new technology, especially the ones as complex as DLT, it is very difficult for developers new to the topic to get started building use-cases. IOTA-Streams is not different and there is a large set of specific details (for eg. Transaction types, Weight Magnitude, Trits, ecc.) which might not be understood by developers outside the IOTA Ecosystem. My goal was to abstract all these details behind a simple narrow API that only requires minimal IOTA know-how, and by this, making IOTA-Streams available to everyone.

Did you solve it?
I hope I did, the current version of the channels-lite has only 5 methods for author and 5 for subscribers, the only configuration needed is the seeds and the node. To definitively know if I succeeded I would have to see a developer new to IOTA successfully using the library to build a use-case.

Are there any things, which blocks you?
I would like to add an option for the author to remove a subscriber without the subscriber first sending the unsubscribe message, this might be needed if the author unilaterally decides that the subscriber should not receive new data . From what I understood this is currently not possible. But detailed documentation is still not available which makes it more difficult to understand what is in fact possible and what not.

What did you learn?
I learned the basic communication flow for using channels, what keys need to be shared at what time and how the different message types are used. This gives me a much better understanding of the possible use-cases for streams, but also what the limitations are. The biggest surprise was the understanding that there needs to be an active exchange of information outside of the channel application, this is different from the first version of MAM and will probably have both benefits and drawbacks.

WebAssembly with Rust

Another cool demo, which i want to mention is a IOTA address generation with WASM. WASM stands for WebAssembly and you can use it to run Rust in a web browser.

https://github.com/Thoralf-M/iota-kerladdress-wasm

Where to go from here?

My proposal: Extend the libraries!
Mathieu#0042 from theTangle.org wants to build a IOTA Streams decoder (like this for MAM https://thetangle.org/mam) and needs a NodeJS library for that.

it's definitely the most performant to use direct binding in NodeJS
Martyn Janes [IF] #1455,