11

I would like to create plain text private keys for Monero that can be encrypted/decrypted using a process similar to BIP38. (https://github.com/bitcoin/bips/blob/master/bip-0038.mediawiki)

Is such a thing possible with Monero today, or would it need to be developed further?

Simplewallet may also need the ability to import these types of keys without having the mnemonic seed.

6
  • 3
    I guess you could use this (it's run client-side, you can download the page and use it offline): xmr.llcoins.net If you type your mnemonic in field 1, password in 8., you get an encrypted mnemonic in field 9. which looks the same as any other.
    – JollyMort
    Commented Sep 20, 2016 at 19:12
  • 1
    @JollyMort is it not risky to use? What if the sote shutdown how do I recover my seed?
    – ant Bldel
    Commented Sep 25, 2016 at 8:27
  • 1
    the site is a plain html+javascript, run entirely in the browser. You should just download the .zip file provided at the bottom and store it somewhere as backup. Even when doing the actual encryption, it's suggested to download the site and do the whole thing with a LiveCD on an offline computer.
    – JollyMort
    Commented Sep 25, 2016 at 8:55
  • One other thing to note. You really must start with a good known mnemonic key. This way field #2 and field #3 will always remain the same. If you use a private key generated for example in bitaddress it may not backward reproduce a mnemonic key,(not all bitcoin private keys work for monero - some do, but not all) and it can get confusing if you enter it into field #2 because it will actually generate a mnemonic key but will be acting as a 256 SEED not a private key and it will give you a different private key. Re-type this 'different' spend key into field #2 and you get an entirely different m
    – sulkair
    Commented Jan 31, 2017 at 16:13
  • you can decrypt any private key password ?
    – hard
    Commented Aug 23, 2018 at 15:15

4 Answers 4

4

Well you could get your Monero 256 hexadecimal private key from here: https://xmr.llcoins.net/addresstests.html Field#3 (Do not confuse with Field #2) And then use https://www.bitaddress.org to Bip38 encrypt the 256 hex private key. Once you have your Bip38 address like this: 6PRKb345MjC34YBJMxcp5drjqe72GVVt2QsiwjN2bhLe14tfshLYSBKdS7, all you have to do is decrypt it in bitaddress with your password, scroll down to find "Private Key Hexadecimal Format (64 characters [0-9A-F]" in bitaddress. Copy that back over to Field#3 of llcoins and presto you've got everything including your mnemonic key!

Example: (test and see if you get the same thing)

mnemonic:

lush pivot online aglow musical prying object heron nail faked drowning asylum icon dinner cycling furnished gumball wives nimbly money fewest toilet gained gesture furnished

Generates this Private Spend Key:

cf9f56f31b34b42067c93d2f5cb431dbfb2596f9ad0b8a9ea855c7bfebaae802

Bip 38 it to:

6PRKb345MjC34YBJMxcp5drjqe72GVVt2QsiwjN2bhLe14tfshLYSBKdS7

with Password:

bip38moneros

Decrypt the 6PRKb34.... address with password: bip38moneros and walla:

Bitaddress decrypted "Private Key Hexadecimal Format (64 characters [0-9A-F]": (Will be all CAPS)

CF9F56F31B34B42067C93D2F5CB431DBFB2596F9AD0B8A9EA855C7BFEBAAE802

Oh one last thing download these websites to an airgapped machine and verify their signatures to be safe.

4

Monero can be made to be compliant with the spirit of BIPs 32, 38, 39 and 44. The main issue is BIP 32, 39 and 44 public keys and addresses can't be synthesized using traditional Bitcoin methodologies.

BIP 38 has two capabilities. Both are concisely documented at https://github.com/libbitcoin/libbitcoin/wiki/Altcoin-Version-Mappings#bx---key-encryption-commands.

Extended AES256Encrypt and AES256Decrypt most definitely can be supported for encoding and decoding deterministic Monero private spend keys, only a matter of development and merging into the master branch. The Monero Team will need to decide upon the prefix to be used other than 6P taken by Bitcoin, see https://github.com/libbitcoin/libbitcoin/wiki/Altchain-Encrypted-Private-Keys#sample-map.

A bit more thought needs to be given to the other BIP 38 "EC Multiply Mode", essentially being a Casascius without being a money transmitter. This capability looks promising, but no guarantees without a little further investigation.

Update: Posted C++ source code on Github for the ./xmr command used used at the end of this piped command sequence. Not a cross platform developer, but the code compiles on a Mac Homebrew environment using Xcode. With the ./xmr command, both BIP 38 modes can be supported using this. The ./xmr command can also be applied to create Monero brainwallet that can be the foundation for a BIP 38 wallet, even supporting BIP 38 "EC Multiply Mode" for those wanting to mint or print and do not want to be classified as money transmitters.

% echo -n "This brain wallet sucks" | bx base16-encode | bx sha256 | bx mnemonic-new | bx mnemonic-to-seed -p "My Password" | bx hd-new -v 76066276 | bx hd-private -d -i 44 | bx hd-private -d -i 128 | bx hd-private -d -i 0 | bx hd-to-ec | ./xmr

Seed : 70371fbdba4072dbff8c9350414cf9a903776791792d575557b697cb09952951

Private Spend Key : cf1352ec36511623d07cbd21e86a9e4103776791792d575557b697cb09952901

Private View Key : fd38a51dda45a8ff44042525477a572b93d3219d3751ca49f5aeb7f8278cdc0c

Public Spend Key : ec8cc4f1f0622946bd24a41dc7a4d01964f4f6a878e0e8bf0ce0eb7214174979

Public View Key : 853a5e0aa455820991cd8801ac7be09dbf347b8be875d208f08d97faf7fefb3b

Monero Address : 4Ab2kg2ZXrgCqFp3HAnJfy5FMiPKtNaCFYxRnRpkWiG8MKuDfDLo67K2bqX9gXszpfTPLs6ng4YAd2Vj6wthUhk67icBjbC

Electrum Seed Words : onward easy cistern puddle giddy ladder foxes ingested morsel vocal glide observant guide among online jargon wonders fudge emails daytime wobbly army jeers jigsaw ladder

% bx ec-to-ek -v 0 "Your BIP38 Password" cf1352ec36511623d07cbd21e86a9e4103776791792d575557b697cb09952901 6PYXHLAR2khgrRd5GgSStNJhYMH5p8Ug52yUzt86CseG2ee3A3z9Mb9EWY

% bx ek-to-ec "Your BIP38 Password" 6PYXHLAR2khgrRd5GgSStNJhYMH5p8Ug52yUzt86CseG2ee3A3z9Mb9EWY cf1352ec36511623d07cbd21e86a9e4103776791792d575557b697cb09952901

3

One method is to use this tool (made by Luigi from Monero core team).

  1. enter your mnemonic into field 1.
  2. enter a password into field 8.
  3. select 'CN Add' as the method, and click encrypt

As described on the page, this works as following:

In the "CN Add" method, the key is hashed with CryptoNight, then interpreted as a private key/scalar and added to the hex seed. The resulting mnemonic looks exactly the same as an unencrypted one.

Main benefit is that the result of encryption will be another valid seed mnemonic! You could even put some funds there to trick someone into thinking it's the real deal, while to access your main stash you'd need to decrypt it - but only you'd know this ;)

0

I have no idea whether this is equivalent to BIP 38, but you can encrypt your seed into another valid seed by using a passphrase, by running the encrypted_seed command in monero-wallet-cli. You will be prompted for a passphrase, and get the encrypted seed. When you restore the seed next, you'll get a prompt for that optional passphrase.

This system uses the CN_Add method from luigi1111 that JollyMort mentions above. Also note that this does not make your seed magically secure, so treat it as secret information even when encrypted.

The seed is a particular encoding of a secret key, so encoding the seed this way is equivalent to encrypting a secret key.

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.