aj machine (4FUN)
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights New
    • Engagement control
    • Make a copy
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Note Insights Versions and GitHub Sync Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Make a copy Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       Owned this note    Owned this note      
    Published Linked with GitHub
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    # FPGA-accelerated TrustZone-enabled IOTA Swarm Nodes ## 動機 在 IOTA 中,一個錢包完整發出交易 (transaction) 請求會被劃分為四個命令: * `getTransactionsToApprove` * `attachToTangle` * `broadcastTransactions` * `storeTransaction` 也就是先向 Host 取得兩個 tips (trunk, branch) 交易,接著錢包會將 trunk, branch,以及要發出的 transaction trytes 以 `attachToTangle` 送到 Host,讓 Host 簽發交易 (也就是 PoW),這步驟是發起交易最耗時的部分。接著請求 Host 將這筆交易廣播給其他鄰居,最後將這筆交易存下來。 - [ ] 延伸閱讀: [IOTA API](https://iota.readme.io/v1.3.0/reference) 針對物聯網和大規模部署的需求,我們[實作了 IOTA Swarm nodes 並允許在中低階 Arm 環境佈署](https://hackmd.io/s/SJdnjRWnz),而在 [2018-06-13 會議記錄](https://hackmd.io/c/rkpoORY4W/%2Fs%2FSy2X3ZTgX) 提及評估透過 FPGA 加速 IOTA PoW (attachToTangle 命令) 並期望在 [Arrow SoCKit Evaluation Board](https://rocketboards.org/foswiki/Documentation/ArrowSoCKitEvaluationBoard) 建立兼具 FPGA 加速和 Arm TrustZone 安全隔離的系統雛形。 - [ ] 未來展望 1. 接受運算能力低的感測器轉包 PoW 到硬體加速的 IOTA Swarm nodes,初步鎖定 [Fujitsu PalmSecure](https://www.fujitsu.com/global/services/security/offerings/biometrics/palmsecure/) 一類的感測器 ([應用場景](https://twitter.com/i_am_pass/status/1006768419436363778)); 2. 作為 [IOTA Sandbox](https://hackmd.io/s/ByWQUqfh-) 或 [PoWbox](https://blog.iota.org/relaunching-the-powbox-d392236b6939) 的負載平衡器暨加速器; 現有 IOTA PoW 的 FPGA 加速器實作: * [IOTA PoW Hardware Accelerator FPGA for Raspberry Pi](https://microengineer.eu/2018/04/25/iota-pearl-diver-fpga/): Cyclone 10, MIT License * [FPGA based hardware accelerator for IOTA Curl and POW operations](https://github.com/LampaLab/iota_fpga): Cyclone V, MIT License :::info 用 FPGA 加速的 IOTA PoW 時間分佈 (橫軸單位: ms) ![](https://i.imgur.com/fBgZ8Ij.png) * 25% of all nonces are found within 87ms * 50% of all nonces are found within 200ms * 75% of all nonces are found within 433ms ::: 預期 [iota-swarm-node](https://github.com/yillkid/iota-swarm-node) 整合方案 1. 將 FPGA accelerator 包裝 dcurl 介面: [shufps/dcurl](https://github.com/shufps/dcurl) 已有初步實作 2. iota-swarm-node 現有 Python 載入 dcurl 並且驗證 IOTA / TangleID APIs ## 評估 Q1: 是否有TrustZone? > [name=AjMaChInE] p.102, [SoCKIT to Me!Don’t Just Elevate, Integrate.](https://doc.xdevs.com/doc/ALTERA/Arrow%20SoCkit%20SW%20Workshop_13.0%20%5BRepaired%5D.pptx), 說明Arrow SoCKit Board可以做TrustZone應用 Q2: 選擇 shufps/dcurl或 LampaLab/iota_fpga? |items\projects | shufps/dcurl | LampaLab/iota_fpga | | -------- | -------- | -------- | | board| (old)[Altera DE1](https://www.altera.com/solutions/partners/partner-profile/terasic-inc-/board/altera-de1-board.html) (new)(customize)Altera DE1 | [Intel DE10-Nano Board](https://software.intel.com/en-us/articles/de10-nano-board-schematic) | FPGA | (old) Cyclone 2 (new) Cyclone 10 LP | Cyclone V | HDL | VHDL-Core | Verilog/System Verilog | | HDL source| [IOTA VHDL PoW (Pearl Diver)](https://github.com/shufps/iota_vhdl_pow) | [iota_fpga/curl_accel_soc/hardware/](https://github.com/LampaLab/iota_fpga/tree/master/curl_accel_soc/hardware) >[name=AjMaChInE] > >* 建議兩個都可以試試看,但Altera DE1 Cyclone 2不用試,因為硬體架構上沒有[HPS](https://www.altera.com/products/fpga/features/cyv-soc-hps.html) 與 [Arrow SoCKit board](http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=205&No=816&PartNo=2)有落差 >* 預計先試shufps/dcurl再試LampaLab/iota_fpga PS: * "This respository will not only contain VHDL source code and Altera DE1 project-files but also everything needed for **a custom PCB** (**with a modern FPGA Cyclone 10 LP**)which is plugged on top of a Raspberry Pi. Proto-Type is reaching 14.6MH/s" [IOTA VHDL PoW (Pearl Diver)](https://github.com/shufps/iota_vhdl_pow) * "Intel Cyclone 10 LP FPGAs extend the low-power leadership of the previous generation Cyclone V FPGAs, 參考": [Intel® Cyclone® 10 LP FPGA](https://www.altera.com/products/fpga/cyclone-series/cyclone-10/cyclone-10-lp/overview.html) Q3: FPGA合成資源初步判定 | Items\Projects | shufps/dcurl | LampaLab/iota_fpga | [Arrow SoCKit](http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=205&No=816&PartNo=2)| | -------- | -------- | -------- | -------- | | LEs | [23,877](https://microengineer.eu/2018/04/25/iota-pearl-diver-fpga/)| ? |110K | | ALMs | ? | 12 377 ALMs, 23 945 flip-flops (30% of 5CSEBA6U23I7 FPGA) | 41509 | >[name=AjMaChInE] 兩者初步判定皆可以在Arrow SoCKit上使用其資源合成。 PS: * ALM: Adaptive Logic Module ![](https://i.imgur.com/SVlhTsk.png) * LE: Logic Element Q4: Weakness: FPGA與CPU有共有區塊,此區塊會保存seed,可以透過mmap存取 >[name=AjMaChInE] >* The SoCKit board的 [Specifications](http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=205&No=816&PartNo=2)並沒有寫到TZC400 (TrustZone® Address Space Controller) >* 替代解法: 設定normal world的page table讓此區塊不能讀不能寫不可執行且還需對OPTEE修改並撰寫OPTEE TA,這部分想要另外談。 ## TODO 1. shufps/dcurl 移植的執行順序 * 1.1 FPGA合成shufps/dcurl Cyclone 10 LP 版本 * 1.2 移植現有[IOTA VHDL PoW (Pearl Diver)](https://github.com/shufps/iota_vhdl_pow)從[Intel DE1-Nano Board](https://www.altera.com/solutions/partners/partner-profile/terasic-inc-/board/altera-de1-board.html)至Arrow SoCKit Board * [TODO紀錄](https://hackmd.io/vXdPy9ilSYGKS6M1wh4Ppw?both) * 1.3 iota-swarm-node 現有 Python 載入 dcurl 並且驗證 IOTA / TangleID APIs 2. LampaLab/iota_fpga移植(ED10->Arrow SoCKit)的執行順序 * 2.1 使用Quartus合成LampaLab/iota_fpga,而device從ED10->Arrow SoCKit * [TODO紀錄-done](https://hackmd.io/2a2x1q9QTJq0MsGWEyJbhA) * 2.2 移植[LampaLab/iota_fpga/software](https://github.com/LampaLab/iota_fpga/tree/master/pow_accel_soc/software)從[Altera DE10]((https://software.intel.com/en-us/articles/de10-nano-board-schematic))至Arrow SoCKit Board * [TODO紀錄-done](https://hackmd.io/FMERGjcqTYO4Nn8jBRYOQA) * 2.3 驗證ccurl * [TODO紀錄](https://hackmd.io/s/r1RcCnxfQ) * 2.4 Replace ccurl's POW with dcurl’s POW in LampaLab/iota_fpga * [TODO紀錄](https://hackmd.io/blMdDCDzTCqLKXMmfHmfDw?view) * 2.5 [iota-swarm-node](https://github.com/yillkid/iota-swarm-node) 現有 Python 載入 dcurl 並且驗證 IOTA / TangleID APIs 3. RPi3+OPTEE執行順序: * 3.1 建立RPi3+OPTEE環境 * 3.2 撰寫TA (PoW) for RPi3+OPTEE PS: seed在normal world與seucre world共享區塊是加密的,TA負責解密 PS: shufps/dcurl的第二步驟如果無法突破將會放棄,執行LampaLab/iota_fpga的移植; 如果成功,將不執行LampaLab/iota_fpga的移植。 ## Future Work Weakness解決方案執行順序: * 建置OPTEE在The SoCKit board上,需修改編譯流程。 * 設定nornal world的page table 不能讀不能寫不可執行此區塊 * 建立nornal world與sercure world共享區域 * 修改OPTEE的page table建立FPGA使用的記憶體區塊 * 由Tasklet搬此共享區資料至FPGA使用的記憶體區塊並撰寫解加密的seed程式 PS: nornal world與sercure world共享區域存放加密的seed ## 參考資訊 - [ ] [Altera DE1](https://www.altera.com/solutions/partners/partner-profile/terasic-inc-/board/altera-de1-board.html) ![](https://i.imgur.com/ErSUfYP.png) - [ ] [Intel DE10-Nano Board](https://software.intel.com/en-us/articles/de10-nano-board-schematic): * 5CSEBA6U2317 ![](https://i.imgur.com/1B5BvJe.png) - [ ] [Arrow SoCKit board](http://www.terasic.com.tw/cgi-bin/page/archive.pl?Language=English&CategoryNo=205&No=816&PartNo=2): * Cyclone V SX SoC—5CSXFC6D6F31C6N * 110K LEs, 41509 ALMs ![](https://i.imgur.com/pRd4JcC.png)

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?

    Please give us some advice and help us improve HackMD.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully