bitcoind deamon create new account for every user

1

I'm new to this bitcoin and seems confused a little.

I need a system where I need to create new address for every user(personal account) where they will transfer some bitcoins to it and buy some products from my website.

So, I've started bitcoind and through bitcoin-cli, I've generated new address(getnewaddress) and send some bitcoins to it.

But on the transactions screen, it shows payment to yourself and the balance of the account doesn't change.

Can anyone, please help me how to create a new individual account address for every user and make the transactions. It should have a password or a private key also for security.

NPM Package I used : https://www.npmjs.com/package/bitcoin-core

RealSteel

Posted 2017-09-28T09:36:32.403

Reputation: 169

Answers

2

Bitcoin-Core can manage different 'accounts'. You can can create a new account by using 'getnewaddress':

bitcoin-cli getnewaddress "accountname"

If the account name exists, the address will be added to that account, otherwise it will create a new account with that name. You can see what accounts you have by using 'listaccounts'

For other options see: https://en.bitcoin.it/wiki/Original_Bitcoin_client/API_calls_list

Note that these accounts are still considered part of a same "wallet", as it they belong to the same user.

If you want to separate them completely, you can run different instances by using different data folders. Use the '-datadir=/path/to/data' option when running bitcoin (and again everytime you use 'bitcoin-cli') to tell bitcoin which "account" it has to use.

E.g.:

bitcoind -datadir=/home/user/btc1/ -daemon
bitcoind -datadir=/home/user/btc2/ -daemon
bitcoin-cli -datadir=/home/user/btc1/ sendtoaddress <address-of-btc2> <amount>

Note that you can also use different configurations by placing different bitcoin.conf files inside each data folder.

FedFranzoni

Posted 2017-09-28T09:36:32.403

Reputation: 490

Completely removed from bitcoin now...scott 2018-03-02T15:40:38.393

2Please be more specific. What has been removed?FedFranzoni 2018-03-06T11:35:15.190

2

Listaccounts is deprecated and will be removed in V0.18. To use this command, start bitcoind with -deprecatedrpc=accounts. (code -32)

Minherc

Posted 2017-09-28T09:36:32.403

Reputation: 21