Create a new receiving address in the behalf of another wallet?

2

I want to create an API service that will trigger my local wallet to generate new account with receive address and return that address to a user.

User => API => my_local_wallet => API => User

The user will have this address and will be able to transfer Bitcoins into that address.

Dor Bar

Posted 2018-11-19T15:38:49.910

Reputation: 81

Answers

1

Yes, you can use bitcoin-cli for address generation.

To learn more try:

bitcoin-cli help getnewaddress

Also consider using some RESTful service running on your Bitcoind host.

For Node I can recommend https://www.npmjs.com/package/bitcoin-core

Boris Ivanov

Posted 2018-11-19T15:38:49.910

Reputation: 111

In order to keep my wallet anonymous I would want to create new account addresses.Dor Bar 2018-11-19T21:25:49.087

yes that command exactly does itBoris Ivanov 2018-11-20T09:23:18.430

But how should I attach the new address with any wallet on the network?

My wallet is on my computer and the API is on a remote server.

What I expect the API to do is to have the account address of my local wallet and assign the new Receiving-Address generated by the API to my wallet address.

Can I do that? – Dor Bar 2018-11-21T10:53:56.743

I guess its standard scenario: U have webservice which sell Pizza.

  1. User ordering Pizza which cost 1BTC. 2. API make notice they need new address. 3. Ur PC generates new address. 4. API takes this address and ask user to pay. 5. User pays. 6. Ur PC periodically checks ur accout to see incoming transaction on that particular address to 1BTC. 7 If in X minutes 1BTC coming Ur PC notify Ur API that "Transaction passed". 8. You notify Ur chef to start cooking Pizza
  2. < – Boris Ivanov 2018-11-21T13:48:00.827

Between 2 and 3 there is so ting going on. Should be another peace of software that will trigger my wallet to create this new address automatically.Dor Bar 2018-11-25T10:05:46.380

Step 3 is calling bitcoin-cli getnewaddress to generate new bitcoin addressBoris Ivanov 2018-11-26T10:22:40.510

Who is running this command?Dor Bar 2018-11-26T11:17:51.167