separate bitcoin related functions from wallet.py