Your Web News in One Place

Help Webnuz

Referal links:

Sign up for GreenGeeks web hosting
April 19, 2022 06:22 pm GMT

ECDSA in Bitcoin

Since I never took computer science courses, I have to catch up with some of the fundamentals, and I find them fascinating.

The Elliptic Curve Cryptography Math that is used to generate an address is crucial to the system. This process is just based on math and can be done without even being connected to the internet.

Lets get into how it works.

Everything is based on this curve called the Secp256k1 derived by the function

y = sqrt(x**3 + 7)

To use it, we generate any random number up to 2^256 and multiply it by a constant point G in the curve

The point G is constant for every bitcoin address and here it is as x and y coordinates:

Two points that make up G

The math that is more interesting and we are more concerned about is how to generate a public key from ANY random number. And that math is a simple function here:

K = k  * G

where k is the private key, G is a constant point called the generator point, and K is the resulting public key.

k can be anything, the important part is that it is random. Once you have a random value for k you just multiply that by G which is the process of extending a tangent until it intersects with a different point in the line and reflecting that point across the X axis.
Image showing the above description

The result is called your public key and can be shared with ANYONE because it is extremely improbable that someone can derive the private key backwards from it.

You still have to run it through some hashing functions to generate an address, but this is pretty much it. This math has been around since the 80s and is considered secure enough to hide government secrets. By signing a transaction with that private key, you are basically proving that you are the only person with access to the private key used to generate that public key.


Original Link: https://dev.to/javier123454321/ecdsa-in-bitcoin-4130

Share this article:    Share on Facebook
View Full Article

Dev To

An online community for sharing and discovering great ideas, having debates, and making friends

More About this Source Visit Dev To