Benefits of generate address from sha256 hash than random address Is there any benefits (eg: better security) of generate a address from SHA 256 hash vs generate a random hash?

Generate adress from a SHA 256 hash

var value = Buffer.from('correct horse battery staple');
var hash = bitcore.crypto.Hash.sha256(value);
var bn = bitcore.crypto.BN.fromBuffer(hash);

var address = new bitcore.PrivateKey(bn).toAddress();


Generate a random address

var privateKey = new bitcore.PrivateKey();

var address = privateKey.toAddress();
Generating from the hash of a string is known as a Brainwallet. This has the advantage that it is potentially easier to remember and recreate your wallet if you lose the keys.

This also have the disadvantage that people are terrible at picking entropy, and it is trivial to crack most brainwallets via brute force. You have far more security relying on randomized generator than more or less any brainwallet you could come up with.