Skip to main content
added 102 characters in body
Source Link
Pieter Wuille
  • 109.7k
  • 9
  • 202
  • 318

Every address has its own private key; if you inport one key, you get access to that one address. You

If your goal is backing up an entire wallet, you should instead be using the dumpwallet and associated importwallet RPC, which produce a human-readable file with all key material in. In theory, you could dump them all keys with dumpprivkey, but unless you really know what you're doing, this will likely not give you what you'd think of as a wallet backup. Newly generated addresses won't be reflected in your backup, and any time you send out funds, the change outputs will be sent to internal change addresses which you won't have backups for.

If your goal is backing up an entire wallet, you should instead be using the dumpwallet and associated(they're separate from addresses produced by importwalletgetnewaddress RPC, which produce a human-readable file with all key material in). 

Alternatively, you can use backupwallet which produces a copy of the wallet file itself, which in addition to the above also includes address label information and transaction history.

Lastly, all these individual key-based approaches are unique to the legacy wallet format. In the more modern descriptor based format, there is no way to export individual keys anymore. Instead, you'd use listdescriptors and importdescriptors there, which describe the entire set of addresses controlled by the wallet at once, probably much more in line of how you'd expect exports to work.

Every address has its own private key; if you inport one key, you get access to that one address. You could dump them all, but unless you really know what you're doing, this will likely not give you what you'd think of as a wallet backup. Newly generated addresses won't be reflected in your backup, and any time you send out funds, the change outputs will be sent to internal change addresses you won't have backups for.

If your goal is backing up an entire wallet, you should instead be using the dumpwallet and associated importwallet RPC, which produce a human-readable file with all key material in. Alternatively, you can use backupwallet which produces a copy of the wallet file itself, which in addition to the above also includes address label information and transaction history.

Lastly, all these individual key-based approaches are unique to the legacy wallet format. In the more modern descriptor based format, there is no way to export individual keys anymore. Instead, you'd use listdescriptors and importdescriptors there, which describe the entire set of addresses controlled by the wallet at once, probably much more in line of how you'd expect exports to work.

Every address has its own private key; if you inport one key, you get access to that one address.

If your goal is backing up an entire wallet, you should instead be using the dumpwallet and associated importwallet RPC, which produce a human-readable file with all key material in. In theory, you could dump all keys with dumpprivkey, but unless you really know what you're doing, this will likely not give you what you'd think of as a wallet backup. Newly generated addresses won't be reflected in your backup, and any time you send out funds, the change outputs will be sent to internal change addresses which you won't have backups for (they're separate from addresses produced by getnewaddress). 

Alternatively, you can use backupwallet which produces a copy of the wallet file itself, which in addition to the above also includes address label information and transaction history.

Lastly, all these individual key-based approaches are unique to the legacy wallet format. In the more modern descriptor based format, there is no way to export individual keys anymore. Instead, you'd use listdescriptors and importdescriptors there, which describe the entire set of addresses controlled by the wallet at once, probably much more in line of how you'd expect exports to work.

Source Link
Pieter Wuille
  • 109.7k
  • 9
  • 202
  • 318

Every address has its own private key; if you inport one key, you get access to that one address. You could dump them all, but unless you really know what you're doing, this will likely not give you what you'd think of as a wallet backup. Newly generated addresses won't be reflected in your backup, and any time you send out funds, the change outputs will be sent to internal change addresses you won't have backups for.

If your goal is backing up an entire wallet, you should instead be using the dumpwallet and associated importwallet RPC, which produce a human-readable file with all key material in. Alternatively, you can use backupwallet which produces a copy of the wallet file itself, which in addition to the above also includes address label information and transaction history.

Lastly, all these individual key-based approaches are unique to the legacy wallet format. In the more modern descriptor based format, there is no way to export individual keys anymore. Instead, you'd use listdescriptors and importdescriptors there, which describe the entire set of addresses controlled by the wallet at once, probably much more in line of how you'd expect exports to work.