IOTA tutorial 19: Masked Authenticated Messaging

Поделиться
HTML-код
  • Опубликовано: 2 апр 2018
  • If you like this video and want to support me, go this page for my donation crypto addresses:
    / mobilefish
    This is part 19 of the IOTA tutorial.
    In this video series different topics will be explained which will help you to understand IOTA.
    It is recommended to watch each video sequentially as I may refer to certain IOTA topics explained earlier.
    The main objective of this video is to provide you with some basic knowledge about Masked Authenticated Messaging.
    IOTA is specific developed for Internet of Things (IoT) or Machine-to-Machine (M2M) economy.
    IoT devices will generate a huge amount of data which can be stored on the Tangle.
    These IoT devices can broadcast data using different types of wireless technologies, such as WiFi, BlueTooth, LoRa, ZigBee, etc.
    This LoRa node transmits sensor data to a receiver, also called LoRa gateway.
    The LoRa gateway is connected to the Internet and sends the data to a server.
    This server is running a NodeJS Masked Authenticated Messaging (MAM) application which in turn sends sensor data to the Tangle.
    Masked Authenticated Messaging means:
    - The message is encrypted (Masked).
    - The message is confirmed to be coming from the device (Authenticated).
    - A continuous message stream is created on the Tangle and will carry on until the device stop publishing the data (Messaging).
    Masked Authenticated Messaging is a module build on top of IOTA that makes it possible to send messages fully encrypted from authenticated parties.
    IOTA Masked Authenticated Messaging (MAM) makes it possible for sensors and other devices to encrypt entire message streams and securely store those in the Tangle each on a separate address.
    Only authorised parties will be able to read and reconstruct the entire message stream.
    In MAM only those with the right channel IDs get access to the message.
    IOTA uses the gossip protocol to propagate messages through the network.
    Bob publishes sensor data to the Tangle under channel id "ABC".
    Alice is interested in Bob's sensor data and subscribe to his channel id.
    When a message with channel id "ABC" reaches Alice's node, she will be notified.
    Messages from Charlie will be ignored.
    In a Masked Authenticated Messaging stream or message chain, every message holds a reference to the next message.
    The message stream only flows one direction.
    A subscriber with a channel ID has no access to the upstream messages.
    In a Masked Authenticated Messaging stream the message is encrypted (masked) and the message also contains a signature.
    The signature proves that the publisher created the message.
    Interesting points to remember:
    The channel ID is also called the root.
    The message is attached to the Tangle using this root.
    When the message is attached to the Tangle, the transaction does not need to be confirmed.
    After a snapshot all messages are deleted from the Tangle.
    The messages are still available, if the subscriber is connected to a permanode.
    A Masked Authenticated Messaging Demo:
    www.mobilefish.com/services/c...
    This demo uses the MAM Javascript library mam.web.js for web applications.
    The MAM Javascript library publish transactions to the Tangle that contain only messages, with no value.
    The MAM Client JS Library is a wrapper library which uses the WebAssembly iota-bindings-emscripten.wasm file.
    - WebAssembly is a new binary format for executing code on the web.
    - Rust is a programming language similar to C++.
    - Emscripten is a source-to-source compiler which can also produce WebAssembly.
    The side_key is used to encrypt and decrypt the message.
    The side_key is required when using the restricted mode.
    The publisher publishes messages using the root.
    The publisher can choose the following channel modes:
    - Public: address = root
    Messages can be unwrapped by anybody using the address.
    - Private: address = hash(root)
    Messages can only be unwrapped if you have the right root, and the root can‘t be deducted from the address due to the hash.
    - Restricted: address = hash(root)
    Messages can only be unwrapped if you have the right root and side_key.
    The MAM library creates the masked payload and calls the iota.api.sendTransfer function.
    The sendTransfer function in turn calls the iota.api.prepareTransfers function which divides the masked payload in smaller parts.
    Each part size will be 2187 trytes, representing a signatureMessageFragment.
    A transaction object is created for each part.
    The transaction objects together forms a transaction bundle.
    Check out all my other IOTA tutorial videos:
    • IOTA tutorials
    Subscribe to my RUclips channel:
    / @mobilefish
    The presentation used in this video tutorial can be found at:
    www.mobilefish.com/developer/...
    #mobilefish #howto #iota
  • НаукаНаука

