Bitcoin Math

Bitcoin still perseveres, though some have drawn comparisons with the tulip bubble. We know that Bitcoin and other cryptocurrencies arise because of a process called mining that consist of some heavy calculations done by computers, appropriately nicknamed mining rigs. However, what is the math behind the process? Are you better off placing a bet on Betin or mining for bitcoins? Let’s try and find the answer below.

ECDSA

ECDSA stands for Elliptic Curve Digital Signature Algorithm. In the lack of a better term, the algorithm makes use of the elliptic curve and the Galois field to come up with a signature of sorts. This so-called signature is there so that anyone can verify the validity of the process. When you buy and sell Bitcoin, this is the algorithm that says: “It’s legit”. Think of it as the Treasurer’s signature on the US dollar bills.

The algebra of the elliptic curve is as follows: y2=x3+ax+b. The Galois field, or the finite field, contains a number of finite elements. In other words, the finite field is the set of positive numbers that are the result of any calculation.

Keys

Bitcoin needs a special set of parameters that are fixed for everyone who plans on using the protocol. We need to know the equation, the base point and its order, and the prime modulo of the field. Here, we are introduced to key cryptography.

In the ECDSA, to make a private key, all we need is a number between 1 and the order, which goes up to 2256. This number needs to be unpredictable, and it is – it is very unlikely that the number will repeat itself in future transactions. This private key is the signature we were talking about earlier. The public key can be constructed from the private key times the base point.

To make a transaction, you need the previous transaction. Your private key is like a key that goes with the gym locker – it is good for that one time for something you own. You use the private key to match the public key, in order to get your funds.

If the public key in question hashes RIPEMD160 with no collisions, the transaction can go through. In case you were wondering, collisions are those things where we get the same key in different transactions, the chances of which are beyond astronomical.

I’m Still Confused

Erik Rykwalder explained the step-by-step math behind Bitcoin in a blog post. It is a great read if you want to learn more about how it actually works. If the math is too much for you, the point is this: Bitcoin uses Elliptic Curve Digital Signature Algorithm, or ECDSA to create a signature. The information about transactions is heavily encrypted and can’t be accessed by just anyone.

Each key is unique, as the number used to make the key is unfathomably large. To make a transaction, the algorithm checks the key to see whether there have been previous transactions using that key. If not, the transaction goes through. In other words, your cryptocurrency can’t be easily hacked, nor can it be double-spent.