I am interested to reproduce some functions used in myetherwallet but not finance ones but to allow a user to access certain details based on a wallet.

I checked into the github for myetherwallet but I do not understand exactly how it works.

Does someone know how it can access the blockchain based on a private key? ie what is the query process in terms of blocks, headers, etc on the blockchain? Is there somekind of way to use an sql type of access eg

if walletaddress= "..." then return block-details.
  • They host a RPC enabled node and connect to it using web3.js Sep 10 '17 at 8:11

MyEtherWallet runs an Ethereum node, and enables RPC on that node. This allows the client-side web3 library to connect to their node, and request information such as balance, or submitting signed transactions.

Further wise they make use of a library called ethereumjs-wallet, which allows you to convert a private key to an address (which is then used to request balances), and a library called ethereumjs-tx which can sign raw transactions with private keys.


At it's core, you are signing a message using elliptic curve cryptography. This is a methodology used for many things, not just Ethereum. On top of that, you have an add'l layer of Ethereum stuff—like Ethereum addresses, Ethereum encrypted specifications and formats, etc.

Your best bet for unlocking a wallet is going to be the ethereum-js wallet. From there, there are a lot of other moving pieces:

Constructing transactions manually (offline, not via an account in geth/parity): https://github.com/ethereumjs/ethereumjs-tx

AWS stuff: https://github.com/MyEtherWallet/docker-geth-lb

API: https://www.myetherapi.com/

Infura's API: https://blog.infura.io/infrastructure-means-apis-introducing-the-infura-api-49f2951bb6ba

Etherscan's API: https://etherscan.io/apis

Due to how complex MEW has become, it may be in your best interest to poke around the very earliest versions of MEW. You shouldn't use the code in this version because its severely out of date, but I have found that conceptually it has helped people wrap their heads around what is happening: https://github.com/kvhnuke/etherwallet/tree/mew1.0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.