Git Product home page Git Product logo

ethereum-browser-sdk's Introduction

An SDK for communicating between Ethereum dapps and Ethereum enabled browsers via events.

Playing Around With It

Build the SDK

cd ethereum-browser-sdk/library
npm install
npm run build

Build the Browser Extension (it uses the SDK as a provider)

cd browser-extension
npm install
npm run build

Run the iframe provider static file server (it uses the SDK as a provider)

cd provider-iframe-wrapper
npm install
npm run build
npm run serve

Run the dapp (it uses the SDK as a client)

cd sample-dapp
npm install
npm run build
npm run serve

Play around with the iFrame Provider

Navigate to http://localhost:49304. This will open the iframe host which will then load the sample dapp from http://localhost:62091 into an iframe in the page. The contents of the iframe are sandboxed, and the iframe host communicates with the dapp via events using the protocol defined in this project. One can imagine a user opening up some page that just has a mnemonic entry box and a URL bar in the middle of it. You put in your mnemonic and then some dapp you want to use (e.g., augur.casino) and you will be able to use that dapp with your keys secured by the browser's sandboxing of iframes and all without installing any extensions.

Play Around with the Extension Provider

You can load the browser extension into your browser via the manifest.json in browser-extension/app/manifest (how you do this varies by browser). Then navigate to http://localhost:62091. Once the dapp is loaded, click the browser extension to have it "connect" with the page. The functionality here is similar to using MetaMask, where the dapp communicates with a browser plugin. One notable difference is that the user had to click on the extension icon to "activate" the dapp for that page. From a security/privacy standpoint this has some nice benefits as it means that the extension needs almost no permissions (unlike MetaMask currently) and the page cannot fingerprint the user by the presense of an extension.

Play with both at the same time!

If you load the extension and then navigate to the iframe host, then activate the extension, you'll notice that the dapp sees both providers! The dapp has a very simple interface for choosing the provider they want to interact with, which lets the user use different providers in different contexts. Maybe the user has some browser extension that auto-connects with every page and has limited funds which they use as their hot wallet while browsing the web. They may have a separate plugin that is backed by a hardware wallet and requires a click to inject into the page. The user could browse the web normally with their hot wallet, but then when they need to access larger sums they can just flip the dapp over to their cold storage plugin with a couple clicks.

ethereum-browser-sdk's People

Contributors

micahzoltu avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

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.