Bitcoin Forum
December 12, 2024, 05:42:02 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: TermWallet - Lightweight Command-Line Wallet  (Read 2266 times)
adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 07, 2015, 01:42:14 AM
Last edit: January 10, 2015, 11:37:50 PM by adorno
 #1

I'm excited to release a project I've been working on the past few months, which has reached a point of usability and stability I'm finally satisfied with.  It uses the latest bitcoinj version, currently 0.12.2.

TermWallet

TermWallet is a bitcoinj-based wallet tailor-made for the command line.  It does not download the whole blockchain, and as a result the blockchain data only take up about a megabyte of space.  Small servers with limited HDD space are thus the ideal use-case for TermWallet.  Generated addresses are deterministic (HD) by default, using the BIP32 specification, but external private keys can also be imported into the wallet.

TermWallet can make transactions using only one address's outputs by including a novel adaption of bitcoinj's CoinSelector method, IndividualCoinSelector.  Previously, bitcoinj (and subsequently bitcoinj-based wallets such as Multibit) has not been able to select outputs from only one address.  IndividualCoinSelector provides this capability. Use the "-f (--from)" option while using the "send" command to designate the address to send from.

An encryption function is included, currently only encrypting private keys. Further, TermWallet provides a 'panic' command that can send all the BTC's in the wallet to an external address and, optionally, delete the wallet (including all files). This should be used if the computer is compromised or at risk.  No private keys will be easily recoverable.

An experimental function is provided to connect to the blockchain through Tor.  Use "-t" or "--tor" to use it.

To view the full usage menu, use "termwallet --help"

Install Instructions

Full Source Code: https://github.com/grayleonard/termwallet

Requirements:
OSX or Linux
Java 1.6 (bitcoinj requirement)

Quick Install:
Code:
wget -O - https://raw.githubusercontent.com/grayleonard/termwallet/master/install.sh | sh
You may need to run
Code:
wget -O - https://raw.githubusercontent.com/grayleonard/termwallet/master/install.sh | sudo sh
if permission is denied (note the 'sudo')

If you want to build from source:
Code:
git clone https://github.com/grayleonard/termwallet.git
cd termWallet
./build.sh
(Maven2 is required to build the project)

Get started by running 'termwallet new'. It creates a new address. Examples below.

Contributions and bug reports are welcomed, just make a pull request or open an issue.

"Screenshots"
Code:
[term@wallet]$ termwallet status
Connecting to and downloading blockchain...
Finished downloading blockchain...

Your addresses and their balances:
Deterministic Keys:
157tPz2zUc7Q843bRXhbN2PgNRJwFP3tBi      Balance: BTC 0.00
1QECpf8AjyZMCEV54uhKccRd6ueYiUHhik      Balance: BTC 0.00
18PcKRUNkq26JN3sXx9VGmch5Guj2JX9q8      Balance: BTC 0.00
1pXcUE8PJy8VdP4dPfttr3FyUCBwmStfH       Balance: BTC 0.00

Confirmed: BTC 0.00
Unconfirmed: BTC 0.00

Code:
[term@wallet]$ termwallet import
Connecting to and downloading blockchain...
Finished downloading blockchain...

Private key: correct horse battery staple
Creating ECKey ECKey{pub=047e225fa4260a6b6ce741170396462629115f52fe5305830df1c2acce10250f11a16e5a2a0816c677c4506db3a4b8f73f3ea97d538488674f84e20d40956751fc, isEncrypted=false}...
Added new ECKey, address 1EnngHuGmcjz781rYV5KXw4FAcwXi5o4ei to wallet...

Code:
[term@wallet]$ termwallet new
Connecting to and downloading blockchain...
Finished downloading blockchain...

New Address 1L54YBPbPQAhMnxCmQedNeSuXp63RHCKdG with purpose RECEIVE_FUNDS

