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.