From Ether wallet to bank account

As soon as your mining rig is running it starts to produce money. This money is stored in your "wallet" - basically a pair of two keys, a private and a public one. Up to now, only very few shops accept Ether as a payment method. Therefore, it will normally be necessary exchange your earnings into another currency such as Euros or US-Dollars. This is done using an online "currency exchange office" such as coinbase.com. Some other Ether exchange marketplaces are listed by MyEtherWallet.

So, the first step is to create an account which is able to accept Ether as an input. Transfering Ether from your wallet to your account can be accomplished in - at least - two ways:

  1. Download the whole blockchain to your local computer using the geth (= Go-Ethereum) application. Actually, your computer will then be an Ethereum node and you will be able to start transactions to be processed by the network.
  2. You may also use a service such as MyEtherWallet.com. MyEtherWallet is an interface to the Ethereum network which is able to start transactions for you.

The second approach is obviously more convenient, because it prevents you from having to download the whole blockchain and keep in sync whith it all the time. But you will be forced to enter your password in order to authorise your transaction. For this security reason, I prefer to follow the first approach. The following sections provide a short overview of the basic geth commands needed to create and handle your wallet. You will have to open a command window (Windows)/terminal window (Unix) in order to enter these commands.

If you are interested in learning more about Ethereum and geth in particular I recomend to read the original documentation provided by the Ethereum project. You can find it by opening their homepage. Then scroll down to the bottom of this page and follow the "documentation" link.

Create your wallet

Creating a new Ethereum wallet is performed by the command:

 

geth account new

 

Geth will prompt you for a password which you should keep secret and which you should never forget. Otherwise, there is no way to access your account any more! So, it is wise to create a backup of your wallet placed at another physical location.

After you have entered your password twice, geth will create a new file in the .../keystore directory called something like

 

UTC--2018-06-23T14-01-11.009548900Z--0e77e8dd1103d05e841c4e16f860d0bbd11204ff

 

following the scheme "UTC--<date>T<UTC time>--<your public key>". This is a normal ASCII file which you can inspect using a text editor. You will need this file (and your password) whenever you would like to send a transaction to the Ethereum network.

Synchronise the blockchain

Before any transactions can be performed your computer needs to download the current state of the blockchain. This is achieved simply by starting geth. Since we do not need to know all transactions which have already taken place in the past, it is sufficient to do this in "fast" mode:

 

geth --syncmode=fast

 

This command downloads only the block headers instead of the complete blocks, saving disk space and computing time. But please, be aware that even this process will require about 60 GByte of disk space and about three days time (at least in my case)!

You can control the synchrinisation progress by entering the following commands in a separate command/terminal window:

 

geth attach
> eth.syncing

 

This will produce the output shown in the attached image. If the result should be "false" instead, either something went wrong or you are done. (Congratulations!)

Once synchronisation is complete, geth will stay in sync with the blockchain by downloading all new blocks published by the miners. If geth is started again the --syncmode qualifier will have no effect.

Initially, this process seems to be quick. But as you get nearer to the top of the blockchain it slows down. According to my experience, geth is then mainly importing new entries all the time. So, you will have to be patient …

Check your balance

Once the synchronisation is complete you may want to check your current balance which is stored in the blockchain:

 

> eth.getBalance(eth.coinbase).toNumber();

 

The output is your current balance in units of one Wei (=10-18 Ether).

Transferring money

Now comes the fun part. Once you have earned some Ether you will see them in your balance. Transferring a part of your moneey to another account is basically accomplished by the following commands:

 

> personal.unlockAccount(eth.coinbase, "password");
> eth.sendTransaction({from: eth.coinbase, 
  to: "0xe77c3cc834ef8d12db8480389c9295dcda716ebd",
  value: web3.toWei(0.05, "ether")})

 

The second command will transfer 0.05 Ether to my wallet. (So, please replace this string by another address.) "eth.coinbase" has nothing to do with the coinbase.com exchange office but simply designates your own wallet. The "to:" parameter is the public address of the recipient. If you are transferring money to coinbase.com (the exchange office), you first need to visit the coinbase site in order to declare that you are going to recieve some amount of Ether. And the web site will tell you the address to be used.

Please, be aware that you will not be able to transfer the complete amount of Ether in your wallet because you need a little bit of money to pay for the transaction itself. This transaction fee is not paid in units of one Ether but in a separate "currency" called gas. This in done in order to decouple the transaction costs from the Ether exchange rate. The calculation of the gas needed for a single transaction is a bit bit complicated. A good explanation can be found in the Ethereum documentation. You can explicitely set the maximum price you are willing to pay for the transaction — the "gas limit" — using the additional parameters "gas" and "gasprice" (both need to be specified). The value of the "gas" parameter is the maximum number of gas units to be spent. The "gasprice" is the maximum price (in units of one Wei) you are willing to pay for one gas unit. The command then looks as follows:

 

> eth.sendTransaction({from: eth.coinbase,
  to: "0xe77c3cc834ef8d12db8480389c9295dcda716ebd",
  value: web3.toWei(0,05, "ether"),
  gas: 22000, gasPrice: web3.toWei(45,"Shannon")})

 

1 Shannon = 109 Wei = 10-9 Ether. So, in this exapmle the maximum transaction fee will be set to 22,000 * 45 * 10-9 Ether = 0.00099 Ether. The actual (lower) fee is finally determined by the miners. There is a risk in the approach: If the gas limit set should be too low, the actual transaction fee will be kept by the miner, but the transaction will not be performed at all. Therefore, I normally just let the system decide.