Donation address: 1L54YBPbPQAhMnxCmQedNeSuXp63RHCKdG  Wink
jim618
Legendary
*
Offline Offline

Activity: 1708
Merit: 1066



View Profile WWW
January 07, 2015, 10:44:25 AM
 #2

Very nice !

:-)

MultiBit HD   Lightweight desktop client.                    Bitcoin Solutions Ltd   Bespoke software. Consultancy.
Mike Hearn
Legendary
*
Offline Offline

Activity: 1526
Merit: 1134


View Profile
January 08, 2015, 03:09:37 PM
 #3

Cool! Tip sent Smiley

You might want to look at this project:

https://code.google.com/p/lanterna/

It could be used to create a pseudo-graphical updating list of transactions, like if you want to have your wallet running inside a screen rather than pure command line based.

If you made an installation procedure that didn't involve catting random shell scripts to a root shell, perhaps you could get it listed on bitcoin.org Smiley

Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 509


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
January 09, 2015, 09:52:04 AM
 #4

Nice project! Would be good if you add GUI to it! Smiley

   ~~MZ~~

Enzyme
Sr. Member
****
Offline Offline

Activity: 420
Merit: 250


View Profile
January 09, 2015, 10:45:14 AM
Last edit: January 10, 2015, 06:30:37 AM by Enzyme
 #5

Nice! Wink

I'll try and use it on a free VPS for absolutely no reason. Cheesy
adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 10, 2015, 05:16:36 PM
 #6

Thanks all, I appreciate the support Kiss

Cool! Tip sent Smiley

You might want to look at this project:

https://code.google.com/p/lanterna/

It could be used to create a pseudo-graphical updating list of transactions, like if you want to have your wallet running inside a screen rather than pure command line based.

If you made an installation procedure that didn't involve catting random shell scripts to a root shell, perhaps you could get it listed on bitcoin.org Smiley



Hi Mike, thanks for the tip.

I've experimented with a curses-like GUI for TermWallet before, but couldn't find an easy-to-use library for it.  Lanterna looks good though, I'll play around with it.  I've also been looking at Charva, seems interesting: http://www.pitman.co.za/projects/charva/index.html

And yes, the current installation procedure isn't the most trustworthy; currently planning to refactor some code, perhaps add a GUI, and then find a more stable release platform.  Updates to follow.
mistercoin
Legendary
*
Offline Offline

Activity: 1057
Merit: 1000


Rent Me!


View Profile WWW
January 10, 2015, 07:07:06 PM
 #7

This is amazing. Geek heaven Grin

Any plans for expansion?

Share Your Network, Get Crypto. It's That simple. |✔ Use this link to get a $5 bonus[/url] ✔|
siameze
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000



View Profile
January 10, 2015, 07:09:10 PM
Last edit: January 10, 2015, 07:28:44 PM by siameze
 #8

I love command-line wallets and things of that nature for bitcoin. I can't wait to check it out.  Smiley


EDIT: Installation was smooth, it is really nice. I love that "panic" feature.


                     ▀▀█████████▀████████████████▄
                        ████▄      ▄████████████████
                     ▄██████▀  ▄  ███████████████████
                  ▄█████████▄████▄███████████████████
                ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████
                                               ▀▀███▀
    ▄█▀█       ▄▀  ▄▀▀█  ▄▀   █████████████████▄ ██▀         ▄▀█
   ▄█ ▄▀      ▀█▀ █▀ █▀ ▀█▀  ███████████████████ █▀ ▀▀      ▄▀▄▀
  ▄█    ▄███  █     █   █   ████████████████████  ▄█     ▄▀▀██▀ ▄███
███▄▄▄  █▄▄▄ █▄▄ ▄▄▀   █▄▄ ██████████████████▀▀   █▄▄ ▄▄ █▄▄█▄▄▄█▄▄▄
                           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                            ▀▀█████████████▄
                                █████████████▄
                                  █████████████▄
                                    ▀███████▀▀▀▀▀
                                      ▀████▀
                                        ▀█▀
