Bitcoin Forum
November 08, 2024, 02:56:58 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Bitcoin qt wallet dump-import PROBLEM !  (Read 124 times)
MeisterDutch (OP)
Newbie
*
Offline Offline

Activity: 4
Merit: 0


View Profile
May 14, 2018, 02:41:59 PM
 #1

Hi folks,

First of all sorry for my grammer mistakes. I am newbie on cryptocurrencies.
I have a bitcoin core desktop wallet and multiple receiving addresses.

I am developing an API for getting payment via Bitcoin. Anyway, When I create a new BTC address in same time I want to backup private key into a DB.

I created an example address  : 3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS (via GetNewAddress method)
And it's private key L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB (dumpprivkey)

When I go to an empty another bitcoin core wallet for import this private key (importprivkey) it creates another bitcoin address (1Mkw8Sa32VZTFyesrubYKSUTEmgVof4okq)
But I was expecting to give me first address (3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS)

Can anybody tells me what is the problem  ?

Thanks
Thirdspace
Hero Member
*****
Offline Offline

Activity: 1232
Merit: 738


Mixing reinvented for your privacy | chipmixer.com


View Profile
May 14, 2018, 11:56:35 PM
 #2

I created an example address  : 3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS (via GetNewAddress method)
And it's private key L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB (dumpprivkey)

When I go to an empty another bitcoin core wallet for import this private key (importprivkey) it creates another bitcoin address (1Mkw8Sa32VZTFyesrubYKSUTEmgVof4okq)
But I was expecting to give me first address (3AzHxHsjQUrJeo61zYXmrJrWNeyHxZ61PS)
what's weirder is that when I tried that privkey on bitaddress.org, I get different legacy address
it gives me 1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX instead, which I think the correct compressed legacy address for that privkey

Quote
Can anybody tells me what is the problem  ?
you created segwit address but you've only just imported a legacy address
after you've imported its legacy address, you can try use addwitnessaddress on that legacy address
change the parameter of addwitnessaddress to whatever legacy address you get after importprivkey
> importprivkey L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB
1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX
> addwitnessaddress 1CwQqU6fekhLCGxqVYLZqqNPJ8M4GzaDMX
null

hugeblack
Legendary
*
Offline Offline

Activity: 2688
Merit: 3969



View Profile WWW
May 15, 2018, 09:41:42 AM
 #3

Can anybody tells me what is the problem  ?
what's weirder is that when I tried that privkey on bitaddress.org, I get different legacy address
I think this is because WIF of bitcoin core.

you can try the following:
go to -----> electrum.org
download electrum for your OS.[1]
open electrum --->  console and type
Code:
p2wpkh-p2sh: L4b7UBiKgM1nr1vn2xdJGupVmg77xKYGi8id7YneDmnopafciDkB

this will generate your Segwit address.
using same way for Bech32 just remove "p2wpkh-p2sh" and use p2wpkh.[2]

Source
[1] [2]https://bitcointalk.org/index.php?topic=3383265.0

█▀▀▀











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











▄▄▄█
▄██████▄▄▄
█████████████▄▄
███████████████
███████████████
███████████████
███████████████
███░░█████████
███▌▐█████████
█████████████
███████████▀
██████████▀
████████▀
▀██▀▀
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!