All Projects → ranaroussi → Pywallet

ranaroussi / Pywallet

Licence: mit
Dead-simple BIP32 (HD) wallet creation for BTC, BTG, BCH, LTC, DASH, USDT, QTUM and DOGE

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Pywallet

Ccxt
A JavaScript / Python / PHP cryptocurrency trading API with support for more than 100 bitcoin/altcoin exchanges
Stars: ✭ 22,501 (+7767.48%)
Mutual labels:  cryptocurrency, btc, eth
Optimal Buy Cbpro
Scheduled buying of BTC, ETH, and LTC from Coinbase Pro, optimally!
Stars: ✭ 288 (+0.7%)
Mutual labels:  cryptocurrency, btc, eth
Cryptolist
Curated collection of blockchain & cryptocurrency resources.
Stars: ✭ 3,501 (+1124.13%)
Mutual labels:  cryptocurrency, btc, eth
Openapi
DragonEx OpenAPI
Stars: ✭ 54 (-81.12%)
Mutual labels:  cryptocurrency, btc, eth
Telegram Kraken Bot
Python bot to trade on Kraken via Telegram
Stars: ✭ 156 (-45.45%)
Mutual labels:  cryptocurrency, btc, eth
Cbpro Trader
Automated cryptocurrency trading on Coinbase Pro (formerly gdax-trader)
Stars: ✭ 171 (-40.21%)
Mutual labels:  cryptocurrency, btc, eth
Bot18
Bot18 is a high-frequency cryptocurrency trading bot developed by Zenbot creator @carlos8f
Stars: ✭ 157 (-45.1%)
Mutual labels:  cryptocurrency, btc, eth
Ccxt Rest
Open Source Unified REST API of 100+ Crypto Exchange Sites (18k+ docker pulls) - https://ccxt-rest.io/
Stars: ✭ 210 (-26.57%)
Mutual labels:  cryptocurrency, btc, eth
coinbin.org
₿ A Human–Friendly API Service for Crypto Currency Information.
Stars: ✭ 255 (-10.84%)
Mutual labels:  btc, eth
bitforce
A tools brute force BTC
Stars: ✭ 24 (-91.61%)
Mutual labels:  btc, bitcoin-wallet
go-dc-wallet
交易所收提币功能
Stars: ✭ 76 (-73.43%)
Mutual labels:  btc, eth
Crypto-Wallet
Open source SHA-512 loginless bitcoin wallet
Stars: ✭ 24 (-91.61%)
Mutual labels:  btc, bitcoin-wallet
coinmarketcap-icons-cryptos
Repository of all crypto icons, and allows you to download all images of icons of crypto currencies listed on the coinmarketcap site 9129 icons
Stars: ✭ 17 (-94.06%)
Mutual labels:  btc, eth
kunkka-match
高性能撮合引擎
Stars: ✭ 50 (-82.52%)
Mutual labels:  btc, eth
platzi-exchange
Proyecto del Curso Basico de Vue.js de Platzi 💚
Stars: ✭ 26 (-90.91%)
Mutual labels:  btc, eth
Open Crypto Tracker
Bitcoin / Alts private portfolio tracker, with email / text / alexa / telegram price alerts, charts, leverage support and much more.
Stars: ✭ 59 (-79.37%)
Mutual labels:  btc, eth
Btcbf
Bitcoin private key brute force tool, written in python. Also can be used as a bitcoin wallet generator.
Stars: ✭ 91 (-68.18%)
Mutual labels:  btc, bitcoin-wallet
crypto-watcher
Real-time cryptocurrencies prices.
Stars: ✭ 25 (-91.26%)
Mutual labels:  btc, eth
bybit-api
Node.js connector for the Bybit APIs and WebSockets, with TypeScript & browser support.
Stars: ✭ 69 (-75.87%)
Mutual labels:  btc, eth
HTML-Crypto-Currency-Chart-Snippets
💹 Simple HTML Snippets to create Tickers / Charts of Cryptocurrencies with the TradingView API 💹
Stars: ✭ 89 (-68.88%)
Mutual labels:  btc, eth

PyWallet

.. image:: https://img.shields.io/pypi/pyversions/pywallet.svg?maxAge=60 :target: https://pypi.python.org/pypi/pywallet :alt: Python version

.. image:: https://img.shields.io/pypi/v/pywallet.svg?maxAge=60 :target: https://pypi.python.org/pypi/pywallet :alt: PyPi version

.. image:: https://img.shields.io/pypi/status/pywallet.svg?maxAge=60 :target: https://pypi.python.org/pypi/pywallet :alt: PyPi status

\

Simple BIP32 (HD) wallet creation for: BTC, BTG, BCH, ETH, LTC, DASH, DOGE

BIP32 (or HD for "hierarchical deterministic") wallets allow you to create child wallets which can only generate public keys and don't expose a private key to an insecure server.

This library simplify the process of creating new wallets for the BTC, BTG, BCH, ETH, LTC, DASH and DOGE cryptocurrencies.

Most of the code here is forked from:

  • Steven Buss's Bitmerchant <https://github.com/sbuss/bitmerchant>_ (original)
  • BlockIo's multimerchant-python <https://github.com/BlockIo/multimerchant-python>_ (fork of Bitmerchant)
  • Michail Brynard's Ethereum BIP44 Python <https://github.com/michailbrynard/ethereum-bip44-python>_

