Last active
August 29, 2015 14:22
-
-
Save williamcotton/ba3530f6f0b7bbce10a5 to your computer and use it in GitHub Desktop.
Create a Bitcoin wallet
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var bitcoin = require('bitcoinjs-lib'); | |
document.getElementById("generate-wallet").addEventListener("click", function(event) { | |
var seedString = document.getElementById("brainwallet-seed").value; | |
seed = bitcoin.crypto.sha256(seedString); | |
wallet = new bitcoin.Wallet(seed, bitcoin.networks.testnet); | |
address = wallet.generateAddress(); | |
document.getElementById("wallet-address").innerHTML = address; | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment