Git Product home page Git Product logo

hypha-desktop's Introduction

Hypha Desktop

Hypha is an Electron app powered by InterPlanetary File System (IPFS). This project is still experimental and under heavy development. So, there might be some dragons 🐉.

Screen

How to run dev environment up

npm run start:dev

How to build

npm build

Architecture

Architecture

Project structure

  • assets: Currently, icons and compiled web UI components will be placed here.

  • media: Screen shots and other materials are in this folder.

  • src: Electron and IPFS scripts are in this directory.

  • ui: All web UI components reside in this folder.

Rough road map

  • stage 1: PoC with Electron.js on top of go-ipfs, similar with ipfs-desktop. Able to render HTML/CSS/JS documents from IPFS hash and IPNS, using Wikipedia, China Digital Times and Matters News as starting point. Determine what are the basic information and controls users needed to debug and use IPFS node.

  • stage 2: User can publish an article from application, and can follow another user’s publication timeline given the node id. User can also refer to other articles in their articles, to increase the exposure of related contents and redundencies in the network. User can also choose an optional server to keep their data when they are off line.

  • stage 4: User can enable optional Tor integration for increase anonymity. Users can also send private messages to another user, which will be encrypted by the local private keys of both parties.

  • stage 5: Simple integration of cryptocurrency payment, allowing users to support the writer and content they appreciate, either by donation or by crowdsourcing. The cryptocurrency we plan to integrate is Likecoin, which is suitable for micropayment in content, and Bitcoin, which is most widely used.

hypha-desktop's People

Contributors

guoliu avatar zeckli avatar

Stargazers

 avatar  avatar Johnny (Hao) Jiang avatar mcbbugu avatar yoonsung.eth avatar askender avatar joaweyang avatar ik5 avatar Peter Kieltyka avatar Artem Nistratov avatar  avatar Dietrich Ayala avatar jiangplus avatar zhiyue avatar Vibert Thio avatar Suji Yan avatar  avatar  avatar

Watchers

James Cloos avatar  avatar  avatar Lin, Hung-Shin avatar joaweyang avatar

hypha-desktop's Issues

Redesigning browser for the decentralized web

The problem of browser support

Mass adoption of emerging protocols for the decentralized web such as IPFS are limited by the lack of browser support. Full support via browser extensions are not accessible to non-technical users, and partial support via public gateway cannot utilize the advantages of a decentralized network.

With thicker clients, thicker protocols and thinner or no servers, the decentralized web is in many ways similar to applications installed locally in a connected operating system, instead of webpages retrieved from servers.

However, current browsers evolved around the server-client mental model. To fully support the decentralized web, they not only need to register new protocol handlers, but also need to provide new mental models for user interaction and applications.

Current state of accessing web apps on IPFS

Assume we have a minimal peer to peer web app: a HTML/CSS/JavaScript bundle stored on IPFS and uses API from window.ipfs to get and send data. To access it, an user needs to run an IPFS daemon locally, install IPFS Companion browser extension, and finally type in localhost with the correct port number and hash of the web app.

If the web app relies on other emerging protocols such as Ethereum or Polkadot, the user needs to install additional browser extensions to provide computational resource and inject API into DOM. This overly complicated user journey exposes mismatches between the “local first” logic of the decentralized web and the “fetch from server” paradigm of the browser and indicates the need of a redesign.

If we can add native protocol support to browsers or implement them in an integrated runtime environment such as WebAssembly, we can deliver new user interfaces and enable new mental models for managing web apps via browser extension. Before that, the fast way to iterate, explore and demonstrate new mental models would be prototyping a desktop browser.

Design challenges for P2P browser

Regardless of how the user interface is delivered, the following are some features that are unique to decentralized web. Using IPFS as an example, we will focus on a P2P network since it is the most decentralized.

Applications can be installed and named locally

Comparing to web pages, P2P applications are often stored locally. An user should be able to install, browse, remove and rename applications, similar with desktop UI of an operating system. Applications names, icons, developers, permissions etc. can be specified with web app manifests, similar with that of Progressive Web App of browser extension.

The ability of renaming an application locally is crucial, since human readability are often sacrificed in a distributed and secure system. Without a centralized or blockchain-based DNS system, links to web apps are unreadable IPFS/IPNS hashes, and an user should be able to maintain a local human-readable name space to avoid using hashes directly and resolve name collisions.

Managing access to protocol APIs and identify information

Innovations in network protocol and network structure are likely to continue, so the browser needs a predictable way of exposing protocol APIs to applications. IPFS companion and MetaMask have been exposing the API they support under window object and many applications have been utilizing this pattern.

The browser should inherit this pattern for all supported protocols and attach the corresponding APIs under window object. For IPFS, the browser should request authorization from the user before an application pins IPFS hashes for the first time, record all hashes pinned, and unpin them upon application removal.

Identities in P2P web are implemented with public and private key pairs which needs to be protected and stored locally. If the implementation of user identity is left to applications, the browser should use separate identity such as IPFS node id for each application to prevent malicious application from forging identities. If user identity is implemented at browser level, the user should be able to choose which identity they allow the application to use.

Trust Model for Applications

Instead of relying on certificate authorities, the trust from the user to the application relies directly on the checksum, as in the case of IPFS, or on the publisher identity, as in the case of IPNS and Dat. These assumptions should be make explicit when the user visit or install an application.

If user identity is implemented at browser level, the browser should allow the user to authorize an identity to a given application. The browser can potentially keep a contact list that the user trust, as well as the trusted contact lists of the trustees, and implement a PGP-like scheme to help user assess the trustworthiness of an unknown application publisher by degrees of separation in a web of trust.

Proof of concept

The above are just some examples of design challenges for P2P browsers, and further discussions and experimentations are needed.

To explore and demonstrate how users should interact with P2P web app, we can start with a bare bone desktop browser that only provides computational resources for IPFS and rendering environment for applications. Everything else, from user identity to resource management, is left to applications.

The following specification of a minimal viable product should be able to support new mental models of a P2P web:

  • Use Electron.js to render web apps :
    • Electron main process starts and controls local go-ipfs daemon with js-ipfsd-ctl.
    • Web app bundles are delivered by IPFS via local HTTP gateway in subdomain style.
    • Electron main process starts new BrowserWindow and inject IPFS API into window object to render web app.
  • Provides user interface to render, installed, renamed and removed web apps:
    • User can input a IPFS/IPNS/DNSLink string to view and install a web app or web page.
    • User can view installed web apps in grid view or list view, and can rename or remove them.
  • Supports standard HTML/CSS/JavaScript bundle as web app:
    • Web app uses HTML file as markup and JavaScript code to call API and update application state, as in JAMstack. API calls can be via HTTP or window.ipfs.
    • Developer should be able to build web app using React.js, Vue.js or any other standard web site building tool, and publish simply with ipfs add -r.
    • Application information is declared via web app manifest, and the browser can create a default manifest if one does not exist.
  • Web apps can be pre-installed during build time:
    • Developers can build different releases with different pre-installed applications, which can include different interfaces for system settings and resource managing.
    • Example web apps can include matters.news for social networking and ipfs-webui for monitoring local resource.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.