Giter Club home page Giter Club logo

bitcoin-test-wallets-generator's Introduction

Bitcoin Test Wallets Generator

A Bitcoin test wallet’s generator to help bitcoin programmers.

Features

  • Generate six wallets (Alice, Bob, Carol, Dave Eve, Mallory)

  • Create a json file detailing all the cryptographic materials

  • Import private keys to Bitcoin Core

Requirements

  • >= NodeJS v10

  • jq - JSON processor

  • Bash or a Bash interpreter like Cygwin or Windows Subsystem for Linux (WSL)

How to use it

First launch Bitcoin Core so that the library can import the private keys.

Note
By default, the library is set to the regtest network and uses hardcoded 16 bytes entropy.
npx bitcointestwalletsgenerator

or

git clone [email protected]:bitcoin-studio/bitcoin-test-wallets-generator.git
node generate_wallets.js

 

Run with a new set of entropy

Note
16 bytes entropy = 12 words mnemonic
32 bytes entropy = 24 words mnemonic
npx bitcointestwalletsgenerator --entropy 16

 

Set the network

npx bitcointestwalletsgenerator --network mainnet

 

Set the network and entropy

npx bitcointestwalletsgenerator -n testnet -e 32

 

Verbose

npx bitcointestwalletsgenerator -v

 

Help

npx bitcointestwalletsgenerator --help

 

Check that private key import was successful with the listlabels command in Bitcoin Core console

bitcoin-test-wallets-generator's People

Contributors

dependabot[bot] avatar tka85 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

bitcoin-test-wallets-generator's Issues

Creating recipient's output should not involve his private key

I see this across several scenarios like for example in Simple Transaction (1 input, 1 output) - Legacy P2PKH. To add the recipient's output in the tx, you use his priv key:

const keyPairBob1 = bitcoin.ECPair.fromWIF(bob[1].wif, network)
const p2pkhBob1 = bitcoin.payments.p2pkh({pubkey: keyPairBob1.publicKey, network})
...
txb.addOutput(p2pkhBob1.address, ...)

This gives the false impression that to send to someone I need to have his WIF.

The example could instead just use directly Bob's publicKey from the wallets.json. It still shows how to construct a p2pkh address using bitcoinjs and also maintains that only public info is required from the recipient:

const p2pkhBob1 = bitcoin.payments.p2pkh({pubkey: Buffer.from(bob[1].pubKey, 'hex'), network})
...
txb.addOutput(p2pkhBob1.address, ...)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.