I am new to block-chain, so please bear with my questions. I need to understand the basics of a bitcoin-wallet.
So I have setup a bitcoin full node using bitcoind in running in testnet mode. As I understand that by default a wallet is created. Now when I am trying to get the address of the wallet by this command bitcoin-cli -testnet getaccount ""
, I am geeting an empty list.
So is there no default wallet as such, also how do I create a new wallet? As I understand that a bitcoin wallet is basically a pot which holds several child addresses?
1 Answer
getaccount
command was deprecated in Bitcoin Core 0.18, the wallet uses "labels" now.
When the wallet was created, it created a seed for you. This is used to generate the addresses in a BIP32 heirarchy. To generate the first address, you can use the getnewaddress
command, followed by an optional label (to save the address in the address book), and an optional address type. E.g.
$ bitcoin-cli -testnet getnewaddress my_first_address
As I understand that a bitcoin wallet is basically a pot which holds several child addresses?
A Bitcoin wallet is generally considered software that manages your Bitcoin addresses and transactions, as well as your private keys to those addresses. In Bitcoin Core it is also used to describe a heirarchy of addresses with their own unique seed. Addresses used within a "wallet" on Bitcoin core are all derived from the same master key and seed. In fact you can have multiple wallets using the same installation of Bitcoin core, see createwallet