LetItRideINNOVATIVE ▬▬▬
DICE GAME
                        ▄███████████▄
                       ██  ██████████▄
                     ▄█████████████  ██▄
            ▄▄▀█▄▄▄▄▄████████████████████▄
        ▄▄█▀   ███████████  █████  ████  █
    ▄██████ ▄▄███████████████████████████▀
 ▄▀▀ ██████████████████████████  ████  █
█  ▄███████████▀▀▀█████████████████████
██████████████    ████████▀▀██████  █▀
██████████████▄▄▄██████████   ▀▀▀▀▀▀▀
███▀ ▀██████████████████████
██    ███████████████████████
██▄▄██████████████████████████
██████████████▀   ██████████
  █████████████   ▄██████▀▀
     ▀▀██████████████▀▀
         ▀▀██████▀▀
PROVABLY
F A I R
▄█████████████▀ ▄█
██            ▄█▀
██          ▄██ ▄█
██ ▄█▄    ▄███  ██
██ ▀███▄ ▄███   ██
██  ▀███████    ██
██    █████     ██
██     ███      ██
██      ▀       ██
██              ██
▀████████████████▀
BUY  BACK
PLANS
[BTC]
adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 11, 2015, 01:17:46 PM
 #9


This is amazing. Geek heaven Grin

Any plans for expansion?

Smiley Thanks. In the short term, I plan on cleaning up the code and adding the ability to give labels to addresses.   I am also weighing the merits of adding a command-line GUI - I don't want to get bogged down with GUI code but it looks like it's wanted.

I love command-line wallets and things of that nature for bitcoin. I can't wait to check it out.  Smiley


EDIT: Installation was smooth, it is really nice. I love that "panic" feature.

Good to hear installation worked. And yes, I was surprised pretty much all other wallets don't have a panic feature - hopefully more implement them.  I'm planning to focus on security and privacy in TermWallet, and any suggestions to make it better are welcome Smiley 

