<p>I would suggest that you use a tool for this.  You could use a payment processor which you pay for or have a look at <a href="https://btcpayserver.org/" rel="nofollow noreferrer">BTCPayServer</a>.</p>
<p>It handles payment requests and can integrate with web stores etc.  It will generate the required addresses and keep track of whether a client has paid their invoices.  So does what you want and more.</p>
<p>It can also receive lightning payments as well as traditional on-chain transactions.</p>

CC BY-SA 4.0
2021-10-20T16:02:43.083Z
2021-10-20T16:02:43.083Z
Louis
<p>Essentially all you need to do is write a simple loop that generates a new key pair each iteration. If you output the loop to a table you can easily paste the generated addresses into a spreadsheet and import to your database.</p>
<p>Example using <a href="https://github.com/coinables/buidljs" rel="nofollow noreferrer">buidljs</a></p>
<pre><code>&lt;head&gt;
&lt;script type=&quot;text/javascript&quot; src=&quot;buidl.js&quot;&gt;&lt;/script&gt;
&lt;/head&gt;
&lt;body&gt;
# of Address to Generate:&lt;input type=&quot;number&quot; id=&quot;iters&quot; value=&quot;1000&quot;&gt;&lt;button id=&quot;addrgen&quot;&gt;Generate&lt;/button&gt;
&lt;br&gt;&lt;br&gt;
&lt;div id=&quot;output&quot;&gt;&lt;/div&gt;
&lt;script&gt;

var btn = document.getElementById(&quot;addrgen&quot;);

btn.onclick = function(){
    console.log('btn click');
    var iterations = document.getElementById(&quot;iters&quot;).value;
    var outtable = '&lt;table&gt;&lt;tr&gt;&lt;td&gt;Index&lt;/td&gt;&lt;td&gt;Address&lt;/td&gt;&lt;td&gt;PrivateKey&lt;/td&gt;&lt;td&gt;Dispensed&lt;/td&gt;&lt;/tr&gt;';
    for(var i=0;i&lt;iterations;i++){
        var a = buidl.getNewAddress();
        var b = a.pk;
        var c = a.p2shp2wpkh;
        outtable += '&lt;tr&gt;&lt;td&gt;'+i+'&lt;/td&gt;&lt;td&gt;'+c+'&lt;/td&gt;&lt;td&gt;'+b+'&lt;/td&gt;&lt;td&gt;1&lt;/td&gt;&lt;/tr&gt;';
    }
    outtable += '&lt;/table&gt;';
    document.getElementById(&quot;output&quot;).innerHTML = outtable; 
}
</code></pre>

<p>The above example is from my NoNodePay project that is intended for people that want to accept bitcoin without running a node. The user generates a large amount of key pairs (default is 1,000), stores the private keys offline, imports the addresses to a database and uses a fresh one for each order. Eventually you will need to generate more and update your database.</p>
<p><a href="https://github.com/coinables/NoNodePay/blob/master/js/addresses.html" rel="nofollow noreferrer">https://github.com/coinables/NoNodePay/blob/master/js/addresses.html</a></p>

CC BY-SA 4.0
2021-10-20T05:05:07.020Z
2021-10-20T05:05:07.020Z
m1xolyd1an
<p>Ok so I am a business trying to accept crypto as a form of payment, but can't seem to figure out how I can generate 1000s of addresses (for each customer) to pay crypto to me? Or would there be some premade tool for this?</p>

<wallet><address-generation><address-management>
Generating 1000s of addresses
Novato
# Generating 1000s of addresses

(Asked by: username_0 on 2021-10-19)

Ok so I am a business trying to accept crypto as a form of payment, but can't seem to figure out how I can generate 1000s of addresses (for each customer) to pay crypto to me? Or would there be some premade tool for this?

**Tags:** wallet, address-generation, address-management


---

## 2 answers

### Answer by username_1 on 2021-10-20. Score: 1

I would suggest that you use a tool for this. You could use a payment processor which you pay for or have a look at [BTCPayServer](https://btcpayserver.org/).

It handles payment requests and can integrate with web stores etc. It will generate the required addresses and keep track of whether a client has paid their invoices. So does what you want and more.

It can also receive lightning payments as well as traditional on-chain transactions.


---

### Answer by username_2 on 2021-10-20. Score: 0

Essentially all you need to do is write a simple loop that generates a new key pair each iteration. If you output the loop to a table you can easily paste the generated addresses into a spreadsheet and import to your database.

Example using [buidljs](https://github.com/coinables/buidljs)

```
<head>
<script type="text/javascript" src="buidl.js"></script>
</head>
<body>
# of Address to Generate:<input type="number" id="iters" value="1000"><button id="addrgen">Generate</button>
<br><br>
<div id="output"></div>
<script>

var btn = document.getElementById("addrgen");

btn.onclick = function(){
    console.log('btn click');
    var iterations = document.getElementById("iters").value;
    var outtable = '<table><tr><td>Index</td><td>Address</td><td>PrivateKey</td><td>Dispensed</td></tr>';
    for(var i=0;i<iterations;i++){
        var a = buidl.getNewAddress();
        var b = a.pk;
        var c = a.p2shp2wpkh;
        outtable += '<tr><td>'+i+'</td><td>'+c+'</td><td>'+b+'</td><td>1</td></tr>';
    }
    outtable += '</table>';
    document.getElementById("output").innerHTML = outtable; 
}

```

The above example is from my NoNodePay project that is intended for people that want to accept bitcoin without running a node. The user generates a large amount of key pairs (default is 1,000), stores the private keys offline, imports the addresses to a database and uses a fresh one for each order. Eventually you will need to generate more and update your database.

<https://github.com/coinables/NoNodePay/blob/master/js/addresses.html>


---

