Author

Topic: Merging two encrypted wallet.dat files (Read 364 times)

member
Activity: 84
Merit: 22
May 03, 2020, 11:30:11 PM
#11
-snip-
You're sweeping the funds from one wallet file to another. OP wants to merge two of his wallet.dat such that the addresses from both wallet.dat is in one wallet.dat only.


-snip-
You're sweeping the funds from one wallet file to another. OP wants to merge two of his wallet.dat such that the addresses from both wallet.dat is in one wallet.dat only.



Hmmmm.


Try this:

Re-run bitcoind/Bitcoin-Qt, giving the -wallet=/path/to/wallet option.
dumpwallet the private keys to a file
Shutdown.
concatenate the files together.
Re-run and importwallet the combined file.
legendary
Activity: 3038
Merit: 4418
Crypto Swap Exchange
-snip-
You're sweeping the funds from one wallet file to another. OP wants to merge two of his wallet.dat such that the addresses from both wallet.dat is in one wallet.dat only.
member
Activity: 84
Merit: 22
Yes, its possible.


bitcoin-cli createwallet "testwallet"

This should make a folder called "testwallet" in your bitcoin dir

delete the wallet.dat file there and upload your encrypted wallet.dat file there

to spend funds from what wallet.dat file you do this

bitcoin-cli loadwallet testwallet

bitcoin-cli -rpcwallet=testwallet sendtoaddress (address) (amount)

Easy as that, repeat step 1 as many times as you like with as many wallet.dat files.


Learn more here: https://bitcoincore.org/en/doc/0.17.0/rpc/wallet/createwallet/

Good luck PM me if you need any help.
member
Activity: 378
Merit: 53
Telegram @keychainX
April 25, 2020, 07:00:23 PM
#8
I have a technical question.

A wallet is protected by a password, which encrypts the key.

Is it possible to "merge" two encrypted wallets into one and have a completely new database, if they are encrypted with the same password?

Is there any paper on how the encryption works?

No you cannot, as there is no wallet that can have multiple passwords for different private keys.

All wallets even those with imported keys share the same password, therefor render it impossible to "merge" two different wallets with different passwords into one.

If you need info on password encryption for bitcoin core you could always dive in here; (google AES-256-CBC and SHA-512)

https://en.bitcoin.it/wiki/Wallet_encryption

/KX
HCP
legendary
Activity: 2086
Merit: 4363
April 16, 2020, 06:08:15 PM
#7
I have a technical question.

A wallet is protected by a password, which encrypts the key.

Is it possible to "merge" two encrypted wallets into one and have a completely new database, if they are encrypted with the same password?

Is there any paper on how the encryption works?
Which wallet application are you referring to? Huh As not all wallets use the same encryption methods/standards. Are both wallets from the same app?

I suspect this is an "XY problem. What are you actually wanting to achieve by merging two wallets together? Huh What is your specific scenario/reason for wanting to "merge" 2 wallets? Huh
legendary
Activity: 2618
Merit: 6452
Self-proclaimed Genius
April 16, 2020, 02:32:13 AM
#6
You'd lose HD wallet feature, which force you to backup wallet.dat file regularly. OP apparently trying to merge multiple wallet.dat without losing any features or advantage each wallet.dat have.
He will only need to backup once after he imported the keys or dumpwallet file.
After that, the 'new backup' can still generate the new/future addresses/keys as long as the hdseed is the same.
Old backups however wont contain the imported prv keys.

I don't know if this helps, but you can:
export the private keys from both wallets
Better use dumpwallet on wallet1, then importwallet the dump file to wallet2.
That's doable within a minute if you're fast, minus the rescan.
newbie
Activity: 15
Merit: 2
April 14, 2020, 11:39:31 AM
#5
I don't know if this helps, but you can:
export the private keys from both wallets
then create a new wallet
import both private keys into the new wallet
your new wallet will have all the addresses of the two old wallets
jr. member
Activity: 54
Merit: 11
April 12, 2020, 08:43:45 AM
#4
I have a technical question.

A wallet is protected by a password, which encrypts the key.

Is it possible to "merge" two encrypted wallets into one and have a completely new database, if they are encrypted with the same password?

Is there any paper on how the encryption works?

First you would need to know if the DB is same version, otherwise you would need to convert it yourself.

This is possible in blockchain.com wallets (to have multiple xpriv) but as someone said above, it would probably mean you would break backward compatibility and would have your own custom bitcoin core version not readable by other versions.
legendary
Activity: 3472
Merit: 10611
April 12, 2020, 04:32:00 AM
#3
what is it exactly that you are trying to do? there is a good chance that there is a more logical and better way of achieving that. for instance wallets usually support "importing" keys which is the option you should use if you want to "merge" another wallet into a wallet you have if the software allowed that. but a still better way is to  "sweep" the keys into the wallet that you have which means sending the coins from the secondary wallet keys to the primary wallet.
legendary
Activity: 3122
Merit: 2178
Playgram - The Telegram Casino
April 12, 2020, 03:42:52 AM
#2
I have a technical question.

A wallet is protected by a password, which encrypts the key.

Is it possible to "merge" two encrypted wallets into one and have a completely new database, if they are encrypted with the same password?

Is there any paper on how the encryption works?

Two different encrypted wallets will be encrypted using two different keys, even if they have the same password. As you mentioned yourself, the key is encrypted using the password. Accordingly the wallet itself is not encrypted using the password but the randomly generated key that is encrypted using said password.

Bitcoin Core's wallet.dat uses standard ciphers and hashing algorithms. See here for reference:
https://en.bitcoin.it/wiki/Wallet_encryption

Information on AES-256 and SHA-512 itself is widely available. It is not possible to "merge" AES-256 encrypted data without decrypting it first, even if they are encrypted using the same key.



newbie
Activity: 13
Merit: 1
April 12, 2020, 02:55:23 AM
#1
I have a technical question.

A wallet is protected by a password, which encrypts the key.

Is it possible to "merge" two encrypted wallets into one and have a completely new database, if they are encrypted with the same password?

Is there any paper on how the encryption works?
Jump to: