1

How do I go about encrypting some existing private keys using BIP38 in an offline manner? I have looked at bitaddress.org and that site only lets you BIP38 keys which the bitaddress.org site itself created.

I basically want to generate my own bitcoin private keys using bitcoin-core, and then BIP38 encrypt them in an offline manner so I can have a copy of my private keys in paper form just as an extra backup to my existing digital encrypted backups.

1 Answer 1

1

The Bitcoin-Explorer (bx) v3.0 implementation described below has had FULL BIP 38 functionality for over a year, and has extended BIP 38 to numerous altcoins.

See 5) Extended AES256Encrypt and AES256Decrypt BIP 38 CLI Example Set, and use -v 0 for Bitcoin instead of -v 76 for Dash. See the 4th column of BIP44 Altcoin Version Mapping Table for version mappings for various coins.

Use wif-to-ec to convert your WIF-encoded keys to hexadecimal. Use ec-to-wif to go the opposite direction as needed.

The full round robin example below is for Bitcoin, not Dash, but contrast:

% bx wif-to-ec L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-ek -v 0 "Hello it is me" f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269 6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a

% bx ek-to-ec "Hello it is me" 6PYK35faHFxireTJyhtjm9weuBFMuc2uF7fBKmHzDvakT6TRek9RwfyX9a f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269

% bx ec-to-wif -v 128 f9a8f6d4a24b99d4944ee3db83c85383e9c13e85cb50ad60a9e1a96e02f6d269 L5b1xYjJCxfPsr9b4896DwMqoGb3TyNrwUvfGacm2RQoUoKGqjny

The ec-to-wif command needs to use integer values for the 3rd column of BIP44 Altcoin Version Mapping Table corresponding to the crypto-coin being used. If version integers are dropped, bx assumes the operations are for Bitcoin.

Be forewarned that BIP 38 isn't standardized for altcoins with Bitcoin heritage yet. Many wallet tools claiming to provide BIP 38 functionality use the prefix 6P for altcoins. The prefix 6P should be different for altcoins to minimize confusion. This sample mapping shows -v 0 maps to a 6P prefix for Bitcoin, while -v 76 maps to a 7f prefix for Dash, (76 base 10 == 4c base 16).

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.