<blockquote>
  <p>I study bitcoin and don't exactly understand that how new wallet
  generate?</p>
</blockquote>

<p>I think you mean address, not wallet. A wallet is a software application that manages your addresses, and let's you view/spend the Bitcoin associated with them.</p>

<p><strong>Address</strong><br>
A <a href="https://en.bitcoin.it/wiki/Address" rel="nofollow noreferrer">Bitcoin Address</a> is a shortened form of <a href="https://en.bitcoin.it/wiki/Script" rel="nofollow noreferrer">Bitcoin script</a> that locks the funds associated to it. In order to spend the funds, you must provide the necessary input to the script so that it equates to true when the script is executed by nodes on the Bitcoin network. This usually includes a signature of the transaction by the private key associated to the address. Here's an example of a Pay-to-Public-Key Hash (P2PKH) address:</p>

<p><strong>P2PKH</strong><br>
<code>16JrGhLx5bcBSA34kew9V6Mufa4aXhFe9X</code></p>

<p>Steps to generate the address:</p>

<ol>
<li>Generate a random 32 byte private key. For example (do not use this): <code>a966eb6058f8ec9f47074a2faadd3dab42e2c60ed05bc34d39d6c0e1d32b8bdf</code></li>
<li>Calculate it's corresponding public key using <code>secp256k1</code> elliptic curve
<code>023cba1f4d12d1ce0bced725373769b2262c6daa97be6a0588cfec8ce1a5f0bd09</code></li>
<li>Calculate the <code>hash = RIPEMD160(SHA256(public-key))</code>: <code>3a38d44d6a0c8d0bb84e0232cc632b7e48c72e0e</code></li>
<li>Encode <code>Base58Check(hash)</code>: <code>16JrGhLx5bcBSA34kew9V6Mufa4aXhFe9X</code></li>
</ol>

<p><em>See <a href="https://medium.com/coinmonks/how-to-generate-a-bitcoin-address-step-by-step-9d7fcbf1ad0b" rel="nofollow noreferrer">How to Generate a Bitcoin Address</a></em></p>

<blockquote>
  <p>How we can found that the new wallet didn't generate before? What is
  complexity of search?</p>
</blockquote>

<p>You want to make sure you don't use a private key that someone else might have. There is no way to search all the addresses that might be known because only addresses that have received coins are on the blockchain. Also, many addresses can be derived from the same key pair using different scripts, so you can't be sure you don't have a duplicate just by checking the address.</p>

<p>Since a private key can be <a href="https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys" rel="nofollow noreferrer"><strong><em>nearly</em></strong></a> any 32 byte number, there are on the order of 10^70 possibilities. You will never have a collision with another key as long as you choose a sufficiently random source for key generation. This is the most important thing to remember. For example, don't use a <a href="https://en.bitcoin.it/wiki/Brainwallet" rel="nofollow noreferrer">Brainwallet</a> or any other low entropy source to generate a private key because it makes it easier for someone to guess.</p>

CC BY-SA 4.0
2018-10-16T13:32:57.363Z
2018-10-16T13:32:57.363Z
JBaczuk
<p>I study bitcoin and don't exactly understand that how new wallet generate?
The documentation write below sentence:
"For generate new wallet, first search that there is no such wallet"
How we can found that the new wallet didn't generate before?
What is complexity of search?</p>

CC BY-SA 4.0
2018-10-16T01:13:18.290Z
Documentation for what wallet service or software? Do you have a link to said documentation?
Pieter Wuille
CC BY-SA 4.0
2018-10-16T01:14:56.860Z
The bitcoin.org documentation
R_Jalaei
CC BY-SA 4.0
2018-10-16T01:18:53.567Z
Please update your question with an actual link.
Pieter Wuille
CC BY-SA 4.0
2018-10-16T10:58:26.310Z
The phrase you quoted [exists only in your question](https://www.google.com/search?q="For+generate+new+wallet%2C+first+search+that+there+is+no+such+wallet") - it is not a quotation from any documentation indexed by Google.
RedGrittyBrick
<wallet>
performance of new wallet address
R_Jalaei
# performance of new wallet address

(Asked by: username_0 on 2018-10-16)

I study bitcoin and don't exactly understand that how new wallet generate?
The documentation write below sentence:
"For generate new wallet, first search that there is no such wallet"
How we can found that the new wallet didn't generate before?
What is complexity of search?

**Tags:** wallet

> **Comments:**
> **username_1**: Documentation for what wallet service or software? Do you have a link to said documentation?  
> **username_0**: The bitcoin.org documentation  
> **username_1**: Please update your question with an actual link.  
> **username_2**: The phrase you quoted [exists only in your question](https://www.google.com/search?q="For+generate+new+wallet%2C+first+search+that+there+is+no+such+wallet") - it is not a quotation from any documentation indexed by Google.  

---

## 1 answers

### Answer by username_3 on 2018-10-16. Score: 1 | Accepted answer

> I study bitcoin and don't exactly understand that how new wallet
> generate?

I think you mean address, not wallet. A wallet is a software application that manages your addresses, and let's you view/spend the Bitcoin associated with them.

**Address**  
A [Bitcoin Address](https://en.bitcoin.it/wiki/Address) is a shortened form of [Bitcoin script](https://en.bitcoin.it/wiki/Script) that locks the funds associated to it. In order to spend the funds, you must provide the necessary input to the script so that it equates to true when the script is executed by nodes on the Bitcoin network. This usually includes a signature of the transaction by the private key associated to the address. Here's an example of a Pay-to-Public-Key Hash (P2PKH) address:

**P2PKH**  
`16JrGhLx5bcBSA34kew9V6Mufa4aXhFe9X`

Steps to generate the address:

1. Generate a random 32 byte private key. For example (do not use this): `a966eb6058f8ec9f47074a2faadd3dab42e2c60ed05bc34d39d6c0e1d32b8bdf`
2. Calculate it's corresponding public key using `secp256k1` elliptic curve
   `023cba1f4d12d1ce0bced725373769b2262c6daa97be6a0588cfec8ce1a5f0bd09`
3. Calculate the `hash = RIPEMD160(SHA256(public-key))`: `3a38d44d6a0c8d0bb84e0232cc632b7e48c72e0e`
4. Encode `Base58Check(hash)`: `16JrGhLx5bcBSA34kew9V6Mufa4aXhFe9X`

*See [How to Generate a Bitcoin Address](https://medium.com/coinmonks/how-to-generate-a-bitcoin-address-step-by-step-9d7fcbf1ad0b)*

> How we can found that the new wallet didn't generate before? What is
> complexity of search?

You want to make sure you don't use a private key that someone else might have. There is no way to search all the addresses that might be known because only addresses that have received coins are on the blockchain. Also, many addresses can be derived from the same key pair using different scripts, so you can't be sure you don't have a duplicate just by checking the address.

Since a private key can be [***nearly***](https://en.bitcoin.it/wiki/Private_key#Range_of_valid_ECDSA_private_keys) any 32 byte number, there are on the order of 10^70 possibilities. You will never have a collision with another key as long as you choose a sufficiently random source for key generation. This is the most important thing to remember. For example, don't use a [Brainwallet](https://en.bitcoin.it/wiki/Brainwallet) or any other low entropy source to generate a private key because it makes it easier for someone to guess.


---

