wanderer
    • 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
    • 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 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
    # IP-OS ### the interplanetary operating system `a mad science grab bag` Martin Becze - @wanderer --- ## The File System ### Reading `ipfs mount` `cd /ipfs/<hash>` ```graphviz digraph hierarchy { nodesep=.5 // increases the separation between nodes node [color=purple,fontname=Courier,shape=box] //All nodes will this shape and colour edge [color=Blue, style=solid] //All the lines look like this root->{QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8ZS hash1 hashN} QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8ZS->{file1 file2} hashN } ``` --- ## The File System ### Running `ipfs add -r /bin/` `/ipfs/<hash>/<program>` --- ### Writing https://github.com/ipfs/faq/issues/64 <!-- .element: class="fragment" data-fragment-index="0" --> `cd /ipfs/` <!-- .element: class="fragment" data-fragment-index="1" --> `touch hello.txt`<!-- .element: class="fragment" data-fragment-index="1" --> `echo "hello world" >> hello.text` <!-- .element: class="fragment" data-fragment-index="1" --> where is the hash? --- ## Mounting Individual Roots ``` mount /ipfs/QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8ZS ~/Music ``` <!-- .element: class="fragment" data-fragment-index="0" --> ``` cd ~Music && wget https://lolz.com/all_your_music_belongs_to_us-1997.mp3 ``` <!-- .element: class="fragment" data-fragment-index="1" --> where is the hash? <!-- .element: class="fragment" data-fragment-index="2" --> --- ### utils pwd - **p**rint **w**orking **d**irectory POSIX C functions getcwd() or getwd() --- ### utils pwdh - **p**rint **w**orking **d**irectory **h**ash POSIX C functions ??? --- ### IPNS ``` mount /ipns/QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8ZS ~/Music ``` <!-- .element: class="fragment" data-fragment-index="0" --> - a public key is a read capability <!-- .element: class="fragment" data-fragment-index="1" --> - writable if we have the write capability (private key) <!-- .element: class="fragment" data-fragment-index="1" --> --- ## Multiple IPNS identities fine grain control over sharing sub-graphs (aka folders)<!-- .element: class="fragment" data-fragment-index="0" --> ``` cd ~Music mkLink --ipns > /ipns/QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8Z ``` <!-- .element: class="fragment" data-fragment-index="0" --> ``` mkLink . > `/ipns/Qmf8xbzdSi3xbqZHnDtSnwk8dfmgBmNCrV6jYeKtCG2x4` ``` <!-- .element: class="fragment" data-fragment-index="1" --> ``` `lsLink .` > `QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8Z` > `Qmf8xbzdSi3xbqZHnDtSnwk8dfmgBmNCrV6jYeKtCG2x4` ``` <!-- .element: class="fragment" data-fragment-index="2" --> `rmLink`<!-- .element: class="fragment" data-fragment-index="3" --> revokes a capability to read<!-- .element: class="fragment" data-fragment-index="3" --> --- ## Linking Link to my friends music into my local Music folder `ln -s /ipns/QmP9STVxFdBAdTfWGQHC45mZgBTWPL1gH9M5urzQchd8Z ~/Music/friends/brad`<!-- .element: class="fragment" data-fragment-index="0" --> `cd ~Music/friends/brad`<!-- .element: class="fragment" data-fragment-index="1" --> `/<ipfs hash>/ipfs/<friends_folder_hash>/<ipns links>/`<!-- .element: class="fragment" data-fragment-index="2" --> --- ## Flexible Link Handlers `ipfs rm -r ~/Music/dont share` ```graphviz digraph hierarchy { nodesep=1.0 // increases the separation between nodes node [color=purple,fontname=Courier,shape=box] edge [color=Blue, style=solid] //All the lines look like this Music->{"dont share" hash1 hashN} "dont share"->{file1 file2} hashN } ``` --- ## What is WebAssembly? > WebAssembly or wasm is a new, portable, size- and load-time-efficient binary format that aims to execute at native speed by taking advantage of common hardware capabilities available on a wide range of platforms. --- ## What is WebAssembly? - Fast & Efficient <!-- .element: class="fragment" data-fragment-index="1" --> - Secure Sandbox <!-- .element: class="fragment" data-fragment-index="2" --> - Toolchain Compatibility <!-- .element: class="fragment" data-fragment-index="3" --> - Extensible <!-- .element: class="fragment" data-fragment-index="4" --> - The Combined Powers of the Web!<!-- .element: class="fragment" data-fragment-index="5" --><br>![](https://i.imgur.com/Av9JHNY.gif)<!-- .element: class="fragment" data-fragment-index="5" --> --- ## The Extensible Web Manifesto - Contain new security surface area.<!-- .element: class="fragment" data-fragment-index="0" --> - Reduce the rate of growth in complexity, and therefore bugs, in implementations.<!-- .element: class="fragment" data-fragment-index="1" --> - Allow browser vendors and library authors to iterate on libraries that provide developer-friendly, high-level APIs.<!-- .element: class="fragment" data-fragment-index="2" --> --- ## What we face today ![](https://docs.google.com/drawings/d/1zUNIkJgooMP0jVbasWVUGKXgA-BRi7F5ANuNC3AKP_U/pub?w=787&h=359) --- ## What we face today - SHA1 - EC arithmetic - BN arithmetic - pairing functions --- ## What we face today Big Trusted Computing bases are really bad for symmetric computation platform --- ## The Extendable Future ![](https://docs.google.com/drawings/d/1AOV5J2tKJjh_KXnkozmv7eZbpbwM68-kYC6fYbWryCw/pub?w=960&h=720) --- ## IPLD & Translators > A translator is simply a normal program acting as an object server and participating in the Hurd's distributed virtual file system. It is so-called because it typically exports a file system [...] and thus translates object --- ## IPLD & Translators ```graphviz digraph hierarchy { rankdir=LR; data -> Translator Translator->Vertex data [shape=Mdiamond]; Vertex [shape=Msquare]; } ``` --- >Another way of putting it is that it translates from one representation of a data structure into another representation - IPLD modules are Translators <!-- .element: class="fragment" data-fragment-index="0" --> - If you wrote IPLD translators WASM... <!-- .element: class="fragment" data-fragment-index="1" --> - Only have to implement one Translators for all implementations - Translaters themselves could be resolved by IPFS - less dependencies in implementations - More modularity overall - Implemented In userspace <!-- .element: class="fragment" data-fragment-index="2" --> --- ## Example: Ethereum ```graphviz digraph hierarchy { node [color=purple,fontname=Courier,shape=box] edge [color=Blue, style=solid] //All the lines look like this Block->{"prev Block" accounts transaction} accounts -> {account1 account2 accountN} accountN -> {nonce balance storage} storage -> {key1 key2 keyn} accountN [color=red,fontname=Courier,shape=box] } ``` https://github.com/ipld/js-ipld-eth-block --- ## What if Ethereum contracts where just programs in a general purpose OS backed by a content addressable file system? --- ## What do we want from a userspace? - run symmetric computations (ie Blockchain) <!-- .element: class="fragment" data-fragment-index="0" --> - Deterministic by default - sandboxed - reuse legacy programs written in C/C++ <!-- .element: class="fragment" data-fragment-index="1" --> - simple and well specified <!-- .element: class="fragment" data-fragment-index="2" --> --- ## Linux - complicated - not completely determistic - sandboxed is not the default - subgraph & qubes OS --- ## Actor Model ![](https://blog.geist.no/content/images/2015/02/actors.png) - Each contract or program is an Actor or Servers running in a Microkernel - Easy to sandbox --- ## bigraphs ![](https://ipfs.pics/ipfs/Qmewocv1jMHuX2okfR83DzUtJARzXFGRHHzm6JfFLaLeCj) - Forest is the place graph, which is the Merkle DAG - Hypergraph/link graph is the channels of communication between the actors - Robin Milner --- # bigraphs ![](https://docs.google.com/drawings/d/1Ine6F7I5PybRcArOf-GyVgunx2uxykFEczVFhfg7-sE/pub?w=794&h=511) --- ## Micro-kernel > a microkernel (also known as μ-kernel) is the near-minimum amount of software that can provide the mechanisms needed to implement an operating system (OS) --- ## Ethereum Big ball of mud ![](https://docs.google.com/drawings/d/1wZYjxV-ZTXrkfimKkcAUQ11vti8xv-wcglNnOXBArAs/pub?w=960&h=720) --- ## Modular Ethereum ![](https://docs.google.com/drawings/d/1f87beiJ7VakT9ififzN0f_NMO6UAOTdmDPSBioVXato/pub?w=960&h=720) --- ## Modular Ethereum ![](https://docs.google.com/drawings/d/1yquesWIOFG_sTMYypVMZsO2GbfhQy4uKRRCJD6as9EY/pub?w=653&h=544) - github.com/ewasm/ewasm-kernel --- ## Modular Ethereum - modularity is important! <!-- .element: class="fragment" data-fragment-index="0" --> - Conway's law "organizations which design systems ... are constrained to produce designs which are copies of the communication structures of these organizations" <!-- .element: class="fragment" data-fragment-index="1" --> --- ## Vertices are programs > A server responds to requests by client to navigate the hierarchy, and to create, remove, read, and write vertices [...] Another possibility for a server is to synthesize vertices on demand, perhaps based on information on data structures inside the kernel [...] User programs can also act as servers. - Plan9 Manual --- ## Everything is File - Everything is a Vertex - has a VALUE - and EDGES --- ## Everything is File - Everything is a Vertex - has a VALUE = code - and EDGES = ports --- ## System API - get and set ports - store and retrieve values --- ## Inter-Process Communication - channels - lines of communication - ports - the internal name for a channel that each program has - duplex, read-only, write-only --- ## Capabilities - Ports have two capabilities - read - write - Delegatable - a Merkle link is a read-only capability - http://cap-lore.com/ - http://erights.org/ --- ## Messages - Atomic - Non-Atomic - scalability / cross-shard communication - unforgeable - from - to - immutable payload --- # ubiquitous systems ![](https://upload.wikimedia.org/wikipedia/commons/thumb/5/5e/Green500_evolution.svg/1440px-Green500_evolution.svg.png) - pushes computation to the edges - Internet of tooster-ovens! --- # ubiquitous systems > Such a system, or its component agents, will be self-aware, posses beliefs about their environments, posses goals, enter negotiation to achieve goals, and be able to adapt to changing circumstances without human intervention. - Robin Milner --- # ubiquitous systems - computation systems made to appear anytime and everywhere<!-- .element: class="fragment" data-fragment-index="0" --> - omnipresent<!-- .element: class="fragment" data-fragment-index="1" --> - pushes computation to the edges<!-- .element: class="fragment" data-fragment-index="2" --> - Homogenesis Operating system<!-- .element: class="fragment" data-fragment-index="3" --> - not necessarily a singleton! --- ## What would this look like? ![](https://ipfs.pics/ipfs/QmbaTTVDW9c3cS3qiEp2qBQT2tAGFGF5qY9ZDEGBmCkxg2) --- ## What would this look like? ![](https://docs.google.com/drawings/d/16j8TNjDPMr0zYmCF1ex9FFWOfyUmaRLurihnxN4bXXw/pub?w=674&h=384) --- ## How to get there. - Practical over perfect <!-- .element: class="fragment" data-fragment-index="0" --> - Embrace Iteration (everything is a prototype) <!-- .element: class="fragment" data-fragment-index="1" --> - Keep it modular and follow the UNIX philosophy <!-- .element: class="fragment" data-fragment-index="2" --> - Be your own core dev!<!-- .element: class="fragment" data-fragment-index="3" -->

    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