My little Bitcoin investment & mining experience

I do not count the time I looked at Bitcoin in the past since about 2011-2012. Every time I started thinking about mining there was an investment to do (like GPU, then ASIC) and I never trust enough this money to make this investment. So as a consequence I never jump into this techno by the past, more than to understand how it works and learn.

Now Bitcoin in reaching some unexpected peaks ( > 15,000€ ) and it really looks like a bubble everyone is talking about, so as a mad man, I through it was the perfect time to start playing with this money. Trust me, as a guy who started investing in Internet technologies in 2001, you may never follow me on such decision !

Starting playing with this was an interesting learning opportunity, so this post will relate this experience and the different things I found in the bitcoin ecosystem.

First of all, when I’m talking about bitcoin, it is not really bitcoin but more largely crypto-currencies as I’m playing with Bitcoin, Ethereum, Litecoin and Domraider Tokens (DRT).

Understand crypto-money

I do not want to detail what it is as many post are already make this well on internet. Basically crypto-currency is a virtual money you predict the production, limited in quantity over time you can exchange with blockchain transaction. The money is created in a mining operation. The mining operation is the result of validating a group of transactions it happens on regular and predictable basis.

As any money, there is a generation of money, then the price is related to the offer and demand balance. It is basically a question of trust. As the money is created on regular basis in a limited amount if you want to buy some you are in competition with all buyers and the price raise. If many want to exchange the currency into another one quickly the price will decrease. Nothing special here.

Money is totally virtual and stored in an encrypted wallet you can have yourself or you can have in a bank on internet.

So here we have the different element we are going to detail in the next chapters:

  • crypto-money banking
  • crypto-money stock exchange
  • crypto-money mining

Bitcoin, Ethereum, Litecoin… banking

Crypto-money have its own banking systems. These banks are owning your wallets and allows to buy an sell Bitcoins (and others) and transform them into $ or €. They are basically the boundary between the “real” world and the “virtual” world.

One of the interesting thing is the control operated at these boundaries. Blockchains are basically anonymous (even if fully transparent and shared). You have an identity and anything can be tracked but this identity is just a random series of numbers. So you can transfer money when you want, to who you want, for free… For this reason some years ago a lot of not fully clean money has come to the crypto-world as a way to escape movement and owning visibility. Now the states have accepted this money and create a legal context. In this context any movement from “real” to “virtual” world must be associated with an identity. That way the money movement are mostly fully identified and traceable like any bank exchange. There are ways to wash money but everything is traceable.

So the access to these bank requires a full identification. I’ve tried two of them:

  • Cubits :  is the more simple one, only exchanging bitcoin. The identity verification was really complete, with a video chat, detailed looking on my passport … this was really pro and it was a surprise to discover how the identity validation service economy has progressed these last years. You firstly have to transfer found on your account then you can make the operations.
  • Coinbase : is more advanced, you can buy/sell bitcoin, litecoin and ethereum. The identification is more simple with only a passport photo you need to provide.

These bank are generating benefits on transaction fees. It is the most import thing to take a look at. Cubits have really large fees on Credit Card transactions so it is better to do bank transfer or use some of the alternate solution proposed via third party. Isis globally restricting it usage. One you have money in the system you can start buying and selling. You have fee on each transaction, the fee is small when the money stays in cubits. You can play intra-day sell/buy as the execution is immediate.

Coinbase have more acceptable fees for credit card transfer and external transfer so I’m preferring this site actually, it is less expensive and more easy. The main issue was on a small crash when the platform was totally down and it was impossible to buy or sell anything. Cubits was working well at that moment allowing to play with money movements.

These banks are interesting in terms of efficiency and easiness. They are good model for future of online banking : all have fully and immediate account creation with identity verification. All have multiple factor security systems easy to use. The mobile and web-platform are simple and focus on the minimal requirements.

Cypto – Stock exchange

To exchange different crypto currencies, there are different places specialized. The one I’m using is hitbtc. This platform does not allow you to make “real” to “virtual” world money transfer, so you can just exchange crypto money like exchanging Ethereum for DRT, bitcoin for ETH … You don’t need a specific identity verification on this platform, you can create an account.

Once done you can transfer currency from you bank account to your Hitbtc account. Once credited you can start placing order on the currency you want. The tool have a very large set of stock-exchange graphs and tools. The main difficulty is that the currency are valuated in other crypto currency so it is not really easy at the beginning to identify the amount of “real” money you are investing.

When bank allow to buy / sell at the current price, the stock exchange allows to place order at desired price, limit, max, min price …

Hitbtc takes fees on the different exchange to create it profit. The fee is small but the number of transaction is really large.

Mining Bitcoin

The last part is about mining. Mining is the action of resolving a mathematic challenge to validate a transaction. The miner validating the transaction is getting a reward. Actually 12,5 bitcoins. As the bitcoin price is 15,000€ it means you earn 187,500€ if you are the one. It is like a lottery where you have a winner every 10 minutes.

What you need to do to play ? just run a program on your computer ! That said the reality is a but more complex. As in a lottery you have to buy tickets and only one win. The price of the ticket is the energy you spent for calculating and the investment you made on your hardware. The chance you have to win is related on the number of tickets you have compared to the overall tickets distributed on each turn. The system is by design scalable and basically, more player you have and more tickets there are, but compared to a lottery where the distributed money depends on player investments, here the distributed money is fixed whatever player you have.

