ThielIB Calculus SLDecember 19, 2017Mathematics behind BitcoinCurrenciesaround the world are always changing and improving upon themselves over theirvast history. 1The first system dates backto 9000 BC to early man where they would barter excess goods for ones that theyneeded like; grains and cattle. Years laterin 1200 BC, cowrie shells were seen around the Indian Ocean as a form of tradesystem. Around 1100 BC, China started touse small replicas that were made of bronze to resemble goods in order to trade. Finally, in 600 BC, King Alyattes of Lydia(modern day Turkey) made the first “official” currency.
For practical reasons they were made intorounded coins and they would enable the Mediterranean trade world toflourish. It wasn’t until 2400 plusyears later that a gold coin was minted in Florence. This coin called the Florin would ultimately bethe beginning to international commerce. After all these years, paper money finally made its first appearance inAD 1290 when Marco Polo presented the idea of paper to the Europeans. Unfortunately, like many great things, ittook years for paper money to finally catch on in AD 1661.
Then in AD 1860, a huge leap for currenciestook place as the industry giants of the Western Union created electronic fundswhich were able to transfer via telegram. The next advancement brought us to the invention that would bringmillions of people into debt. In AD 1946,John Biggins invented the first credit card called the “Charge-It”. Just twenty years ago the European bankscreated the ability for smart phones to do mobile banking. This led us to the next currency in historythat will change the world as we know it.Duringthe end of 2008 the economy was dropping. By January 3rd, 2009, the world began to change with theintroduction of the first cryptocurrency, Bitcoin.
This new form of peer-to-peer transactioncuts out the middleman known as the bank. In the next nine years the value of one coin would increase from$0.00076 to $20,042.
90 on December 17th, 2017. This 2.6 billion percent increase created anoverall market cap of bitcoin a staggering 350 billion USD. When I personally heard about Bitcoin inSeptember of 2017, it was just at $3,000 per coin. However interesting this may be, the questionI have been wondering is to what extent does mathematics plays a role in thebitcoin system? To begin, the understanding of bitcoin must be developedand learned.
It is essentially aprotocol for peer-to-peer financial transactions and this protocol isdecentralized which means it uses no central bank. Currently there are around 17 million coinsin circulation but there is a maximum amount set at 21 million. However, thosewon’t be all released for another hundred plus years because, just like gold,the difficulty of mining bitcoin increases as there are less and lessavailable. Due to the limited supply ofcoins, bitcoin is somewhat like the gold standard. This leads us to bitcoin mining which is theequivalent of creating blocks which is like a ledger of every transaction inthat specific time period which goes into the block chain. The block chain isknown as, “a digital ledger in which transactions made in bitcoin or anothercryptocurrency are recorded chronologically and publicly” 2. The block chain gives the security totransact between peers.
Morespecifically, the Elliptic Curve Digital Signature Algorithm (ECDSA) providesthe security. It is a process that, “usesan elliptic curve and a finite field to ‘sign’ data in such a way that thirdparties can verify the authenticity of the signature while the signer retainsthe exclusive ability to create the signature”3. In the terms of bitcoin, the transactions are”signed” by miners when transferring ownership. The critical part of mathematics in bitcoin is the ECDSA and that leadsto the question of; how does the ECDSA allow for a peer-to-peer transactionthat is decentralized from all trusted third parties or middlemen? This exploration will examine the Elliptic Curve DigitalSignature Algorithm and how it created the groundbreaking mathematics thatallows a public key to be created and signed through a private key. Furthermore, it will explore the uses now andeven potential applications of it in the future.
The formulas and algorithms are credited toDr. Scott Vanstone who lived from 1947 to 2014.4 Understandably,bitcoin may be very confusing to anyone who is just getting started with thisnew advancement in exchanges of currency which reduce barriers globally. The main reason behind this is becausebitcoin’s technology essentially redefines the idea of ownership.
Normally, we think of ownership whenreferring to anything such as land, a car, or even money as having personalcustody or giving custody over to a bank and other trusted entities. Thenew form of ownership is no longer stored centrally or locally. This means no one person is the owner ofbitcoin. The bitcoin simply lives on aledger known as the block chain which is shared through a network ofcomputers. No one truly owns abitcoin. What they have is thecapability to transfer control to someone else.
This is where the Elliptic Curve Digital Signature Algorithm (ECDSA)comes into play. It uses an ellipticcurve and a finite field in order for third parties to oversee and verify the”sign off” on transactions while leaving the ability of making the signatureexclusive to the signer. Theelliptical curve is the first form of mathematics that shows up in the bitcoinsystem. An elliptical curve can be shownalgebraically with the equation: Or y=(seenat right)Theversion in bitcoin’s system of ECDSA uses a=0 and b=7 making the equation: (seenat right)Thereason the elliptical curve is used in the verification system is because ofits unique properties such as:· 5Anynon-vertical line which intersects two points that are non-tangent on the curvewill always intersect a third additional point on the curve.
· Any non-vertical line that is tangent tothe curve at one select point will intersect just at one other point on thecurve. Through these properties,two operations are able to be used called point addition and point doubling. Pointaddition yields the formula which can be defined by taking the thirdintersection point of a line R’ reflected across the x-axis.Pointdoubling gives the formula which is when the tangent line to a set pointP is doubled. This leads to finding thepoint R’ and having it reflected across the x-axis as well giving the end valueof R.Thesetwo operations allow for scalar multiplication which is the equation.
P is multiplied a times to equal R. For example allow: 9PEssentially,scalar multiplication is able to break down the equation into two pointdoubling and two point addition.Next,a background of finite fields is needed in order to further the process inECDSA. When referring to the ECDSA, afinite field has an already defined range of only positive numbers.
All calculations must fall inside this field,meaning the numbers outside the range have to be represented like remainders inorder to fit. The way this is shown isthrough a modulus or mod operator. Forexample, 26/9 has the outcome of 2 with a remainder of 8. In the form of a modit can be seen as the following:Thefinite field is 9, and all of the mod operations that are over the field have aresult falling within the range of 0 to 9.Theprotocol for bitcoin must select its own set of parameters for the ellipticcurve equation and for its finite field.
These parameters are set for all who use the protocol. Tranquility Halo states that the parametersinclude an equation used, a field with a prime module, along with a base point that must falls on the curve. Additionally, the order of the base point, which is a functionof the other parameters, can be thought of graphically as the number of timesthe point can be added to itself until its slope is infinite, or a verticalline. The base point is selected such that the order is a large primenumber. 6 In the case of bitcoin, it uses extremelylarge numbers for all of these parameters involved in the ECDSA.
In order to create security in the bitcoinsystem the values of these numbers must be enormous. This will prevent hackersand it ultimately give a feeling of safety to all who use the system. When the values are extremely large it makesit virtually impossible to reverse engineer the algorithms.These following valuesare provided by Eric Rykwalder for the case of bitcoin:Ellipticcurve equation: Primemodulo: Base point: 04 79BE667E F9DCBBAC 55A06295 CE870B07 029BFCDB 2DCE28D9 59F2815B16F81798 483ADA77 26A3C465 5DA4FBFC 0E1108A8 FD17B448 A6855419 9C47D08F FB10D4B8Order: FFFFFFFF FFFFFFFF FFFFFFFF FFFFFFFE BAAEDCE6 AF48A03B BFD25E8C D0364141Thisformula goes by the name of secp256k1 and it was proposed for the use ofcryptocurrencies. Furthermore, it is a part of the family elliptic curvesolutions over a finite field. After going over those equations andformulas it is possible to begin the understanding of private and publickeys.
The private key is a random andunpredictable number chosen between 1 and the order (see above order forexample). Once this private key ischosen then the public key can be formed by doing scalar multiplication to thebase point (see above for example). Inthis case the equation of can be created to form a public key. Essentially what this is saying is that thelimit of possible private keys known as bitcoin addresses is equal to theorder. The fascinating thing about thisis that the order has possible outcomes. To even begin to understand how vast andenormous this number is would take a while in itself. To show how much work goes intofinding a public key I will give an example if a very basic private key translatedinto a public key. This will simulatethe same procedure that bitcoin would use in creating public keys from aprivate.
For this the components ofpoint addition ( will be used. The example7 isas followed: Andpoint doubling of p tofind r is as follows:Due to my limitedknowledge of computing the public key from a given private key by using pointdoubling and point addition I found a limitation in my writing. In order to continue the explanation ofmathematics involved in bitcoin I found an example8of a very basic private key which is computed into a public key. The parameters are as followed:Equation: y2 = x3 + 7 (whichis to say, a = 0 and b = 7)Prime Modulo: 67Base Point: (2, 22)Order: 79Private key: 2The public key will be found first and because this examplehas one of the simplest private keys there is it will only involve a singlepoint doubling operation.
The calculation is as followed: In this situation it is unable to bedivided in a finite field so in order to get around this it must be multipliedby the inverse which is equal to the following: The public key coincides with the point(52, 7). That amount of work was neededfor a private key of 2. You can imaginethe amount of computing needed to do a normal private key. However if trying to reverse engineer this bytrying to get the private key from the public key it is possible. Lucky that is why the actual parameters aremuch larger in comparison to prevent this from ever happening. The way the bitcoin system was created makesthis a one-way trip from private to public key.
Now that it is somewhat understood how to go from private to public keythe next step is to “sign” the data or transactions that are sent from oneaddress to another. The transactionwhich make up one block may be of any length. The first step to signing this block is by hashing the transaction whichwill create a 256 bit which is the same as the order seen earlier in thecurve. The algorithm used by bitcoin isthe SHA-256 which unfortunately is another entire idea of math in itself. I would explain it however seeing that ittakes a person a day to do just 0.67 of a hash.
For this situation we will sign the data with z and skip thehashing. The recipe9for the signed transaction is made through five steps.Step1: An integer “k” that falls between 1 and n – 1 must be chosen.
Step2: The point must be calculated usingscalar multiplication.Step3 Must befound. If r = 0, then return to step 1.Step4: is then found. Again, if s = 0, return to step1.
Step5: Finally, the signature is the pair (r, s) In order for the bitcoin system towork and be secure, the value of k must be random each time. This will prevent from third parties behindable to guess it and ultimately hacking into someone’s private key (bitcoinwallet/address). With the knowledge ofwhat goes on behind a transaction and the creating of keys, bitcoin is able tobe understood on a larger scale. Since the creation of bitcoin in thebeginning of 2009 many other entrepreneurs have started to pop up all over theworld trying to improve upon the original bitcoin platform. As of January, there were near nearly fifteenthousand cryptocurrencies in existence and they will continue to grow in numberover the coming years. Many have triedto become the next big thing by creating something that is new but what has notchanged yet is the fact that they all use a block chain. More or less, what this mean is all fifteenthousand are using the Elliptic Curve Digital Signature Algorithm to keep thesystem safe, secure, and successful. Theapplications of this still extremely new technology will continue to shape thefuture as more and more people begin to realize what it is doing to not only astate or country but the entire world’s economy.
One takeaway from this exploration is thatfrom bartering in 9000 BC to using bitcoin in the 21st century. The constant in society is mathematics. It has improved over the years and it willnot stop any time soon. Overall, this exploration has goneover the history of money and how it has improved over the years with mathbeing the main source of the newest currency bitcoin. Along with a small overview of what bitcoinis and how it has changed the way the world should see ownership.
Finally, it has provided a more in-depth lookat the mathematics that go along with the Elliptic Curve Digital SignatureAlgorithm. Through this process thelargest limitation was find more information on such a new form ofmathematics. It required that extra stepto understand how to show what the math was actually showing us.
However this may be, it truly opened thedoors to making new realizations of what is going on in the world of math andhow important and equation like can make a difference in society. A simple math equation can create a new formof currency that millions back and trust now. Additionally, this has developed a deeper understanding of themathematical relationship between public and private keys which was focused onextensively. Although no full 256 bitnumbers were evaluated, doing the more simple examples shows how complicatedeven those are which gives the understanding of how complex a real evaluationmust be.
Finally, I hope to have shownthat the bitcoin system is to be trusted and secure and that it will not begoing away for a long time as it has created a new form of currency that willcontinue shape the world as we know it. Bibliography Bajpai, Prableen. 18. Investopedia.
September 17. Accessed Decemeber 20, 2017. https://www.
Burn-Callender, Rebecca. 2014. The Telegraph. October 20. Accessed December 18, 2017. http://www.telegraph.co.
uk/finance/businessclub/money/11174013/The-history-of-money-from-barter-to-bitcoin.html. Greg, Tranquility. 2017. Tranquility Halo. November 25. Accessed December 16, 2017. http://tranquilityhalo.
com/category/blockchain/. Rykwalder, Eric. 2014.
coindesk. October 19. Accessed December 19, 2017. https://www.coindesk.com/math-behind-bitcoin/.
Sullivan, Nick. 2017. Cloudflare Blog.
July 28. Accessed January 23, 2018. https://blog.cloudflare.
com/ecdsa-the-digital-signature-algorithm-of-a-better-internet/. 1 (Burn-Callender 2014)2 (Bajpai 18)3 (Greg 2017)4 (Sullivan 2017)5 (Greg 2017)6 (Greg 2017)7 (Rykwalder 2014)8 (Rykwalder 2014)9 (Greg 2017)