Author

Topic: Bitcoin-cli Newbie Quiestions (Read 216 times)

legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
May 09, 2022, 11:00:43 PM
#11
I only took a glimpse on the previous post and I take that you prefer a single-key wallet?

If so, you can create a new "blank wallet" and import a single private key into it (it will derive 3 address types from that single prvKey).
e.g.:
Code:
bitcoin-cli createwallet "regtest_wallet" false true "passphrase1234" false false true
Code:
bitcoin-cli importprivkey cTLcqn963JQAwXa1jw7Di5cEZLquebgmWQLA3W28MzMB3pcF3txa
That way, it will neither create new addresses nor change addresses.
However, you wont be able to use sendtoaddress since it requires a change address,
you'll have to manually create the raw transaction using createrawtransaction which involves precise computation from inputs' to outputs' amounts
and manual selection of inputs.

References for the commands:

Can I modify the change address settings so it doesn't fragment my coins from bitcoin-cli. ?
Take note that receiving multiple transactions and change through a single address don't automatically consolidate all those coins.
Those will still generate separate UTXO per transaction.
newbie
Activity: 6
Merit: 12
May 09, 2022, 06:05:58 PM
#10
Thanks for the tip about the change addresses.
Im using bitcoin core full node with bitcoin-cli its running from my server which has no screen.

Can I modify the change address settings so it doesn't fragment my coins from bitcoin-cli. ?


legendary
Activity: 2380
Merit: 5213
May 09, 2022, 07:04:35 AM
#9
Cant I just make a wallet. Create an address and then let it be well known that this is where you send bitcoin to pay me ?
You can.


Am I supposed to create a new address for every new person who wants to pay me ?
You don't have to create a new address.
You can give the same address to everyone you want.


If I want to buy coins on an exchange to top up my wallet am I supposed to create a new address for receiving and then go through the drama of white listing
that address every single time ?
No.
You can use the same address numerous times.


Using a new address is optional and you don't have to that.
Note that with using a same address multiple times, you may hurt your privacy.
The person who knows your address can track your previous transactions and know your bitcoin balance.

Using a change address is also for your privacy. In the case your sending address is used as your change address, everyone can know that which of the outputs is owned by the recipient and which one is your own address.

Anyways, if you want the remaining amount of your coins is sent back to the sending address, go to "Settings" and then to "Wallet" tab. Check "Enable coin control features". Check "Custom change address" when making a transaction and enter the address you are sending bitcoin from.
newbie
Activity: 6
Merit: 12
May 09, 2022, 06:33:20 AM
#8
Now Im really confused.

Why is it a terrible Idea to create a wallet and use it for my business ?.

If I was worried about privacy id use Monero.

Cant I just make a wallet. Create an address and then let it be well known that this is where you send bitcoin to pay me ?
And then pay my out goings out of that same wallet.

A bit like having a bank account ?

Am I supposed to create a new address for every new person who wants to pay me ?

If I want to buy coins on an exchange to top up my wallet am I supposed to create a new address for receiving and then go through the drama of white listing
that address every single time ?

Also,

It sounds like if I want to put some bitcoin away for later I need to create a new wallet, create an address, send coins to the address, export the private key and then delete the wallet.dat file. Thats the only way I can be sure that my coins will stay at the new address and I can access them later with the private key ?

legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
May 06, 2022, 08:46:48 AM
#7

Quote
I plan to use the wallet for my business.
~
The problem here is that my main wallet address will be doing lots of sending and receiving every day.
That's terrible for several reasons. Of the top of my head:
  • Any of your customers see exactly how much Bitcoin you earned
  • Someone can find out that someone has been a customer at your business
  • You'll have a hard time keeping track of who paid what amount

While we are on that topic, I recommend to OP for him to create a separate wallet just for this purpose, and then link it up to self-hosted BTCPayServer running inside a Docker container. (they provide scripts to deploy that in 1 click).
legendary
Activity: 3290
Merit: 16489
Thick-Skinned Gang Leader and Golden Feather 2021
May 06, 2022, 06:20:01 AM
#6
I want to have full control of my bitcoin so I install bitcoin-cli
Why bitcoin-cli, and not bitcoin-qt? A graphical interface makes it much easier to use. Coin control is also much easier if you can just click to select the inputs.