Personally, I’m in a situation where I have a server hosting some website (like this one), running different VMs. On this server only 50% of my CPUs are allocated on my VMs. So basically I’m paying for half a server not doing anything. So in the above equation, playing bitcoin mining is not costing me anything. So let’s go !

Do I have a chance to win ? For sure yes, everything is random and I can be the one. My chance is related to the number of lottery “tickets” i can by compared to the overall tickets sold at each turn. A ticket is a Hashing try in the crypto-currency mining environment. It depends of the capacity of my system to do a such Hash computation. (Hashing is a mathematic operation transforming a value into another value, the initial value can’t be predicted from the final value so you can only try random / brute force way to find initial from the final – this is used for protecting password basically – and much more)

My system is a 3 cores XEON (professional server class) system. It’s performance to hash is about 10MH/s. So basically in the 10 minutes of each lottery turn I can get 6,000,000,000 tickets or Hash. But the overall tickets distributed on bitcoin is actually about 9,000,000,000,000,000,000. So my chance to be the one is about 6E-10. Statistically I’ll be the one somewhere in the next 100,000 coming years assuming the overall ticket distribution stay stable which is totally wrong. That’s I like in statistics : you have no chance to win but you can win in the next hour, so why not playing if you do not have to invest.

So to start mining, there are different ways. To start I’ve installed bitcoin on my linux box and as for any blockchain you have to retrieve and validate the blockchain to start working with it. I did that multiple time by the past and it was an operation really quick the first time, then taking a couple of hours the next time. That time this operation has taken 10 full days of downloading and processing before being up-to-date. The blockchain size on my server is larger than 250GB.

Apparently bitcoind it not mining anymore ( I have tried different options with no result ) and by-the-way it is no optimized for mining. So the next step was to use a dedicated program bfgminer. This miner is supporting different mining hardware, cpu is by default unactivated but you can compile for cpu mining. Like in this .configure command:

./configure --disable-other-drivers --enable-cpumining \
     --enable-keccak --enable-scrypt --without-libudev \
     --without-libusb --prefix=/opt/bfgminer

Then the  miner can be started. It gets blocks from the local bitcoind server or from a pool (we will talk about this later) and apparently store the bitcoin you cound earn in a coinbase wallet you can specify. I start it that way :

LD_LIBRARY_PATH=/opt/bfgminer/lib/ ./bfgminer -o http://localhost:8332/#allblocks \
  -u username -p password --cpu-threads 3 \
  --set-device cpumining --algo auto -S cpu:auto --show-processors \
  --coinbase-addr XXXXXXX

That way the minner search for the best way to produce as much Hash as possible per second. For my Xeon server it uses the SSE2 specific instruction set and generate 10MH/s. You will see that in the screen.

That was for some technical details for other players not fully desperate on statistics like I am… So back on more non-tech information.

How can we mine bitcoin in 2017 ?

So having a server does not give a chance for mining and earning money so how does miners do ?

Basically, the number of equivalent Xeon CPU Core running actually the block chain is about 5E12 = 5,000,000,000,000 = 5 T CPU/Core…

A Xeon CPU is a good machine for general computing but really bad for anything specific (as basically any cpu) so for this specific mathematic operation it is not efficient. For this reason people quickly move from CPU computation to GPU computation.

GPU have parallel computing units and built for math computing. They are more efficient and the current Graphical card are about 100MH/s to 1GH/s and are basically equivalent to 300 CPU Core in one card. You can put multiple together to addition this computation power. So GPU have a great place in mining in the past years. But actually you still have 300 times more chance than nothing to win. It is not sure you can rely more than on miracle like with CPU.

Now we are entered in the ASIC area, this is the area of dedicated chips, only made for Hashing. The power of such machine starts from 1,6GH/s to 14TH/s. The cost is from 20-50 euro for the first one to 4,000-6,000€ for the more powerfull one. Just to make a comparison, the smaller one (basically they are just an USB key) is equivalent to 500 CPU/Core and the more powerful one is equivalent to 4,6M CPU/Core in one box.

What are the chance to be the winner with a such machine ? 1 on 1,1M … so you have a chance to be the one in the next 5 year assuming the computation power stays stable.

So is there any-way to get money from mining ? You can rely on chance and on miracle or you can share your computing power with other people. This is basically the way pools are working. Instead of mining alone, you are part of a pool. The pool get rewarded more often and the reward is spread over all the participants based on the computation power provided. So you do not have the 12,5 bitcoins but a share of this based on your share of computing in the pool. This is a way to gain less but to get something at end. It’s a choice like playing lottery as a team at work to play more frequently for less but getting less on win.

I’ll tell you more later as my curiosity pushed me on buying so Asic for a try.

 

2 thoughts on “My little Bitcoin investment & mining experience

  1. Another interesting cryptocurrency is http://iota.org/ it is not based on blockchain nor in maths computing, very scalable, very power efficient, and the most important, it is an internet of things coin, a way to monetize IoT data.

    Imagine a IoT device, a public temperature sensor, if someone want to read it, you must pay some cents for the data using IOTA.

    Imagine a solar cell PV system connected to the grid, earning/generating IOTAs and a Electric vehicle owner paying IOTAs to recharge the car

    • Basically I just don’t understand what it is really proposing as service in the IoT environnement… Do we have concrete exemple of use of this blockchain with connected objects ?

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.