user3029: Are there any brain wallet generators that can generate segwit (bc1) addresses yet?

user26873: Here's an example with bitcoinjs-lib:
let bitcoin = require('bitcoinjs-lib');
let assert = require('assert')
let bigi = require('bigi')


let NETWORK = bitcoin.networks.bitcoin;
let brainwallet = "This is my brain wallet and it is less secure than a CSPRNG source";
let hash = bitcoin.crypto.sha256(brainwallet);
let d = bigi.fromBuffer(hash);
let nkeyp = new bitcoin.ECPair(d);
let wif = nkeyp.toWIF();
let pubKey = nkeyp.getPublicKeyBuffer();
let scriptPubKey = bitcoin.script.witnessPubKeyHash.output.encode(bitcoin.crypto.hash160(pubKey))
let address = bitcoin.address.fromOutputScript(scriptPubKey);
console.log(address);
console.log(wif);


user3029: Memory Paper Wallet has the ability to generate bc1 addresses from a brain wallet phrase.
https://www.xcubicle.com/memory-paper-wallet-bitcoin-ethereum-monero-ardor-litecoin

3029: <p>Are there any brain wallet generators that can generate segwit (bc1) addresses yet?</p>
 26873: <p>Here's an example with bitcoinjs-lib:</p>

<pre><code>let bitcoin = require('bitcoinjs-lib');
let assert = require('assert')
let bigi = require('bigi')


let NETWORK = bitcoin.networks.bitcoin;
let brainwallet = "This is my brain wallet and it is less secure than a CSPRNG source";
let hash = bitcoin.crypto.sha256(brainwallet);
let d = bigi.fromBuffer(hash);
let nkeyp = new bitcoin.ECPair(d);
let wif = nkeyp.toWIF();
let pubKey = nkeyp.getPublicKeyBuffer();
let scriptPubKey = bitcoin.script.witnessPubKeyHash.output.encode(bitcoin.crypto.hash160(pubKey))
let address = bitcoin.address.fromOutputScript(scriptPubKey);
console.log(address);
console.log(wif);
</code></pre>
 3029: <p><em>Memory Paper Wallet</em> has the ability to generate bc1 addresses from a brain wallet phrase.</p>

<p><a href="https://www.xcubicle.com/memory-paper-wallet-bitcoin-ethereum-monero-ardor-litecoin" rel="nofollow noreferrer">https://www.xcubicle.com/memory-paper-wallet-bitcoin-ethereum-monero-ardor-litecoin</a></p>
