from typing import Dict


def _extract_verification_method(presentation: Dict) -> str:
    """Extract the verification method from the presentation"""
    proof = presentation.get("proof", {})

    for key, value in proof.items():
        if key.endswith("verificationMethod"):
            if isinstance(value, str):
                return value
            elif isinstance(value, dict):
                return value.get("id", "")

    # fail-safe value
    return ""