A little tip: I use the panic feature to clean up my wallet - you can send your BTCs to an address in your own wallet (just make sure you don't also delete it!)
siameze
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000



View Profile
January 11, 2015, 07:34:22 PM
 #10


This is amazing. Geek heaven Grin

Any plans for expansion?

Smiley Thanks. In the short term, I plan on cleaning up the code and adding the ability to give labels to addresses.   I am also weighing the merits of adding a command-line GUI - I don't want to get bogged down with GUI code but it looks like it's wanted.

I love command-line wallets and things of that nature for bitcoin. I can't wait to check it out.  Smiley


EDIT: Installation was smooth, it is really nice. I love that "panic" feature.

Good to hear installation worked. And yes, I was surprised pretty much all other wallets don't have a panic feature - hopefully more implement them.  I'm planning to focus on security and privacy in TermWallet, and any suggestions to make it better are welcome Smiley 

A little tip: I use the panic feature to clean up my wallet - you can send your BTCs to an address in your own wallet (just make sure you don't also delete it!)

I don't know a lot about bitcoinj but is there chance for multisig support in the future?


                     ▀▀█████████▀████████████████▄
                        ████▄      ▄████████████████
                     ▄██████▀  ▄  ███████████████████
                  ▄█████████▄████▄███████████████████
                ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████
                                               ▀▀███▀
    ▄█▀█       ▄▀  ▄▀▀█  ▄▀   █████████████████▄ ██▀         ▄▀█
   ▄█ ▄▀      ▀█▀ █▀ █▀ ▀█▀  ███████████████████ █▀ ▀▀      ▄▀▄▀
  ▄█    ▄███  █     █   █   ████████████████████  ▄█     ▄▀▀██▀ ▄███
███▄▄▄  █▄▄▄ █▄▄ ▄▄▀   █▄▄ ██████████████████▀▀   █▄▄ ▄▄ █▄▄█▄▄▄█▄▄▄
                           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                            ▀▀█████████████▄
                                █████████████▄
                                  █████████████▄
                                    ▀███████▀▀▀▀▀
                                      ▀████▀
                                        ▀█▀
LetItRideINNOVATIVE ▬▬▬
DICE GAME
                        ▄███████████▄
                       ██  ██████████▄
                     ▄█████████████  ██▄
            ▄▄▀█▄▄▄▄▄████████████████████▄
        ▄▄█▀   ███████████  █████  ████  █
    ▄██████ ▄▄███████████████████████████▀
 ▄▀▀ ██████████████████████████  ████  █
█  ▄███████████▀▀▀█████████████████████
██████████████    ████████▀▀██████  █▀
██████████████▄▄▄██████████   ▀▀▀▀▀▀▀
███▀ ▀██████████████████████
██    ███████████████████████
██▄▄██████████████████████████
██████████████▀   ██████████
  █████████████   ▄██████▀▀
     ▀▀██████████████▀▀
         ▀▀██████▀▀
PROVABLY
F A I R
▄█████████████▀ ▄█
██            ▄█▀
██          ▄██ ▄█
██ ▄█▄    ▄███  ██
██ ▀███▄ ▄███   ██
██  ▀███████    ██
██    █████     ██
██     ███      ██
██      ▀       ██
██              ██
▀████████████████▀
BUY  BACK
PLANS
[BTC]
adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 12, 2015, 11:41:41 PM
 #11

Just pushed an update, here's whats changed:
  • Wallet deletion in the 'panic' command is more secure; the wallet files are overwritten with random bytes before deletion.
  • Wallet decryption for transactions is handled better:  transactions now take the decryption key directly, so now the whole wallet is not decrypted and then encrypted again when a transaction is made.
  • Small usability change, if you enter a password incorrectly TermWallet doesn't exit anymore, and you can try again.

Update TermWallet by running the same command used to install, which is located in the original post.

I don't know a lot about bitcoinj but is there chance for multisig support in the future?

Yes, there is, thanks for reminding me.  I'm looking into it, hopefully I'll add basic multisig functionality soon.
siameze
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000



View Profile
January 13, 2015, 01:24:33 AM
 #12

Yes, there is, thanks for reminding me.  I'm looking into it, hopefully I'll add basic multisig functionality soon.

Wonderful. This is such a nice lightweight implementation. I daresay this would run on smaller platforms.


                     ▀▀█████████▀████████████████▄
                        ████▄      ▄████████████████
                     ▄██████▀  ▄  ███████████████████
                  ▄█████████▄████▄███████████████████
                ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████
                                               ▀▀███▀
    ▄█▀█       ▄▀  ▄▀▀█  ▄▀   █████████████████▄ ██▀         ▄▀█
   ▄█ ▄▀      ▀█▀ █▀ █▀ ▀█▀  ███████████████████ █▀ ▀▀      ▄▀▄▀
  ▄█    ▄███  █     █   █   ████████████████████  ▄█     ▄▀▀██▀ ▄███
███▄▄▄  █▄▄▄ █▄▄ ▄▄▀   █▄▄ ██████████████████▀▀   █▄▄ ▄▄ █▄▄█▄▄▄█▄▄▄
                           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                            ▀▀█████████████▄
                                █████████████▄
                                  █████████████▄
                                    ▀███████▀▀▀▀▀
                                      ▀████▀
                                        ▀█▀
LetItRideINNOVATIVE ▬▬▬
DICE GAME
                        ▄███████████▄
                       ██  ██████████▄
                     ▄█████████████  ██▄
            ▄▄▀█▄▄▄▄▄████████████████████▄
        ▄▄█▀   ███████████  █████  ████  █
    ▄██████ ▄▄███████████████████████████▀
 ▄▀▀ ██████████████████████████  ████  █
█  ▄███████████▀▀▀█████████████████████
██████████████    ████████▀▀██████  █▀
██████████████▄▄▄██████████   ▀▀▀▀▀▀▀
███▀ ▀██████████████████████
██    ███████████████████████
██▄▄██████████████████████████
██████████████▀   ██████████
  █████████████   ▄██████▀▀
     ▀▀██████████████▀▀
         ▀▀██████▀▀
PROVABLY
F A I R
▄█████████████▀ ▄█
██            ▄█▀
██          ▄██ ▄█
██ ▄█▄    ▄███  ██
██ ▀███▄ ▄███   ██
██  ▀███████    ██
██    █████     ██
██     ███      ██
██      ▀       ██
██              ██
▀████████████████▀
BUY  BACK
PLANS
[BTC]
iphonecoins
Full Member
***
Offline Offline

Activity: 190
Merit: 100


View Profile
January 14, 2015, 02:52:57 PM
 #13

Yes, there is, thanks for reminding me.  I'm looking into it, hopefully I'll add basic multisig functionality soon.

Wonderful. This is such a nice lightweight implementation. I daresay this would run on smaller platforms.


Look really nice and light. It's only for OSX or Linux?! How can I make it run on Windows?
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 509


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
January 14, 2015, 03:53:34 PM
 #14

Look really nice and light. It's only for OSX or Linux?! How can I make it run on Windows?

AFAIK You will have to install dependencies for BitcoinJ and look the guide[1] for running install.sh in windows.

[1] http://stackoverflow.com/questions/16772202/how-to-run-script-sh-in-windows-git-shell

   ~~MZ~~

adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 14, 2015, 04:31:17 PM
 #15

Yes, there is, thanks for reminding me.  I'm looking into it, hopefully I'll add basic multisig functionality soon.

Wonderful. This is such a nice lightweight implementation. I daresay this would run on smaller platforms.


Look really nice and light. It's only for OSX or Linux?! How can I make it run on Windows?

The only reason why there is no installation script currently for it is because I don't have a Windows machine. 

However, it already has the capability to run right away with the caveat that there will be no short alias for it. If you unzip 'termwallet.zip' (which you can get on the github page, link at OP), you will see 'termwallet.bat' in the folder 'termwallet-repo/bin/'.  If you run this in the windows command prompt it should run (untested by me, of course).  Let me know the results!
adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 18, 2015, 02:48:42 AM
 #16

Pushed a new update today. You can now restore a HD wallet with its BIP-39 mnemonic code, here is how to use it:

Code:
restore      Create a wallet based on a BIP-39 mnemonic seed
      Usage: restore [options]
        Options:
          -t, --time
             Replay blockchain starting from this time (UNIX epoch time)
             Default: 1421548754

Example:
$ termwallet restore -t 1409478661
Seed: yard impulse luxury drive today throw farm pepper survey wreck glass federal

Once run, it will prompt you for the 12-word mnemonic code and automatically restore the wallet.  The blockchain is replayed from the time parameter, which defaults to the current time.  It is in the format of UNIX Epoch time (converter here: http://www.epochconverter.com/).  If addresses in the wallet have past transactions, set the time to the first transaction (or, to be safe, a little bit before).
siameze
Legendary
*
Offline Offline

Activity: 1064
Merit: 1000



View Profile
January 18, 2015, 04:02:22 AM
 #17

Pushed a new update today. You can now restore a HD wallet with its BIP-39 mnemonic code, here is how to use it:

Code:
restore      Create a wallet based on a BIP-39 mnemonic seed
      Usage: restore [options]
        Options:
          -t, --time
             Replay blockchain starting from this time (UNIX epoch time)
             Default: 1421548754

Example:
$ termwallet restore -t 1409478661
Seed: yard impulse luxury drive today throw farm pepper survey wreck glass federal

Once run, it will prompt you for the 12-word mnemonic code and automatically restore the wallet.  The blockchain is replayed from the time parameter, which defaults to the current time.  It is in the format of UNIX Epoch time (converter here: http://www.epochconverter.com/).  If addresses in the wallet have past transactions, set the time to the first transaction (or, to be safe, a little bit before).

THIS IS AWESOME!!!  I love the ability to do this straight CLI. I deleted the wallet.dat and restored from seed quickly.


                     ▀▀█████████▀████████████████▄
                        ████▄      ▄████████████████
                     ▄██████▀  ▄  ███████████████████
                  ▄█████████▄████▄███████████████████
                ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀████████
                                               ▀▀███▀
    ▄█▀█       ▄▀  ▄▀▀█  ▄▀   █████████████████▄ ██▀         ▄▀█
   ▄█ ▄▀      ▀█▀ █▀ █▀ ▀█▀  ███████████████████ █▀ ▀▀      ▄▀▄▀
  ▄█    ▄███  █     █   █   ████████████████████  ▄█     ▄▀▀██▀ ▄███
███▄▄▄  █▄▄▄ █▄▄ ▄▄▀   █▄▄ ██████████████████▀▀   █▄▄ ▄▄ █▄▄█▄▄▄█▄▄▄
                           ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄
                            ▀▀█████████████▄
                                █████████████▄
                                  █████████████▄
                                    ▀███████▀▀▀▀▀
                                      ▀████▀
                                        ▀█▀
LetItRideINNOVATIVE ▬▬▬
DICE GAME
                        ▄███████████▄
                       ██  ██████████▄
                     ▄█████████████  ██▄
            ▄▄▀█▄▄▄▄▄████████████████████▄
        ▄▄█▀   ███████████  █████  ████  █
    ▄██████ ▄▄███████████████████████████▀
 ▄▀▀ ██████████████████████████  ████  █
█  ▄███████████▀▀▀█████████████████████
██████████████    ████████▀▀██████  █▀
██████████████▄▄▄██████████   ▀▀▀▀▀▀▀
███▀ ▀██████████████████████
██    ███████████████████████
██▄▄██████████████████████████
██████████████▀   ██████████
  █████████████   ▄██████▀▀
     ▀▀██████████████▀▀
         ▀▀██████▀▀
PROVABLY
F A I R
▄█████████████▀ ▄█
██            ▄█▀
██          ▄██ ▄█
██ ▄█▄    ▄███  ██
██ ▀███▄ ▄███   ██
██  ▀███████    ██
██    █████     ██
██     ███      ██
██      ▀       ██
██              ██
▀████████████████▀
BUY  BACK
PLANS
[BTC]
Muhammed Zakir
Hero Member
*****
Offline Offline

Activity: 560
Merit: 509


I prefer Zakir over Muhammed when mentioning me!


View Profile WWW
January 18, 2015, 06:33:12 AM
 #18

Code:
Usage: restore [options]
        Options:
          -t, --time
             Replay blockchain starting from this time (UNIX epoch time)
             Default: 1421548754

The blockchain is replayed from the time parameter, which defaults to the current time.  It is in the format of UNIX Epoch time (converter here: http://www.epochconverter.com/).  If addresses in the wallet have past transactions, set the time to the first transaction (or, to be safe, a little bit before).

Thanks! I was looking for this feature so long! Is this option also available when restoring address(es)?

   ~~MZ~~

adorno (OP)
Newbie
*
Offline Offline

Activity: 7
Merit: 0


View Profile
January 18, 2015, 05:54:39 PM
 #19

No new features, but just made headway in refactoring the termWallet codebase.  It is now a lot quicker to develop.  See the source code on the github page (https://github.com/grayleonard/termwallet).  My next planned update is adding address labels.

Thanks! I was looking for this feature so long! Is this option also available when restoring address(es)?

   ~~MZ~~

Yes, but it will be a bit more complicated to add.  However, it is an important feature, and something I've planned on adding. I will let you know how it's progressing.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!