def profile_v3_to_proofs(profile, fqdn, refresh=False, address = None):
    """
        Convert profile format v3 to proofs
    """

    proofs = []

    try:
        test = profile.items()
    except:
        return proofs

    if 'account' in profile:
        accounts = profile['account']
    else:
        return proofs

    for account in accounts:

        # skip if proof service is not supported
        if 'service' in account and account['service'].lower() not in SITES:
            continue

        if 'proofType' in account and account['proofType'] == "http":

            try:
                proof = {"service": account['service'],
                         "proof_url": account['proofUrl'],
                         "identifier": account['identifier'],
                         "valid": False}

                if is_valid_proof(account['service'], account['identifier'],
                                  fqdn, account['proofUrl'], address = address):

                    proof["valid"] = True

                proofs.append(proof)
            except Exception as e:
                pass

    return proofs
Convert profile format v3 to proofs