Are brain wallets possible? (I know they are frowned on in most cases)

I have been working on a few things using bitcore for the past month or so (great job with the page/documentation/playground!) and was wondering if there was a way to create a brain wallet using bitcore. One idea I had was to make a scavenger hunt of sorts (I love riddles) where the answers were brain wallets that could be redeemed. I could always use a seed, but the brain wallet just seemed easier for this case.

Thanks,
Mike

You can hash (sha256) any data and use that a basis to create a private key.

var dataBuffer = new Buffer(someString);
var hash = bitcore.crypto.Hash.sha256sha256(dataBuffer).toString('hex');
var privateKey = bitcore.PrivateKey.fromString(hash);

There is also bitcore-mnemonic: https://github.com/bitpay/bitcore-mnemonic

1 Like

Ah yes, thank you. Your first solution is exactly what I was looking for, and should have known. Sometimes the obvious escapes me when I get distracted!

I like bitcore-mnemonic. It works really well. But for what I was thinking about it isn’t terribly effective.

Thanks!