Utility functions for bitcoin