Author

Topic: bitcoin core watch only wallet support new address (Read 147 times)

legendary
Activity: 1624
Merit: 2481
i want create an exchange site, and user coin deposit save in a cold wallet with a lot of HD wallet slot

No offense.. but you definitely swhouldn't do this.

Your post has shown that you don't have the technical knowledge to build a secure service.
And if you don't have the necessary starting capital (we are talking about way more than just a few 10k $ ..), then you should refrain from doing so.

You seem to not understand the very basics. So, how can you set up a sever securely then? How do you want to protect against malicious user? Why should anyone trust your ability to build a secure platform if you need to ask how cold storage works?


Building an exchange is not as easy as you think. And definitely not as cheap as you might believe.

Believe me, you don't want to do that.
newbie
Activity: 9
Merit: 1
hi, my purpose is: have a cold wallet as a watch-only wallet, and generate a new address from it, for users' deposits.
for security issues, I want the cold wallet to be a watch-only wallet without any private keys


This is what you made yourself confused about, there is no watch only for cold wallet/storage.

If you want to have a watch-only wallet you must connect your pc to the internet and import the master public key generated from the cold wallet.

I just want to know what do you want to achieve because you said it's "users' deposits" are you planning to create an online wallet?
Or are you planning to make a payment gateway?

If it's a payment gateway there is an easy way to make a payment gateway from your site.

i want create an exchange site, and user coin deposit save in a cold wallet with a lot of HD wallet slot
HCP
legendary
Activity: 2086
Merit: 4314
I agree that OP seems a little confused as to how online/offline airgapped cold storage works.

As advised you need two separate systems... one completely offline system that holds the wallet containing private keys... and an online copy of that wallet that contains no private keys that acts as the watch-only wallet.


Generate your cold storage wallet as per usual, with createwallet. Afterwards;

Code:
bitcoin-cli getdescriptorinfo

You'll get a string and that is your descriptor.
No, you won't get a string... you need to pass that command an input descriptor string and it analyses it, returning the checksum etc.


