<p>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.</p>

<p>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.</p>

<p>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.</p>

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

CC BY-SA 3.0
2016-07-08T10:42:43.483Z
2016-07-08T10:42:43.483Z
Pieter Wuille
<p>I understand that the private key is generated with a <a href="https://en.bitcoin.it/wiki/Private_key" rel="nofollow">random number</a></p>

<blockquote>
  <p>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</p>
</blockquote>

<p>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 ?</p>

CC BY-SA 3.0
2016-07-08T09:48:47.687Z
The "number" (256bits) **is** the private key. If its not stored somewhere, your private key is lost.
Jonas Schnelli
CC BY-SA 3.0
2016-07-08T10:00:52.533Z
@JonasSchnelli: I think that's more of an answer than a comment. :)
Murch
CC BY-SA 3.0
2016-07-08T10:15:24.180Z
I thought that its hashed version is stored. And the number itself as well?
John Smith
<private-key>
The number that generates the private key, is it stored somewhere?
John Smith
# The number that generates the private key, is it stored somewhere?

(Asked by: username_0 on 2016-07-08)

I understand that the private key is generated with a [random number](https://en.bitcoin.it/wiki/Private_key)

> 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 ?

**Tags:** private-key

> **Comments:**
> **username_1**: The "number" (256bits) **is** the private key. If its not stored somewhere, your private key is lost.  
> **username_2**: @JonasSchnelli: I think that's more of an answer than a comment. :)  
> **username_0**: I thought that its hashed version is stored. And the number itself as well?  

---

## 1 answers

### Answer by username_3 on 2016-07-08. Score: 6 | Accepted answer

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.


---