It looks like if I want to put some bitcoin aside for later I can make a new address send the coins there, export the private
and hide it somewhere safe. As long as I don't try any send coins from that address and just leave it alone they will all stay where they are and I can get access to them later with the private key no wallet.day needed. Is this correct ?
Well, yes. But: you can still access them from bitcoin-cli, so if you don't pay attention, they might be used as inputs when you make a new transaction.

Quote
I plan to use the wallet for my business.
~
The problem here is that my main wallet address will be doing lots of sending and receiving every day.
That's terrible for several reasons. Of the top of my head:
  • Any of your customers see exactly how much Bitcoin you earned
  • Someone can find out that someone has been a customer at your business
  • You'll have a hard time keeping track of who paid what amount

Quote
It seems that bitcoin core creates lots of extra "change" addresses and fragments the balance across many addresses.
That's how the Bitcoin blockchain works Smiley Even if you use the same address for all your transactions, you'll still end up with separate inputs.

Quote
So in this case I must create a cronjob that backs up the whole wallet.dat file as often as possible and sends it to a safe place. I read that the wallet.dat has 100 spare address and creates 100 more when it runs out ?.
I think it's increased to 1000 addresses, but if you use a HD wallet (which is the default nowadays), one backup is enough to restore all addresses. Note that this won't restore address labels.
You may want to read my topic on fees, especially if you expect many separate transactions in the future.

Quote
I could use some other companies wallet service and pay. Companies typically give you a seed phrase to remember when you create your new wallet with them.All advice appreciated.
I wouldn't want any seed phrase to be created by a third party.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
May 06, 2022, 06:10:44 AM
#5
It looks like if I want to put some bitcoin aside for later I can make a new address send the coins there, export the private
and hide it somewhere safe. As long as I don't try any send coins from that address and just leave it alone they will all stay where
they are and I can get access to them later with the private key no wallet.day needed. Is this correct ?
Yes.
The problem here is that my main wallet address will be doing lots of sending and receiving every day. It seems that bitcoin core creates lots of extra
"change" addresses and fragments the balance across many addresses. So in this case I must create a cronjob that backs up the whole wallet.dat file as often as possible and sends it to a safe place. I read that the wallet.dat has 100 spare address and creates 100 more when it runs out ?.
This means that if the wallet was hit with a lot of transactions between backups and the server died coins may be lost forever. Is this correct ?

Is the solution to this issue just a very high frequency of wallet.dat backups ?
Not necessarily. Older version of Bitcoin Core (Years ago) requires a backup every 100 transactions because the hidden keypool that is in the wallet.dat is that size. However, newer versions of Bitcoin Core are Hierarchical Deterministic or HD wallets for short. This means that there is a seed that can be used to generate as many addresses as you want without the need for multiple backups.

So long as your wallet is created in a hierarchical deterministic format, you do not need to create additional backups, granted that the passphrase to the wallet.dat is not changed after the backup.
Also, Instead for managing the wallet myself I could use some other companies wallet service and pay. Companies typically give you a seed phrase to remember when you create your new wallet with them. I am assuming the phrase is only useful to restore my wallet via their website. If for example one day that company and all its servers vanished there would be no way to recover my coins with their seed phrase ? Is this true ?
This is dependent on what sort of wallet you're using. Most wallets uses a specific format that can easily be replicated. This ensures that the addresses are still recoverable in the event that the site is inaccessible for whatever reason.

This has the same concept as a Bitcoin Core operating in HD-mode. If you prefer a mnemonic instead of a wallet.dat, you can choose to use Electrum instead.
newbie
Activity: 6
Merit: 12
May 06, 2022, 06:00:11 AM
#4
Ok,

I forgot to mention I made a couple of transfers out of the wallet.
It looks like this is what caused the balance to be spread across multiple "change" addresses.

So Im still trying to understand exactly how bitcoin-core works.

Its important Im completely on top of this because I plan to use the wallet for my business.

It looks like if I want to put some bitcoin aside for later I can make a new address send the coins there, export the private
and hide it somewhere safe. As long as I don't try any send coins from that address and just leave it alone they will all stay where
they are and I can get access to them later with the private key no wallet.day needed. Is this correct ?

