added get_address logic from counterpartyd