Unfortunately, because Bitcoin Core uses hardened key derivation all the way down (ie. m/0'/0'/i') you cannot easily create a watching only version of a "normal" Bitcoin Core wallet.

For instance, if you create a "normal" wallet... and then dump it, you'll get the extended master private key like this:
Code:
# Wallet dump created by Bitcoin v0.21.0
# * Created on 2021-06-11T23:47:06Z
# * Best block at time of backup was 8685 (000000008820476d20779d81d2ed114aa22577b61e1e40e299d91bf70988cef2),
#   mined on 2009-03-25T20:59:48Z

# extended private masterkey: xprv9s21ZrQH143K3mF25T1KpmGiojVWQ4N6zzJaxk9yLaWmVdWmwJtueBJruUkhX26Sme6es9kZfavLwFAugb8q7DxS5Wd32NAQfUo8QBfoiqA

L4ouTnsZvT6NJvi7HSseBd1vuDxxTTtoF4nKiWyN7dCpNAgGs5SY 2021-06-11T23:46:08Z reserve=1 # addr=bc1qqy2hj4q3upyc8znszwwukpndslpv9ctukses8q hdkeypath=m/0'/0'/488'
Kx1BkDVKwzNTeMH8ix1nUsKM3MMqQ69XK4ho4HEzRpZ65no4g1zF 2021-06-11T23:46:08Z reserve=1 # addr=bc1qqyt779387eqr2cxwy5gnedtdc4m48k7svma8gs hdkeypath=m/0'/0'/441'
KzmKmp4yU2Q3xoAKECnkxaz67WcTJAeYowbCp35PrFvJ3MKaLM2Y 2021-06-11T23:46:08Z reserve=1 # addr=bc1qqy5dxals4w9t8vjwr8vslzpf6sajaq0d4y8qec hdkeypath=m/0'/0'/51'

But as you can see, the hdkeypaths are all hardened all the way down to the index level Sad So, it is impossible to use xpub that will generate these addresses.

Instead, you would need to create a descriptor wallet that imports an xprv using at least 1 level of unhardened children (ie. m/i or m/0'/0'/i etc)... then you could use the matching extended xpub to create the watching only wallet.
legendary
Activity: 3206
Merit: 2904
Block halving is coming.
hi, my purpose is: have a cold wallet as a watch-only wallet, and generate a new address from it, for users' deposits.
for security issues, I want the cold wallet to be a watch-only wallet without any private keys


This is what you made yourself confused about, there is no watch only for cold wallet/storage.

If you want to have a watch-only wallet you must connect your pc to the internet and import the master public key generated from the cold wallet.

I just want to know what do you want to achieve because you said it's "users' deposits" are you planning to create an online wallet?
Or are you planning to make a payment gateway?

If it's a payment gateway there is an easy way to make a payment gateway from your site.
legendary
Activity: 2898
Merit: 3937
hi, my purpose is: I have a cold wallet as a watch-only wallet, and generate a new address from it, for users' deposits.
for security issues, I want the cold wallet to be a watch-only wallet without any private keys
Your cold wallet should contain the private keys, or else you won't be able to generate any addresses in the first place.

Generate your cold storage wallet as per usual, with createwallet. Afterwards;

Code:
bitcoin-cli getdescriptorinfo

You'll get a string and that is your descriptor.

If you want a watch-only wallet, it has to be online, there is no point keeping it offline. You have to generate a descriptorwallet first;
Code:
bitcoin-cli createwallet -named createwallet wallet_name="mywallet" descriptors=true

Afterwards, import your descriptor through this, check the syntax here[1].

[1] https://bitcoincore.org/en/doc/0.21.0/rpc/wallet/importdescriptors/
newbie
Activity: 9
Merit: 1
By putting the argument for disabling private keys as true, the wallet cannot create any private keys as a seed is not generated for that wallet. If you need a wallet that is able to generate a wallet, you should generate a wallet without specifying true for either of the options, ie. Just the wallet name will do.

If you generate a blank wallet, you can import your own seeds for Bitcoin Core to generate or import your addresses individually.

hi, my purpose is: I have a cold wallet as a watch-only wallet, and generate a new address from it, for users' deposits.
for security issues, I want the cold wallet to be a watch-only wallet without any private keys
newbie
Activity: 9
Merit: 1
It looks like that you are confused about RPC and watch-only wallet?

Are you planning to generate a new testnet address through command?

There is a thread here that I think you can follow on how to generate a new address through testnet.

Check this thread https://bitcointalksearch.org/topic/how-to-use-rpcwallet-5238258

my goal is: I have a cold wallet as a watch-only wallet, and generate a new address from it, for users' deposits. do you have any suggestions?
legendary
Activity: 2898
Merit: 3937
By putting the argument for disable private keys as true, the wallet cannot create any private keys as a seed is not generated for that wallet. If you need a wallet that is able to generate a wallet, you should generate a wallet without specifying true for either of the options, ie. Just the wallet name will do.

If you generate a blank wallet, you can import your own seeds for Bitcoin Core to generate or import your addresses individually.
legendary
Activity: 3206
Merit: 2904
Block halving is coming.
It looks like that you are confused about RPC and watch-only wallet?

Are you planning to generate a new testnet address through command?

There is a thread here that I think you can follow on how to generate a new address through testnet.

Check this thread https://bitcointalksearch.org/topic/how-to-use-rpcwallet-5238258
newbie
Activity: 9
Merit: 1
hi guys, I am a new developer in crypto.  Smiley

i installed bitcoind and bitcoin-cli, so create watch only wallet by the below command:
bitcoin-cli -testnet createwallet testwallet true
so my testwallet has no private key, then i expect generate a new HD address with this command:
bitcoin-cli -testnet -rpcwallet=testwallet getnewaddress
but got this error:
error code: -4
error message:
Error: This wallet has no available keys

please help me, i want create my cold wallet that has a lot of slot to receive money without private key.
Jump to: