Skip to content

Instantly share code, notes, and snippets.

@maxidev
Created October 15, 2014 02:34
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save maxidev/4faeb659260caf9d4ff7 to your computer and use it in GitHub Desktop.
Save maxidev/4faeb659260caf9d4ff7 to your computer and use it in GitHub Desktop.
Wallet Generation Code for JCC 2014 Presentation.
// Bitcoin in Depth: A Cryptographycal Journey
// JCC 2014
//Importo librerías
var bitcoin = require('bitcoinjs-lib');
var colors = require('colors');
//Creo el par clave pública/privada usando
//criptografía asimétrica, particularmente Curva Elíptica
var key = bitcoin.ECKey.makeRandom();
console.log('');
//Muestro la llave privada por pantalla
console.log("Clave privada: "+key.toWIF().red);
//Muestro la dirección pública asociada
//que voy a usar en caso de querer recibir Bitcoin
console.log("Billetera pública: "+key.pub.getAddress().toString().green)
console.log('');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment