Skip to content

Instantly share code, notes, and snippets.

@ndelvalle
ndelvalle / create-bitcoin-tx.js
Created September 6, 2018 19:26 — forked from gabmontes/create-bitcoin-tx.js
Create bitcoin transaction from BIP38 private key
const { Transaction } = require('bitcore-lib')
const { decrypt } = require('bip38')
const encryptedKey = '<private key beginning with 6>'
const password = '<private key password>'
const privateKey = decrypt(encryptedKey, password).privateKey
// Check UTXO info at https://insight.bitpay.com/api/addr/<origin address>/utxo
const utxo = {