From what I understand, you gain bitcoins by having a mining rig. It does the math required for other transactions, and you're compensated for the effort. Kinda like loaning your computer out for a small amount of money. Since you're being paid for the CPU cycles and electricity used in the calculations, I don't see anything haraam about it.