# Masked Authentication Messaging (MAM)
## repositories
* [MAM](https://github.com/iotaledger/MAM)
* 開發重心
* 語言:**Rust**
* 沒有完整說明文件
* [mam.client.js](https://github.com/iotaledger/mam.client.js)
* 不會再持續開發
* 視為 early beta release
* [MAM.ixi](https://github.com/iotaledger/MAM.ixi)
* IOTA Extension interface
* 只有 getmessage...
## MAM Overview
[Overview.MD -- mam.client.js](https://github.com/iotaledger/mam.client.js/blob/master/Overview.md)
:::danger
沒有涉及 key 的交換
:::
### 流程
舉例: 傳送情書
**上傳**
1. 將情書從 ASCII 轉成 trytes
2. 把情書 trytes, seed, message-organizing numbers 丟入 mam::create 中 => 打包成 transaction 並產生一把加密訊息的 key
3. 可以利用 key 跟 index(merkle tree 中的 index) 得到 message_id
4. 發佈到 tangle 中
* address: message_id
**接收**
1. 收到一把 key 後,從 index = 0 開始,試著得到 message_id
2. 從 tangle 中撈出該筆 transaction
3. 使用 mam::parse 得出訊息
## mam.client.js
### Installation
```
$ git clone https://github.com/iotaledger/mam.client.js.git
$ cd mam.client.js
```
可以使用 mam.client.js/example 底下的檔案進行測試,不過有些錯誤須更正
* 修改 package.json
有用到 iota.lib.js 卻沒加入 dependencies,到 package.json 的最下方 dependencies 中加入,結果如下:
```javascript=
"dependencies": {
"iota.lib.js": "git+https://github.com/l3wi/iota.lib.js.git",
"commander": "^2.11.0",
"iota.crypto.js": "iotaledger/iota.crypto.js"
}
```
* 跑 post.js 有錯誤訊息,須回到 mam.client.js/libs/mam.js 修正
分別是第 49 與 74 行多了逗號,把逗號刪掉即可
> channelKey 是空的 @@
### Run
```
$ node post.js
```
## 現有實做
* [Reddit 討論](https://www.reddit.com/r/Iota/comments/70eizk/audit_trail_iota_mam_technology_on_test_net/)
* [audit-trail](https://audit-trail.tangle.works/)