Комментарии • 56

  • @youtubeuno7779
    @youtubeuno7779 6 лет назад

    Amazing job. Thanks for sharing. Keep it up the excelent work!

  • @JoshisShorts
    @JoshisShorts 6 лет назад

    Great video. Thank you mobilefish :)

  • @BenRoyce
    @BenRoyce 6 лет назад

    excellent as usual. the best youtube videos to learn IOTA

  • @ydx6152
    @ydx6152 6 лет назад +5

    Very nice channel RUclips!! keep your work!! :) Thanks again

  • @KumarAnirudha
    @KumarAnirudha 6 лет назад

    Great job! Very nicely explained! :)

  • @zengbinsun4580
    @zengbinsun4580 6 лет назад

    Pretty clear, thank you.

  • @danielbolton6895
    @danielbolton6895 6 лет назад

    Wow. Great vid. Thanks.

  • @j.w.7664
    @j.w.7664 6 лет назад

    Perfect video, thx

  • @SS-605
    @SS-605 5 лет назад

    Hi, Professor I have a question. At 27:53 you mentioned that "the address is not calculated the same way as calculating the address for a normal transaction". So how it will be calculated? Because I confuse it with 19:51 where you have discussed Root and Next_Root fields and refer to the address computation you mentioned in IOTA tutorial 17 Cacluate Address Review part.

  • @tfmc6326
    @tfmc6326 6 лет назад

    Love your work! Can you please make a simple to understand video on how to setup a fullnode in iota??

    • @Mobilefish
      @Mobilefish  6 лет назад

      At this moment I am not planning to make such videos. Maybe in the future...

  • @fisicaSars
    @fisicaSars 4 года назад

    How can I generate an MHT with multiple nodes? A big message? what size of data for each leaf?

  • @jonathanwang1356
    @jonathanwang1356 6 лет назад

    Question: if I publish a series of MAM(say 1-100 in sequence). is it possible that certain messages that published first( say 20-35) are not confirmed but later messages (say 36-45) are confirmed prior to those published first?
    Any rule on the sequencing?
    Thank you

    • @spacemonk4874
      @spacemonk4874 5 лет назад

      The transactions do not need to be confirmed.

  • @SS-605
    @SS-605 5 лет назад

    Sir can you please tell me what is the difference between sidekey and ChannelKey. Isn't it the same?

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    unfortunately, I do not how to read Rust for now. Am I right to say that MAM module is actually made up of a lot of bundles and what MAN does it just to link them together and at the same time support pub/sub functionality?

    • @Mobilefish
      @Mobilefish  6 лет назад

      When they updated the library I have not checked how the MAM module is now build. So I can not answer the question.

  • @danielecarlacci533
    @danielecarlacci533 5 лет назад

    Thank's for your job.
    A question: if a snapshot deletes all MAM messages, and these will be kept only by the few permanodes, what is the difference compared to the central ledger? Because a company should find it convenient to use MAM to keep a message, rather than storing it on a personal server?

    • @Mobilefish
      @Mobilefish  5 лет назад

      There is no such thing as a "central ledger"?
      After a snapshot:
      - all nodes only contains addresses containing values (=IOTAS), all other data are pruned.
      - all permanodes contains addresses containing values + address containing data (=messages)

  • @mohdmajidakhtar2122
    @mohdmajidakhtar2122 4 года назад

    Sir data reciever is not working anymore on any endpoints. Can you tell me why?

  • @Flippy1565
    @Flippy1565 5 лет назад +1

    at the half of the video i quit - this is for a normal guy to massive :D
    but thank you for sharing this... i know... smarter people than me will like it
    but i know how a sponge- construction work^^

  • @longfield8978
    @longfield8978 6 лет назад

    Hi Robert, thanks for video.
    And question again, how receiver (or subscriber to the channel with chan. Id=ABC for example in your demo) to pay iota for receiving data from tangle ?

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      The IOTA data market uses MAM. At this moment the IOTA data market is not made public yet (data.iota.org/).
      To answer your question: I do not know. I am also waiting for more information.

    • @longfield8978
      @longfield8978 6 лет назад

      Mobilefish.com thanks for answering

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    iota-bindings-emscripten.wasm is longer at the location you specified(time 6:25), so is there a structural change? or?

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      The library mam.client.js has changed! Unfortunately my RUclips still refers to the old library.
      I cannot update my RUclips video each time changes are made in the library.
      But I will update my tools. The file: www.mobilefish.com/services/cryptocurrency/mam.html is updated (see the source code, and read the installation instructions).

    • @Mobilefish
      @Mobilefish  6 лет назад

      No need to refer iota-bindings-emscripten.wasm

    • @hamiltonw3242
      @hamiltonw3242 6 лет назад

      no problem. it seems that they use webpack to enclose the wasm file from elsewhere

  • @WissenUnterwegs
    @WissenUnterwegs 6 лет назад

    I can't seem to find the API calls you show at 7:48 in the MAM docs

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      Not all MAM API's are documented. Investigate the code.

    • @WissenUnterwegs
      @WissenUnterwegs 6 лет назад

      Ah ok thank you for your answer! :)

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    Data publishing is 15sec(most frequent option), is there anyway to boost up the frequency to like 1 sec?

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      It does not make sense to change it to 1 sec. Please note each time you publish data to the Tangle PoW must be done, 1 sec is NOT enough. That is why I have set the default to 15 sec.
      If you install the tool locally, you can easily change the code.

    • @rahulshewani8323
      @rahulshewani8323 4 года назад

      @@Mobilefish Hey professor,what if I need a continous stream of data ,say transmitting location of a robot to other robots,what is the maximum frequency at which I could publish that data without disrupting the POW?(Say 15secs would be a huge delay for the purpose)

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    sometimes at the receiving end, it is kind of lagging or not showing up. Is it because of only the confirmed transaction can be received?

    • @Mobilefish
      @Mobilefish  6 лет назад

      Use the Chrome browser and open the console logging. Check if you see errors. It is possible that the default endpoint field.carriota.com might cause this problem. This endpoint is a load balancer which means behind this balancer are multiple nodes and some of these nodes don’t support some apis. Try instead this endpoint nodes.testnet.iota.org:443.

    • @Mobilefish
      @Mobilefish  6 лет назад

      And no it has nothing to do with confirmed tx.

  • @SS-605
    @SS-605 5 лет назад

    Hi Professor Can you please share your comments about MAM2? Can you please make some videos about it?

    • @Mobilefish
      @Mobilefish  5 лет назад +1

      At this moment I am working on LoRa/LoRaWAN tutorials.
      But I am planning to make IOTA tutorials again.
      Unfortunately I can not say when I will begin again and what topics I will cover.

    • @SS-605
      @SS-605 5 лет назад

      @@Mobilefish Thank you professor, I am really waiting for your tutorials especially if you also show some experimentation with Raspberry PI 3. Also I want to say can you please make some videos on post quantum hash based digital signatures? Thank you for all your videos.

  • @hdsmsmart
    @hdsmsmart 6 лет назад

    how secure and private that MAM can provide for the user ? could it secured and privated like Monero ? Could transaction on iota could be track down identity with this ?

    • @Mobilefish
      @Mobilefish  6 лет назад +2

      The purpose of MAM is to create a masked message data stream, for example a stream of sensor data. There is NO value transferred meaning there are NO IOTA's transferred.
      If your question is: Can my identity be tracked down if I create a message stream using MAM, the answer is no. But only the person who is using your message stream will "know" your identity because it needs the root (and side_key if you use the restricted mode)

    • @hdsmsmart
      @hdsmsmart 6 лет назад

      Thanks you, I have one more question, does message data stream strengthen the IOTA network like transactions do ?

    • @Mobilefish
      @Mobilefish  6 лет назад

      Yes. For each sensor data send, you must validate two transactions.

    • @Mobilefish
      @Mobilefish  6 лет назад

      Just like a normal transaction...

    • @Mobilefish
      @Mobilefish  6 лет назад +2

      Henrik, I have not done any research on that front, so I can not give you an answer.
      But you have given me some ideas for future video topics.
      Sniffing data packets using Wireshark...

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    for "IOTA Masked Authenticated Messaging Demo", you state " DO NOT USE THIS TOOL IN PRODUCTION. YOU WILL LOSE YOUR IOTAS". What if I don't have any IOTA in my wallet, this MAN thing can till work right? so there is no worry to lose IOTA, am i correct.
    What if i want to build something for production, then what should i do to take care of security reason?

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      You do not need IOTAs to work with MAM.
      BUT YOU NEED TO ENTER A SEED! DO NOT USE A SEED WHICH YOU ALSO USE IN PRODUCTION!
      I highly recommended to copy this tool on your local webserver (follow the installation instructions mentioned in the code)
      Make sure when you enter the seed, it can not be "catched" by keyloggers etc, etc...
      PLEASE NOTE: THIS TOOL IS CREATED FOR EDUCATIONAL PURPOSE! YOU MUST INVESTIGATE THE CODE, LEARN FROM IT AND BUILD A BETTER ONE WHICH SUPPORTS YOUR NEEDS AND SECURITY REQUIREMENTS.

    • @hamiltonw3242
      @hamiltonw3242 6 лет назад

      no problem, just to double-check. I found that you updated your website accordingly.

  • @simonbachmann2120
    @simonbachmann2120 5 лет назад

    Imagine you have a drone which runs on battery. How IOTA is such a good option for battery powered IOT devices if they have to perform a small amount of proof of work for every transaction? I'd rather pay a small amount of money but have longer battery life.

  • @hamiltonw3242
    @hamiltonw3242 6 лет назад

    The yellow MAM test page produce the following error after i started publishing.
    mam.web.js:40742 failed to attach message:
    Error: Invalid Response:
    at Object.invalidResponse (iota.min.js:1)
    at i.prepareResult (iota.min.js:1)
    at XMLHttpRequest.n.onreadystatechange (iota.min.js:1)
    attach @ mam.web.js:40742
    async function (async)
    attach @ mam.web.js:40745
    publish @ mam.html:523
    executeDataPublishing @ mam.html:536
    setInterval (async)
    generate @ mam.html:543
    onclick @ mam.html:189

    • @Mobilefish
      @Mobilefish  6 лет назад +1

      Yes, you are correct! If you use the field.carriota.com/ endpoint you MAY get this error.
      CarIOTA field (field.carriota.com) is a loadbalancer. There are several nodes behind the loadbalancer which does the "actual work", some of these nodes does not allow command "attachToTangle" to be executed on their node.
      That is the error you see.
      As an alternative use testnet: nodes.testnet.iota.org:443 (its on the list you can choose from)
      You will not get these errors anymore.

    • @hamiltonw3242
      @hamiltonw3242 6 лет назад

      cool

    • @mohdmajidakhtar2122
      @mohdmajidakhtar2122 4 года назад

      I am getting same error.. How can I resolve it? Which endpoint should I work.. Also iota.dance is not running anymore. How can I know the endpoints.?

  • @kenshamir2113
    @kenshamir2113 6 лет назад

    Great content. My channel also focusses on crypto technology and reviews.