move is_valid from wallet class to bitcoin.py