Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: TrabajoDeLaNoche on November 24, 2017, 09:49:42 AM



Title: What is the best way to generate unique addresses for an ecommerce ?
Post by: TrabajoDeLaNoche on November 24, 2017, 09:49:42 AM
Hello,

We want to accept bitcoin on our ecommerce, we want each user to have a unique bitcoin address.

How to generate those addresses ? Is it possible to generate them without the private key ? We don't want to have the private key anywhere in the code.

How to access all the bitcoins in all those addresses at once ? Is it possible to receive the bitcoins in unique addresses but in the same account ?

Best regards,


Title: Re: What is the best way to generate unique addresses for an ecommerce ?
Post by: mocacinno on November 24, 2017, 09:52:42 AM
Hello,

We want to accept bitcoin on our ecommerce, we want each user to have a unique bitcoin address.

How to generate those addresses ? Is it possible to generate them without the private key ? We don't want to have the private key anywhere in the code.

How to access all the bitcoins in all those addresses at once ? Is it possible to receive the bitcoins in unique addresses but in the same account ?

Best regards,

you could use electrum => create a new HD wallet, then export the xpub and use this xpub to derive new addresses on your ecommerce site.
This way, you can derive as many addresses as you want without the xprv (or any derived private key for that matter) ever touching your server.

If you want extra security, you can generate the electrum wallet on an airgapped machine, or use a hardware wallet (they're HD to)


Title: Re: What is the best way to generate unique addresses for an ecommerce ?
Post by: stripykitteh on November 24, 2017, 10:20:51 AM
Hello,

We want to accept bitcoin on our ecommerce, we want each user to have a unique bitcoin address.

How to generate those addresses ? Is it possible to generate them without the private key ? We don't want to have the private key anywhere in the code.

How to access all the bitcoins in all those addresses at once ? Is it possible to receive the bitcoins in unique addresses but in the same account ?

Best regards,
Have you tried integrating a Vanity address program in the website? That can make custom addresses for the users.


Title: Re: What is the best way to generate unique addresses for an ecommerce ?
Post by: HeRetiK on November 24, 2017, 11:09:50 AM
Hello,

We want to accept bitcoin on our ecommerce, we want each user to have a unique bitcoin address.

How to generate those addresses ? Is it possible to generate them without the private key ? We don't want to have the private key anywhere in the code.

How to access all the bitcoins in all those addresses at once ? Is it possible to receive the bitcoins in unique addresses but in the same account ?

Best regards,


If you already have a node running or plan on running your own node, take a look at BitPay's bitcore npm module (and its related packages):

https://www.npmjs.com/package/bitcore


If you prefer to avoid running your own node and have no security or other concerns about using a third party provider, take a look at blockchain's API:

https://blockchain.info/api/api_receive


In both cases you should be able to use aforementioned xpub key to generate BTC addresses without having to expose the private keys from whatever airgapped device or hardware wallet you are using.