The number that generates the private key, is it stored somewhere?

1

1

I understand that the private key is generated with a random number

Specifically, any 256-bit number from 0x1 to 0xFFFF FFFF FFFF FFFF FFFF FFFF FFFF FFFE BAAE DCE6 AF48 A03B BFD2 5E8C D036 4140 is a valid private key

I would like to know if this number is stored somewhere. If it is stored, we will be able to regenerate the private key, and the pubic key. Is that right ?

XR SC

Posted 2016-07-08T08:21:29.447

Reputation: 339

1The "number" (256bits) is the private key. If its not stored somewhere, your private key is lost.Jonas Schnelli 2016-07-08T09:48:47.687

@JonasSchnelli: I think that's more of an answer than a comment. :)Murch 2016-07-08T10:00:52.533

I thought that its hashed version is stored. And the number itself as well?XR SC 2016-07-08T10:15:24.180

Answers

6

The private key IS a number, and is remembered as such. It may be generated thought various means (like HD wallets, deterministic generation, from a BIP39 seed, or randomly). It is usually stored as 32-byte array.

The private key is then converted to a public key. This requires a complex mathematical operation, and results in a coordinate pair on an elliptic curve. This is usually stored as a 33-byte or 65-byte array.

That public key is then hashed, a checksum is appended to it, and converted to base58. The result is what is called an address, and is what you give out to others to get paid by them.

The private key never leaves your computer/wallet/app. The address is public.

Pieter Wuille

Posted 2016-07-08T08:21:29.447

Reputation: 54 032