ethereumjs-accounts - for managing Ethereum accounts in browser

SilentCiceroSilentCicero Toronto, CAMember Posts: 159 ✭✭✭
edited July 2015 in web3-js
So I wanted to manage Ethereum accounts in browser: generation, management, everything. So I made this module to do just that. This module is not completely secure yet and should not be used in production. It's largely a development module at this point. I understand that Fabian (frozeman) has made a similar module for managing Ethereum accounts. This module covers more the generation and signing of Ethereum accounts in browser. As well, you can optionally choose to override the web3 object so that if the sendTransaction (or contract transaction) method is used with an in browser account, it will intervene and build/sign the transaction in browser and leverage the sendRawTransaction method to send the data to the node.


The module is available in a Meteor package, NPM package and as a single, stand alone JS file. If you're using this module in a Meteor project, the storage is reactive (thanks to Fabian's LocalStore module). This module uses the browsers persistent localStore storage, and Chromes custom localStore (if Chrome is used).

Hope this helps!


  • AronVanAmmersAronVanAmmers Amsterdam, NetherlandsMember Posts: 40 ✭✭
    Great @SilentCicero, a step forward to accessible (and hopefully somewhat secure :wink:) DApps.

    Which versions of eth backends does it require?
  • cphicphi Member Posts: 46
    Great work on this and it is very useful from a learning standpoint as well.

    I was playing around with the example (thanks for that!). Am I able to display and use the accounts already on my local computer? (ie. The one's that are accessible from my geth instance.)
  • SilentCiceroSilentCicero Toronto, CAMember Posts: 159 ✭✭✭
    @AronVanAmmers I'm using the latest geth. The geth version must include the sendRawTransaction RPC method, which was recently added (by me, I might add :)). The RNO for key gen entropy and local temp store for private key generation are potential attack vectors. Although, it's relatively secure for now. Upgrades to come!

    @cphi awesome. Yeah, note that generation and management can happen even without the backend geth node or connection. It's only when you extendWeb3() that you need to have a working geth node and RPC connection.
  • linageelinagee Member Posts: 31 ✭✭
    Can you explain what this is for? I was looking a bit at the code and it seems this still needs to talk to geth? (This javascript code does not directly connect to nodes?) Does this just mean you can connect to "an untrusted geth via RPC" or something? Forgive my newb-ness.
  • SilentCiceroSilentCicero Toronto, CAMember Posts: 159 ✭✭✭
    @linagee so the standard procedure is: the geth node handles the account creation and encryption. This module allows you to create, and encrypt these accounts in browser. It's so that if you want to manage Ethereum ready accounts in a browser vs letting the geth node create them, you can. You can optionally override some features of the web3 object found in web3.js, which does talk to Ethereum's RPC client. This does not mean you should connect to an untrusted geth node via RPC. Just that account creation, encryption, and management is now possible in browser.
  • ethereum69ethereum69 Member Posts: 3
    This doesn't work in Microsoft IE10/Edge

    Please provide a working example if it does work.
  • ethereum69ethereum69 Member Posts: 3
    edited September 2015
    I get this error:
    Unable to get property 'getItem' of undefined or null reference

    It probably has to do with the localStorage being blocked. It must be since I'm running it from file:///E:/...
  • ethereum69ethereum69 Member Posts: 3
    edited September 2015
    You should edit the code to store data differently. This will make the code usable on different platforms. Right now it's restricted to platforms that support localStorage.
    Post edited by ethereum69 on
Sign In or Register to comment.