bitcoin

💰💰 What is BITCOIN, The maths behind bockchain and cryptocurrencies 🤑

hi everybody today I'm going to be

talking about the mathematics of Bitcoin

and the idea behind it known as

blockchain hopefully by the end you'll

have so understanding of how it all

works even if it doesn't make you

instantly rich

[Music]

many people have dreamed of becoming

cryptocurrency millionaires and for a

few the dream has come true when Bitcoin

started out their value was close to

zero and only a handful were smart or

reckless enough to get involved but by

the start of December 2017 the value of

Bitcoin had shot up to about $10,000 and

by the 17th of that month it rose to

almost $20,000 having doubled its value

in just over two weeks plenty of people

jumped onto the Bitcoin bandwagon

many of them were disappointed and some

lost a lot of money a few days after

reaching its maximum the Bitcoin value

dropped almost 20% and as I speak it's

around $8,000 of course that's a pretty

good return on investment if you bought

when the value was next to nothing the

origin of Bitcoin lies in a document

published in 2009 in a cryptography

forum by a programmer whose nickname was

Satoshi Nakamoto there's a link to this

article in the description of this video

transactions in this new type of

currency are carried out directly

between users with no bank or other

organization involved the value of the

Bitcoin is determined solely by supply

and demand so how does it work first to

use bitcoins you have to install a

wallet on a computer mobile phone or

tablet as soon as you do this your first

Bitcoin address is generated and this

enables you to pay for bitcoins or

receive them each Bitcoin address should

only be used in one transaction

all transactions need to be verified

they usually take about ten minutes

although this can be reduced by paying a

commission the waiting time and the

payment of the Commission prevent

malicious users from clogging up the

system with a massive number of requests

all Bitcoin operations are recorded in

what's called a blockchain which is a

public record of all transactions the

important thing is the identities of

everyone taking part are kept secret

this secrecy is vital to Bitcoin and

depends on applying cryptography which

in turn depends on mathematics in the

world of Bitcoin everything we've talked

about so far is called mining it

involves a huge amount of computation in

the past some people chose to let their

own computers be used for mining in

exchange for paying part of their

Commission but that's no longer

profitable and computer farms have been

set up to do all of the necessary

calculations bitcoins can be used like

any dealings with foreign currency or

stocks and shares as a means of

speculation buying and selling the right

prices to make a profit

but there have also been reports of

crypto currencies being used for money

laundering and also fraud as in all

cases where money is involved you need

to be careful at the heart of Bitcoin

technology as I've mentioned is the

blockchain it's a concept that promises

to be usefully in many different areas

including business health and industry

the key to the blockchain is maths from

database entries which can be seen as

matrices to the cryptographic tools that

are brought to bear

to understand the blockchain we need to

know a bit about cryptography remember

when you were young and sent secret

messages to a friend by changing each

letter into the next aim to be B into C

and so on no maybe it was just me anyway

that would involve just a very simple

cryptographic rule or set of rules known

as an algorithm there are lots of

different cryptographic algorithms and

if you're interested in them just leave

a comment and we'll do a future video on

them many cryptographic algorithms are

based on maths processes that are easy

to compute in one direction but hard to

invert one of the Communists of these

processes is factorization it's used in

a well known cryptographic algorithm

called RSA that's the basis of all our

online banking and credit card

transactions cryptography involving

factorization stems from the idea that

if you have two prime numbers P and Q

it's easy to work out their product n

equal to P times Q but if both the

Prime's are very large then it's

extremely hard to work out what they are

if you're only given their product for

example if N equals 6 we can quickly see

that 6 equals 2 times 3 but if n equal

to P times Q is a large number with

certain properties then it's almost

impossible to work out the values of the

Prime's P and Q what cryptographic

algorithm is used in the case of the

blockchain it turns out that it involves

something called elliptic curves so now

we need to look at what these curves are

an elliptic curve is a set of points XY

that satisfies the equation y squared

equals x cubed plus ax plus B for

certain values a and B together with a

point O which is called the point at

infinity

now the elliptic curve use for the

blockchain is the specific one for which

a equals 0 and B equals 7 in other words

y squared equals x cubed plus 7 to

calculate points on this curve you just

put in values of X and figure out the

corresponding value or values of Y for

example when x equals 0 the equation

becomes y squared equals 0 cubed plus 7

or y squared equals 0 plus 7 which is

7th taking the square root of both sides

y equals the positive or negative root 7

this gives us two points on our elliptic

curve 0 square root of 7 and 0 negative

square root 7 and we can carry on

finding many more points to produce a

graph like the one shown here for any

elliptic curve we can define a sum

operation

this isn't like ordinary addition but is

a way of combining two points that's

known as point addition say we have two

points P and Q which lie on the elliptic

curve like those shown on the screen

what's this son we draw the line that

joins these two points and extend it

until it intersects the curve at a third

point then we find the point that is

symmetrical to this in the x-axis

this is what we refer to as the song of

P and Q P plus Q let's repeat the

process with these two points extend the

line that joins the two points until it

intersects with the curve at a third

point again find the symmetrical point

and this represents the son P plus Q we

can also use the curve to add P to

itself to give P plus P or two P to do

this we consider the tangent line to the

curve at P and extend this line until it

intersects the curve at another point

the point that is symmetrical to this

with respect to the x-axis is two P just

rewind the video if you want to see

these examples again the elliptic curve

with this operation that we've been

looking at satisfies some important

properties the associative property the

existence of a neutral element and a

point at infinity and the existence of a

symmetrical element a point P that's

symmetrical with respect to the x-axis

it also satisfies the commutative

property we can say that the elliptic

curve with the sum operation as the

structure of an abelian group we'll talk

about abelian groups and other important

algebraic structures in another video

remember our goal is to obtain a

cryptographic algorithm using the

elliptic curve for this we need a maths

process that's easy to compute in one

direction but hard to invert the one

we'll use is called the discrete

logarithm

what does that mean take a point P on

the curve then consider a large positive

integer n and calculate Q equal to n P

in other words P added to itself n times

knowing N and P a computer can carry out

this calculation very efficiently on the

other hand starting from P and Q it's

very difficult to calculate F similar to

the logarithms you know n is the

logarithm to base P of Q the integer

number n such that n P equals Q the

security of elliptic curve cryptography

is a consequence of the difficulty of

computing discrete logarithms like this

it's important to note that elliptic

curve cryptography the fundamental maths

of the blockchain doesn't deal with the

field of real numbers instead everything

in its related to what are known as

finite fields and modular arithmetic

we'll return to these topics in other

videos for now let's simply say that for

the purposes of Bitcoin in the

blockchain we work with the elliptic

curve modulo the P that appears on the

screen and for these sum operation the

same formulas are used as would be if

working with the real number field

you'll find more about the computer

implementation of all this elsewhere on

the Internet

here we've just focused on the maths

behind the Bitcoin I hope you've enjoyed

the video please subscribe to discover

more maths in the future and I'll look

forward to seeing you again soon

[Music]