Bitcoin Forum

Bitcoin => Development & Technical Discussion => Topic started by: tradopt on November 28, 2022, 04:12:39 PM



Title: website development
Post by: tradopt on November 28, 2022, 04:12:39 PM
How do we generate the bitcoin address for every user, those who uses our website  ,and can withdraw deposit ?


Title: Re: website development
Post by: CounterEntropy on November 28, 2022, 04:50:01 PM
How do we generate the bitcoin address for every user, those who uses our website  ,and can withdraw deposit ?

Ideally you should run your own Bitcoin Node and query using JSON-RPC.

For example, get new address using - https://bitcoincore.org/en/doc/22.0.0/rpc/wallet/getnewaddress/.

But, if you are not pro, you may use third party API and query using cURL.

For example, you may use this API - https://www.blockchain.com/explorer/api/api_receive.


Title: Re: website development
Post by: seoincorporation on November 28, 2022, 06:05:39 PM
How do we generate the bitcoin address for every user, those who uses our website 

Generating a new address for our site should be a backend process. Let me explain how it should be done.

1.-User input his Username, Mail and Password to create the account.
2.-The data is sent to the backend.
3.-The data is verified in the backend to see if its valid before write it in the DB
4.-If the data is valid, then call your bitcoin node with RCP to get the new address and send that info to the users array.
5.-Write In the data base: ID, Username, Password(encripted), mail, balance, address...

Then each time the user request the address you can fill that input with a SQL call.

and can withdraw deposit ?

For withdrawals:

1.-User input the withdrawal amount and the address.
2.-The data is sent to the backend
3.-Data verification (If the balance is enough if the sending address is valid...)
4.-Send the transaction with RPC calls.
5.-Update the Data Base with the new balance, and record the withdrawal transaction on a new table.

Since you are talking about website development i would like to recommend NodeJS for a crypto application as a backend.


Title: Re: website development
Post by: bitmover on November 29, 2022, 08:29:54 PM
How do we generate the bitcoin address for every user, those who uses our website  ,and can withdraw deposit ?

2 member already explain the general idea, although using Bitcoin Core isn't the only option to manage user's coin. But if you ask such question, IMO you should hire someone who already have experience to create cryptocurrency-related service.

It is a good idea to hire some  to professionally manage the job.

Additionally,  I will suggest that you work with btcpayserver.org,  which is an open source and free software which will manage all payments for you.

It will generate address for each buys, monitored them, etc  it has an extensive documentation and really looks like a professional solution.