Skip to main content

Lite bitcoin bunkr-wallet working on top of Bunkr secrets

Project description

Bunkr Wallet

Bunkr Wallet is a simple bitcoin wallet application built on top of Bunkr. In utilizing Bunkr our wallet shifts the paradigm of cryptocurrency wallet security: private keys are distributedly stored in Bunkr and transaction signatures are securely generated without ever recomposing a bitcoin private key on any device. The wallet is a bare bones proof of concept with a simple cli.

Disclaimer: This wallet is in beta and under development. Demo the wallet with testnet coins, and never publish generated transactions without decoding and looking them over first!


  • Private keys are stored across a distributed set of machines as Bunkr secrets and never touch your local machine (after creation).
  • In order to create a wallet or send funds from a wallet, the Bunkr Daemon must be running in the background.
  • Bunkr Wallet is not an HD (heirarchical deterministic) wallet as wallet addresses are in no way correlated or derived from a master seed. One can add more addresses to the wallet keyring at any time.
  • A wallet stores all public wallet information in a simple json file. It stores addresses, public keys, and reference to Bunkr secrets (for communicating with the private key distributed across remote servers). While your private keys will still be safe and secure in your Bunkr, losing the wallet json file can make it a pain to recover the wallet.


Install Bunkr Wallet (and all underlying requirements) with:

$ pip install bunkrwallet

Verify installation with

$ bunkr-wallet
Usage: bunkr-wallet [OPTIONS] COMMAND [ARGS]...

  --help  Show this message and exit.



Bunkr Wallet can be used with the bunkr-wallet commnad line interface. For now the possible commands are very simple:

  1. list-wallets (list names of existing bunkr wallets)
  2. new-wallet (create a bunkr wallet) args: --name <your name>
  3. check-balance (check the balance of a bunkr wallet) args: --wallet <wallet name>
  4. get-address (get a receiving address for a bunkr wallet) args: --wallet <wallet name>
  5. transaction (send bitcoin from a bunkr wallet) args: --wallet <wallet name> --address <recipient> --amount <# satoshi> --fee <# satoshi>

Most notably, when signing transactions, the wallet communicates with Bunkr to sign without ever recomposing the private key on any device.

Tutorial: create and use a testnet wallet from the command line

In this tutorial we will create a testnet bitcoin wallet, and use it to receive and send bitcoin.


  1. Bunkr binary (download here)
  2. Bunkr Daemon Running (see here)
  3. Python bunkrwallet (pip install bunkrwallet)

Step 1: Create a testnet wallet

$ bunkr-wallet new-wallet --name myTestWallet --testnet
Creating new wallet...
Wallet created

Step 2: Get an address for receiving tBTC

$ bunkr-wallet get-address --wallet myTestWallet
Receive address:

Step 3: Receive testnet bitcoins (for free, from a faucet)

Testnet bitcoins can be found at a testnet faucet such as: (Input the testnet address printed from Step 2 and click "Get Bitcoins!")

You can see the transaction has succeeded (you may have to wait a few minutes for transaction to have at least one confirmation):

$ bunkr-wallet check-balance --wallet myTestWallet
myTestWallet current balance: 0.03142 BTC

Step 4: Send testnet bitcoin

$ bunkr-wallet transaction --wallet myTestWallet --address <recipient address> --amount <# satoshi to send> --fee <# satoshi as fee>
Transaction hex:

BunkrWallet Docs

Bunkr wallet can also be controlled through a python console directly, and has extended functionality than the simple command line interface.

BunkrWallet class methods

>>> bw = BunkrWallet()

Creates an instance of the BunkrWallet.

Optional parameters (don't change these unless you know what you are doing):

  • directory_name is the name of the BunkrWallet directory (where all wallet files are stored). Default to .BunkrWallet
  • bunkr_address is the socket address of the bunkr daemon. Defaults to /tmp/bunkr_daemon.sock
  • bunkr_path is the path to your local bunkr directory. Defaults to ~/.bunkr


>>> w = bw.create_wallet("your-wallet-name")

Creates a wallet instance and the file your-wallet-name.json in the BunkrWallet directory.

Optional parameter

  • testnet is a boolean flag for either bitcoin testnet or mainnet (defaults to False, i.e. mainnet)


>>> bw.list_wallets()
['your-wallet-name', 'your-other-wallet-name', ...]

Lists all the wallet names in the BunkrWallet directory.


>>> w = bw.get_wallet("your-wallet-name")

Gets Wallet instance with the name "your-wallet-name" from the BunkrWallet.

Wallet class methods


>>> w.show_balance()

Prints the total balance of the wallet.


>>> w.show_fresh_address()

Shows an unused address on the wallet keyring. Use this method to get an address for receiving bitcoin. If there are no fresh addresses left in the wallet it will raise an error (to overcome this error see add_addresses)


>>> w.send([{"address": <address 1>, "value": <satoshi amount to address 1}, ...], <fee amount>)

Returns the signed transaction hex of a new bitcoin transaction. It is left to the user to publish the transaction.


>>> w.add_addresses(<number of addresses>)

Adds an amount of addresses to the wallet keyring.

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Built Distribution

bunkrwallet-0.3.1-py3-none-any.whl (12.9 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page