Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: Z0zol3 on August 22, 2015, 04:52:36 PM



Title: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Z0zol3 on August 22, 2015, 04:52:36 PM
Hello everyone,

I'm currently looking for a way to generate a private deposit address for each user.

Do you know any topics or sites explaining the background or even a tutorial how to do it? My own research and possible keywords doesn't look so well... :(


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: unamis76 on August 22, 2015, 04:55:46 PM
Are you trying to run a website for selling goods or similar? Electrum can integrate with a website to do such a thing: generate an address for each payment. There are also wordpress plugins that work the same way, but you have to give those plugins your xpub key.

Otherwise I'm not sure how to handle what you want automatically. As far as I've read, Bitcoin Core is not a good start for a service like this.

Hope this can guide you further in your research...


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Z0zol3 on August 22, 2015, 05:21:07 PM
Are you trying to run a website for selling goods or similar? Electrum can integrate with a website to do such a thing: generate an address for each payment. There are also wordpress plugins that work the same way, but you have to give those plugins your xpub key.

Otherwise I'm not sure how to handle what you want automatically. As far as I've read, Bitcoin Core is not a good start for a service like this.

Hope this can guide you further in your research...

Your answer helped me a lot on this one, Thanks!

I found out there is an API on Coinbase which allows to create, access BTC accounts and transfer it's funds.

More information on https://developers.coinbase.com/api/v2


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: unamis76 on August 22, 2015, 11:07:41 PM
Are you trying to run a website for selling goods or similar? Electrum can integrate with a website to do such a thing: generate an address for each payment. There are also wordpress plugins that work the same way, but you have to give those plugins your xpub key.

Otherwise I'm not sure how to handle what you want automatically. As far as I've read, Bitcoin Core is not a good start for a service like this.

Hope this can guide you further in your research...

Your answer helped me a lot on this one, Thanks!

I found out there is an API on Coinbase which allows to create, access BTC accounts and transfer it's funds.

More information on https://developers.coinbase.com/api/v2

But using an external API raises a new set of problems: the addresses aren't in your control, they're from a Coinbase wallet. On the upside it's probably easier to implement (? not sure, I never really used such a thing).


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Z0zol3 on August 23, 2015, 01:46:51 PM
nice catch!

Still, I will assign a temporary BTC address based on session. Each visitor opens a new session which can be saved to the database. Each deposit request will call a script that creates a new wallet on Coinbase, which will be saved on the database with it's session identifier (and/or user id) and expiration time.
Another script will run every x minutes (probably a cronjob) and requests wallets balance. If user sent some BTC to the wallet, the script adds the difference to users balance.

Thats my point of view. I'll post an update if it works out or not.


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Muhammed Zakir on August 23, 2015, 02:55:26 PM
nice catch!

Still, I will assign a temporary BTC address based on session. Each visitor opens a new session which can be saved to the database. Each deposit request will call a script that creates a new wallet on Coinbase, which will be saved on the database with it's session identifier (and/or user id) and expiration time.
Another script will run every x minutes (probably a cronjob) and requests wallets balance. If user sent some BTC to the wallet, the script adds the difference to users balance.

Thats my point of view. I'll post an update if it works out or not.

Why don't you use Electrum[1]? Its easy and secure. But instead of that, I suggest to export your xpub key and use a tool[2] to generate addresses from it. For WordPress, use Adbussamad's[3] WordPress plugin[4]. What you only need to do is keep your Electrum seed safe, but when you use Coinbase.com API, you will have to trust them for whole work. Its not at all safe to store Bitcoins on an online wallet.


[1] https://electrum.orain.org/wiki/How_to_accept_Bitcoin_on_a_website_using_Electrum
[2] https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Implementations
[3]https://bitcointalk.org/index.php?action=profile;u=85981
[4] https://wordpress.org/plugins/bitcoin-address/


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Kingno.1 on August 25, 2015, 05:47:33 AM
nice catch!

Still, I will assign a temporary BTC address based on session. Each visitor opens a new session which can be saved to the database. Each deposit request will call a script that creates a new wallet on Coinbase, which will be saved on the database with it's session identifier (and/or user id) and expiration time.
Another script will run every x minutes (probably a cronjob) and requests wallets balance. If user sent some BTC to the wallet, the script adds the difference to users balance.

Thats my point of view. I'll post an update if it works out or not.

Why don't you use Electrum[1]? Its easy and secure. But instead of that, I suggest to export your xpub key and use a tool[2] to generate addresses from it. For WordPress, use Adbussamad's[3] WordPress plugin[4]. What you only need to do is keep your Electrum seed safe, but when you use Coinbase.com API, you will have to trust them for whole work. Its not at all safe to store Bitcoins on an online wallet.


[1] https://electrum.orain.org/wiki/How_to_accept_Bitcoin_on_a_website_using_Electrum
[2] https://github.com/bitcoin/bips/blob/master/bip-0032.mediawiki#Implementations
[3]https://bitcointalk.org/index.php?action=profile;u=85981
[4] https://wordpress.org/plugins/bitcoin-address/

coinbase is a very old and trustworthy site, i am using this site for more than 2 yrs and my all deposits are done through my coinbase account , it is fast and secure. For any difficulty or problems they respond within 24 hrs. I will recommend to use coinbase it is safe and secure


Title: Re: [HOWTO] Generating temporary BTC addresses for user deposits?
Post by: Enzyme on August 25, 2015, 06:06:19 AM
I'd use the Electrum method if you're careful with your money, it's in your full control. If you want to take the easy way out, use Coinbase.