The problem here is that my main wallet address will be doing lots of sending and receiving every day. It seems that bitcoin core creates lots of extra
"change" addresses and fragments the balance across many addresses. So in this case I must create a cronjob that backs up the whole wallet.dat file as often as possible and sends it to a safe place. I read that the wallet.dat has 100 spare address and creates 100 more when it runs out ?.
This means that if the wallet was hit with a lot of transactions between backups and the server died coins may be lost forever. Is this correct ?

Is the solution to this issue just a very high frequency of wallet.dat backups ?

Also, Instead for managing the wallet myself I could use some other companies wallet service and pay. Companies typically give you a seed phrase to remember when you create your new wallet with them. I am assuming the phrase is only useful to restore my wallet via their website. If for example one day that company and all its servers vanished there would be no way to recover my coins with their seed phrase ? Is this true ?

All advice appreciated.
legendary
Activity: 1568
Merit: 6660
bitcoincleanup.com / bitmixlist.org
May 05, 2022, 08:16:46 AM
#3
~
Then I take my new address and put it into a blockchain explorer. It shows a much lower balance than getbalance.

Now Im very confused and worried.

I type bitcoin-cli listaddressgroupings

It shows 4 addresses only one of which I created. My coins are all there but spread between the addresses.

Now Im really worried. Looks like I dont understand how this thing works.
In my mind I expect that if I send all my coins to an address they would arrive there I didn;t ask to have them spread across different addresses.

Can the private key that I dumped from the original address be used to recover %100 of the coins or only the ones located on that address.

When you send a transaction with Bitcoin Core (cli or gui), it returns the change to a different address that is generated for that purpose, that's what listaddressgroupings is showing you.

Also you can only export a file from Bitcoin core that has private keys in it, mneumonic phrases are not supported.

There is a master private key inside the wallet file which if encoded with words would serve as some kind of seed phrase, but there  isn't really a way to insert this back into Bitcoin Core without the wallet file.
legendary
Activity: 2380
Merit: 5213
May 05, 2022, 07:20:46 AM
#2
Due to privacy reasons, bitcoin core allows you to have multiple addresses.
If you see 4 funded addresses when using listaddressgroupings command, it means that you have sent bitcoin to 4 different addresses.  


In my mind I expect that if I send all my coins to an address they would arrive there I didn;t ask to have them spread across different addresses.
Bitcoin core doesn't make any transaction automatically.
My guess is that you copied the address from bitcoin core every time you wanted to send bitcoin and didn't notice that it's a new address.


Can the private key that I dumped from the original address be used to recover %100 of the coins or only the ones located on that address.
No. You need a new private key for each of new addresses.
Note that the wallet.dat file contains all your private keys. If you have stored that file somewhere securely, you don't need to keep individual private keys.


Ive been using the full node  monero wallet recently and its great. As long as I write down my seed phrase I can sleep at night. My coins are protected.
If you want to have a seed phrase, you shouldn't use bitcoin core.


Edit:
As stated by NotATether below, there's also the possibility that the new generated address are your change addresses.
Since you didn't say anything about making any transaction using bitcoin core, I'm assumed that you have never made any transaction with your wallet.
newbie
Activity: 6
Merit: 12
May 05, 2022, 05:02:50 AM
#1
I want to have full control of my bitcoin so I install bitcoin-cli and wait a couple of days for it to sync

I create a new wallet address.

Then I use bitcoin-cli dumpprivkey "MYNEWADDRESS" to dump the private key and make a copy of it.

My understanding is that now any coins that I send to that address can be recovered with that key if my computer blows up.

I log onto a couple of exchanges and buy some bitcoin and send it to my new address.

bitcoin-cli getbalance reveals that it is all there.

so far so good.

Then I take my new address and put it into a blockchain explorer. It shows a much lower balance than getbalance.

Now Im very confused and worried.

I type bitcoin-cli listaddressgroupings

It shows 4 addresses only one of which I created. My coins are all there but spread between the addresses.

Now Im really worried. Looks like I dont understand how this thing works.
In my mind I expect that if I send all my coins to an address they would arrive there I didn;t ask to have them spread across different addresses.

Can the private key that I dumped from the original address be used to recover %100 of the coins or only the ones located on that address.

Can someone please explain to me whats going on ?
How can I backup my coins.

Ive been using the full node  monero wallet recently and its great. As long as I write down my seed phrase I can sleep at night. My coins are protected.
What is the Bitcoin core equivalent of this ?



Jump to: