Pretty safe bitcoin proof-of-concept wallet with keys on a smartcard

The configuration files
The configration files are in a directory named .smartbtc in the home directory of the user.
There are 2 types of configurationfiless:

- one global configuration file: global.conf
- one for every bitcoinaddress.

The global.conf
The configurationfile global.conf consists of 2 types of lines:

– comments, beginning with #
– <keyword>=<value>

Keywords (case sensitive) are:
– Transactionfee
– Provider-Url
– SendTx-Url
– MaxUnspentLines
– BTCtransactionsDir


# global configurationfile for SmartBtc
# how many miliBTC we want to pay as a fee for a simple transaction
# for a complex transaction (with more inputs) it will be 2..3 times higher
# the Provider URL
# the url where to get the unspent info for the test- and main-network
# the Transaction URL
# the url where to push the transaction for the test- and main- network
# SendTx-Url-Testnet=
# SendTx-Url-Mainnet=
# How many unspent lines on display
MaxUnspentLines = 5
# The directotyname for the transactionfiles (base is homedir)
BTCtransactionsDir = Bitcointransactions

The configuration files (one per key)

The configurationfile consists of 2 types of lines:

– comments, beginning with #
– <keyword>=<value>

Keywords (case sensitive) are:

– Public-key
– Bitcoinadress
– Network
– Key-ID


# configurationfile for SmartBtc
# Public-key: belongs to the ECC private key
# your bitcoinaddress for the test- or main-bitcoinnetwork
# netwok: testnet or mainnet?
# key-id, find this with 'pkcs15-tool -D'.
# Should point to the private ECC key on your smartcard

The configuration filename should have ending .conf:
When starting the programm, it asks for the config-id, that is the filename without the ending .conf. You can name the config-ids like your corresponding key-names, e.g. EC0, EC1 etc., the corresponding config filenames should be EC0.conf, EC1.conf, etc.

The programm

Navigate to Smartbtc Programm, cut & paste the python code in your favorite editor, look if you have everything from "#!/usr/bin/env python3" till "root.mainloop()". If everything is OK, save it as and make it executable with the commandline "chmod u+x". You get debugging information in the terminal window if you set "debug = 1" in the sourcecode ("debug = 0" will suppress it).
To start get some (free) bitcoins from Testnet for your generated testnet Bitcoinaddres. You can get Testnet Bitcoins for free from a Bitcoin Faucet. Search for "Testnet bitcoin faucet" to find one or look at: If you start after you got the unspents from the faucet (on the same address that is is also in the config-file) you should see them in the unspent list! Now you can generate another key with bitcoin address, and make -signed- transactions from one to the other address. And so on...