def addr
      case version
        when Bitcoin.chain_params.bip49_pubkey_p2wpkh_p2sh_version
          key.to_nested_p2wpkh
        when Bitcoin.chain_params.bip84_pubkey_p2wpkh_version
          key.to_p2wpkh
        else
          key.to_p2pkh
      end
    end
def addr
      case version
        when Bitcoin.chain_params.bip49_pubkey_p2wpkh_p2sh_version
          key.to_nested_p2wpkh
        when Bitcoin.chain_params.bip84_pubkey_p2wpkh_version
          key.to_p2wpkh
        else
          key.to_p2pkh
      end
    end
get address