Bitcoin Forum
November 18, 2024, 03:34:08 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: bitcoin core watch only wallet support new address  (Read 167 times)
ayza_aa (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 09, 2021, 01:26:31 PM
 #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.
BitMaxz
Legendary
*
Offline Offline

Activity: 3444
Merit: 3175


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
June 09, 2021, 02:20:05 PM
 #2

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://bitcointalk.org/index.php?topic=5238258.0

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
June 09, 2021, 02:22:39 PM
 #3

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.

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
ayza_aa (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 10, 2021, 07:00:27 AM
 #4

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://bitcointalk.org/index.php?topic=5238258.0

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?
ayza_aa (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 10, 2021, 07:08:18 AM
 #5

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
ranochigo
Legendary
*
Offline Offline

Activity: 3038
Merit: 4420


Crypto Swap Exchange


View Profile
June 10, 2021, 01:25:47 PM
Merited by ABCbits (2)
 #6

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/

█▀▀▀











█▄▄▄
▀▀▀▀▀▀▀▀▀▀▀
e
▄▄▄▄▄▄▄▄▄▄▄
█████████████
████████████▄███
██▐███████▄█████▀
█████████▄████▀
███▐████▄███▀
████▐██████▀
█████▀█████
███████████▄
████████████▄
██▄█████▀█████▄
▄█████████▀█████▀
███████████▀██▀
████▀█████████
▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
c.h.
▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
▀▀▀█











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
BitMaxz
Legendary
*
Offline Offline

Activity: 3444
Merit: 3175


Playbet.io - Crypto Casino and Sportsbook


View Profile WWW
June 10, 2021, 04:33:19 PM
 #7

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.

███████████████
█████████████████████
██████▄▄███████████████
██████▐████▄▄████████████
██████▐██▀▀▀██▄▄█████████
████████▌█████▀██▄▄██████
██████████████████▌█████
█████████████▀▄██▀▀██████
██████▐██▄▄█▌███████████
██████▐████▀█████████████
██████▀▀███████████████
█████████████████████
███████████████

.... ..Playbet.io..Casino & Sportsbook.....Grab up to  BTC + 800 Free Spins........
████████████████████████████████████████
██████████████████████████████████████████████
██████▄▄████████████████████████████████████████
██████▐████▄▄█████████████████████████████████████
██████▐██▀▀▀██▄▄██████████████████████████████████
████████▌█████▀██▄▄█████▄███▄███▄███▄█████████████
██████████████████▌████▀░░██▌██▄▄▄██████████████
█████████████▀▄██▀▀█████▄░░██▌██▄░░▄▄████▄███████
██████▐██▄▄█▌██████████▀███▀███▀███▀███▀█████████
██████▐████▀██████████████████████████████████████
██████▀▀████████████████████████████████████████
██████████████████████████████████████████████
████████████████████████████████████████
HCP
Legendary
*
Offline Offline

Activity: 2086
Merit: 4361

<insert witty quote here>


View Profile
June 12, 2021, 12:01:37 AM
 #8

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.

█████████████████████████
████▐██▄█████████████████
████▐██████▄▄▄███████████
████▐████▄█████▄▄████████
████▐█████▀▀▀▀▀███▄██████
████▐███▀████████████████
████▐█████████▄█████▌████
████▐██▌█████▀██████▌████
████▐██████████▀████▌████
█████▀███▄█████▄███▀█████
███████▀█████████▀███████
██████████▀███▀██████████
█████████████████████████
.
BC.GAME
▄▄░░░▄▀▀▄████████
▄▄▄
██████████████
█████░░▄▄▄▄████████
▄▄▄▄▄▄▄▄▄██▄██████▄▄▄▄████
▄███▄█▄▄██████████▄████▄████
███████████████████████████▀███
▀████▄██▄██▄░░░░▄████████████
▀▀▀█████▄▄▄███████████▀██
███████████████████▀██
███████████████████▄██
▄███████████████████▄██
█████████████████████▀██
██████████████████████▄
.
..CASINO....SPORTS....RACING..
█░░░░░░█░░░░░░█
▀███▀░░▀███▀░░▀███▀
▀░▀░░░░▀░▀░░░░▀░▀
░░░░░░░░░░░░
▀██████████
░░░░░███░░░░
░░█░░░███▄█░░░
░░██▌░░███░▀░░██▌
░█░██░░███░░░█░██
░█▀▀▀█▌░███░░█▀▀▀█▌
▄█▄░░░██▄███▄█▄░░▄██▄
▄███▄
░░░░▀██▄▀


▄▄████▄▄
▄███▀▀███▄
██████████
▀███▄░▄██▀
▄▄████▄▄░▀█▀▄██▀▄▄████▄▄
▄███▀▀▀████▄▄██▀▄███▀▀███▄
███████▄▄▀▀████▄▄▀▀███████
▀███▄▄███▀░░░▀▀████▄▄▄███▀
▀▀████▀▀████████▀▀████▀▀
ayza_aa (OP)
Newbie
*
Offline Offline

Activity: 9
Merit: 1


View Profile
June 13, 2021, 07:17:26 AM
 #9

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
bob123
Legendary
*
Offline Offline

Activity: 1624
Merit: 2481



View Profile WWW
June 13, 2021, 03:35:52 PM
Merited by LoyceV (4), ABCbits (1)
 #10

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.

Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!