I simply added support for a few more cryptocurrencies (BCH, BTG, DASH), as well as created methods to simplify the creation of HD wallets and child wallets.

Enjoy!


Installation

Install via PiP:

.. code:: bash

$ sudo pip install pywallet

Example code:

Create HD Wallet

The following code creates a new Bitcoin HD wallet:

.. code:: python

# create_btc_wallet.py

from pywallet import wallet

# generate 12 word mnemonic seed
seed = wallet.generate_mnemonic()

# create bitcoin wallet
w = wallet.create_wallet(network="BTC", seed=seed, children=1)

print(w)

Output looks like this:

.. code:: bash

$ python create_btc_wallet.py

{
  "coin": "BTC",
  "seed": "guess tiny intact poet process segment pelican bright assume avocado view lazy",
  "address": "1HwPm2tcdakwkTTWU286crWQqTnbEkD7av",
  "xprivate_key": "xprv9s21ZrQH143K2Dizn667UCo9oYPdTPSMWq7D5t929aXf1kfnmW79CryavzBxqbWfrYzw8jbyTKvsiuFNwr1JL2qfrUy2Kbwq4WbBPfxYGbg",
  "xpublic_key": "xpub661MyMwAqRbcEhoTt7d7qLjtMaE7rrACt42otGYdhv4dtYzwK3RPkfJ4nEjpFQDdT8JjT3VwQ3ZKjJaeuEdpWmyw16sY9SsoY68PoXaJvfU",
  "wif": "L1EnVJviG6jR2oovFbfxZoMp1JknTACKLzsTKqDNUwATCWpY1Fp4",
  "children": [{
     "address": "1E3btRwsoJx2jUcMnATyx7poHhV2tomL8g",
     "path": "m/0",
     "xpublic_key": "xpub69Fho5TtAbdoXyWzgUV1ZYst9K4bVfoGNLZxQ9u5js4Rb1jEyUjDtoATXbWvAcV8cERCMMnH8wYRVVUsRDSfaMjLqaY3TvD7Am9ALjq5PsG",
     "wif": "KysRDiwJNkS9VPzy1UH76DrCDizsWKtEooSzikich792RVzcUaJP"
 }]
}

Similarly, you can do the same for an Ethereum wallet:

.. code:: python

# create_eth_wallet.py

from pywallet import wallet

seed = wallet.generate_mnemonic()
w = wallet.create_wallet(network="ETH", seed=seed, children=1)

print(w)

Output looks like this (no WIF for Ethereum):

.. code:: bash

$ python create_eth_wallet.py

{
  "coin": "ETH",
  "seed": "traffic happy world clog clump cattle great toy game absurd alarm auction",
  "address": "0x3b777f60eb04fcb13e6b27e468532e491409722e",
  "xprivate_key": "xprv9yTuSjwb95QZznV6epMWpb4Kpc2S8ZRaQuAf5B697YXtQD2tDmmJ5KvwJWVjtbVrdJ1WBKNnuodrpTKGfHfiPSEgrAxUjL5RP1gQwwT3fFx",
  "xpublic_key": "xpub6GhhMtkVjoPi5DKtqapKzMzrzdGjo1EPc7Ka6KdeoXYdCrTBH1Hu1wKysm8boWSy8VeTKVJi6gQJ2qJ4YG2ZhvFDcUUgMJrFCJWN1PGtBry",
  "wif": "",
  "children": [{
    "address": "0x87eb82d43fa7316df0a989c0d951a9037ed02f9b",
    "path": "m/0",
    "xpublic_key": "xpub6LnpVXD73jNuAYXxzQCnEY6wXQspwkiAEkZWoX4BW9Tzx6KbUrMUYAU1Yvw4kebPHSPiEJPo8irHWHSwQR6WuVwUj85xURsugPWeJVH6sau",
    "wif": ""
  }]
}

* Valid options for network are: BTC, BTG, BCH, LTC, DASH, DOGE

Create Child Wallet

You can create child-wallets (BIP32 wallets) from the HD wallet's Extended Public Key to generate new public addresses without revealing your private key.

Example:

.. code-block:: python

# create_child_wallet.py

from pywallet import wallet

WALLET_PUBKEY = 'YOUR WALLET XPUB'

# generate address for specific user (id = 10)
user_addr = wallet.create_address(network="BTC", xpub=WALLET_PUBKEY, child=10)

# or generate a random address, based on timestamp
rand_addr = wallet.create_address(network="BTC", xpub=WALLET_PUBKEY)

print("User Address\n", user_addr)
print("Random Address\n", rand_addr)

Output looks like this:

.. code:: bash

$ python create_child_wallet.py

User Address
{
  "address": "13myudz3WhpBezoZue6cwRUoHrzWs4vCrb",
  "path": "m/0/395371597"
}
Random Address
{
  "address": "1KpS2wC5J8bDsGShXDHD7qdGvnic1h27Db",
  "path": "m/0/394997119"
}

IMPORTANT

I highly recommend that you familiarize yourself with the Blockchain technology and be aware of security issues. Reading Mastering Bitcoin <https://github.com/bitcoinbook/bitcoinbook>_ and going over Steven Buss's security notes on the Bitmerchant repository <https://github.com/sbuss/bitmerchant>_ is a good start.

Enjoy!

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].