[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77HAJRTZTYKT5DB62BR2TDY":3,"skill-same:01M77HAJRTZTYKT5DB62BR2TDY":70},{"skillNo":4,"name":5,"nameZh":6,"description":7,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":16,"categories":17,"keywords":18,"publishedAt":19,"linkOnly":20,"markdownContent":21,"markdownBody":22,"frontMatter":23,"refName":48,"commitSha":49,"skillDirectory":50,"forksCount":44,"repositoryHtmlUrl":51,"repositoryHomepageUrl":52,"ownerHtmlUrl":53,"ownerBlogUrl":6,"ownerDescription":54,"updatedAt":55,"install":56,"resources":69},"01M77HAJRTZTYKT5DB62BR2TDY","greenhelix-agent-credential-wallets",null,"Agent Credential Wallets: Verifiable Intent & Delegation Chains. Build agent credential wallets with Verifiable Intent, SD-JWT delegation chains, cross-protocol presentation (AP2\u002FUCP\u002FACP\u002Fx402), eIDAS 2.0 EUDI compliance, and reputation-bound credentials. Includes detailed Python code examples for every pattern.","Lord1Egypt\u002Fawesome-skill-forge","Lord1Egypt","https:\u002F\u002Favatars.githubusercontent.com\u002Fu\u002F99746359?v=4","01M7592YDNT0XK9WJ0T2MQVPDN","Mohamed Mounir Ali AL Keshita","01M75GRFNHC8VZNWEB8DKDE433",3,"MIT","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fg\u002Fgreenhelix-agent-credential-wallets\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: greenhelix-agent-credential-wallets\nversion: \"1.3.1\"\ndescription: \"Agent Credential Wallets: Verifiable Intent & Delegation Chains. Build agent credential wallets with Verifiable Intent, SD-JWT delegation chains, cross-protocol presentation (AP2\u002FUCP\u002FACP\u002Fx402), eIDAS 2.0 EUDI compliance, and reputation-bound credentials. Includes detailed Python code examples for every pattern.\"\nlicense: MIT\ncompatibility: [openclaw]\nauthor: felix-agent\ntype: guide\ntags: [credentials, verifiable-intent, sd-jwt, eidas, delegation, identity, wallets, guide, greenhelix, openclaw, ai-agent]\nprice_usd: 0.0\ncontent_type: markdown\nexecutable: false\ninstall: none\ncredentials: [GREENHELIX_API_KEY]\nmetadata:\n  openclaw:\n    requires:\n      env:\n        - GREENHELIX_API_KEY\n    primaryEnv: GREENHELIX_API_KEY\n---\n# Agent Credential Wallets: Verifiable Intent & Delegation Chains\n\n> **Notice**: This is an educational guide with illustrative code examples.\n> It does not execute code or install dependencies.\n> All examples use the GreenHelix sandbox (https:\u002F\u002Fsandbox.greenhelix.net) which\n> provides 500 free credits — no API key required to get started.\n>\n> **Referenced credentials** (you supply these in your own environment):\n> - `GREENHELIX_API_KEY`: API authentication for GreenHelix gateway (read\u002Fwrite access to purchased API tools only)\n\n\nYour agent just tried to buy cloud compute on behalf of your company. The vendor's agent asked for proof of authorization. Your agent presented an API key. The vendor's agent rejected it -- not because the key was invalid, but because an API key proves nothing about delegation. It does not answer the question the vendor actually asked: \"Can this agent spend up to $5,000 on GPU instances for Acme Corp, and did a human authorize that specific action?\" An API key says \"this entity has access.\" A verifiable credential says \"this entity was authorized by this principal to perform these actions within these constraints, and here is the cryptographic proof chain from the human who approved it.\" That distinction is the entire difference between agents that can transact in the open economy and agents that remain trapped inside their owner's perimeter. On March 5, 2026, Mastercard open-sourced the Verifiable Intent specification alongside Google, Fiserv, IBM, and Checkout.com, defining exactly how agents prove delegated authority to spend. Prove launched Verified Agent targeting the $1.7 trillion agentic commerce market with carrier-grade identity verification for non-human entities. The EU finalized eIDAS 2.0 implementation rules mandating EUDI Wallets by December 2026. Google's Agent-to-Agent Protocol (AP2), the Universal Commerce Protocol (UCP), and OpenAI's Agent Commerce Protocol (ACP) all require verifiable agent identity as the foundation layer. The decentralized identity market hit $7.4 billion in 2026. The convergence is real, and it is happening on a twelve-month timeline. This guide walks you through building a production credential wallet for your agents: SD-JWT-VC issuance, delegation chains from human to agent, cross-protocol credential presentation, eIDAS 2.0 compliance, reputation binding, and fleet-wide deployment. Every implementation uses the GreenHelix A2A Commerce Gateway API. Every pattern is designed for the December 2026 deadline.\n1. [The Agent Credential Problem](#chapter-1-the-agent-credential-problem)\n2. [W3C Verifiable Credentials & SD-JWT Primer](#chapter-2-w3c-verifiable-credentials--sd-jwt-primer)\n\n## What You'll Learn\n- Chapter 1: The Agent Credential Problem\n- Chapter 2: W3C Verifiable Credentials & SD-JWT Primer\n- Chapter 3: Building Your Agent's Credential Wallet\n- Chapter 4: Implementing Verifiable Intent\n- Chapter 5: Cross-Protocol Credential Presentation\n- Chapter 6: eIDAS 2.0 Compliance\n- Chapter 7: Trust Scoring, Reputation Binding & Credential Revocation\n- Next Steps\n- What You Get\n\n## Full Guide\n\n# Agent Credential Wallets: Verifiable Intent & Delegation Chains for Agentic Commerce\n\nYour agent just tried to buy cloud compute on behalf of your company. The vendor's agent asked for proof of authorization. Your agent presented an API key. The vendor's agent rejected it -- not because the key was invalid, but because an API key proves nothing about delegation. It does not answer the question the vendor actually asked: \"Can this agent spend up to $5,000 on GPU instances for Acme Corp, and did a human authorize that specific action?\" An API key says \"this entity has access.\" A verifiable credential says \"this entity was authorized by this principal to perform these actions within these constraints, and here is the cryptographic proof chain from the human who approved it.\" That distinction is the entire difference between agents that can transact in the open economy and agents that remain trapped inside their owner's perimeter. On March 5, 2026, Mastercard open-sourced the Verifiable Intent specification alongside Google, Fiserv, IBM, and Checkout.com, defining exactly how agents prove delegated authority to spend. Prove launched Verified Agent targeting the $1.7 trillion agentic commerce market with carrier-grade identity verification for non-human entities. The EU finalized eIDAS 2.0 implementation rules mandating EUDI Wallets by December 2026. Google's Agent-to-Agent Protocol (AP2), the Universal Commerce Protocol (UCP), and OpenAI's Agent Commerce Protocol (ACP) all require verifiable agent identity as the foundation layer. The decentralized identity market hit $7.4 billion in 2026. The convergence is real, and it is happening on a twelve-month timeline. This guide walks you through building a production credential wallet for your agents: SD-JWT-VC issuance, delegation chains from human to agent, cross-protocol credential presentation, eIDAS 2.0 compliance, reputation binding, and fleet-wide deployment. Every implementation uses the GreenHelix A2A Commerce Gateway API. Every pattern is designed for the December 2026 deadline.\n\n---\n\n## Table of Contents\n\n1. [The Agent Credential Problem](#chapter-1-the-agent-credential-problem)\n2. [W3C Verifiable Credentials & SD-JWT Primer](#chapter-2-w3c-verifiable-credentials--sd-jwt-primer)\n3. [Building Your Agent's Credential Wallet](#chapter-3-building-your-agents-credential-wallet)\n4. [Implementing Verifiable Intent](#chapter-4-implementing-verifiable-intent)\n5. [Cross-Protocol Credential Presentation](#chapter-5-cross-protocol-credential-presentation)\n6. [eIDAS 2.0 Compliance](#chapter-6-eidas-20-compliance)\n7. [Trust Scoring, Reputation Binding & Credential Revocation](#chapter-7-trust-scoring-reputation-binding--credential-revocation)\n\n---\n\n## Chapter 1: The Agent Credential Problem\n\n### Why API Keys and OAuth Tokens Break Under Delegation\n\nAPI keys are bearer tokens. They prove possession, not authorization. When Agent A presents an API key to Agent B, Agent B knows that Agent A has a valid key. Agent B does not know who issued the key, what actions the key authorizes, whether the key can be further delegated, what spending limits apply, or whether a human ever approved the transaction that Agent A is attempting. OAuth 2.0 improves on this by introducing scopes and token lifetimes, but OAuth was designed for a three-party model: a user, a client application, and a resource server. Agentic commerce operates in a four-party model at minimum: a human principal, a delegating agent, a transacting agent, and a counterparty agent. OAuth has no native concept of delegation chains, spending constraints that propagate through layers, or verifiable proof that the token holder was authorized by a specific upstream principal.\n\nThe failure modes are concrete:\n\n- **Stolen key replay**: A leaked API key gives the attacker the same permissions as the legitimate agent. There is no cryptographic binding between the key and the entity presenting it.\n- **Scope inflation**: An agent granted \"read marketplace\" scope uses that token to call `create_intent` because the token endpoint does not distinguish between marketplace reads and payment actions at the granularity commerce requires.\n- **Delegation opacity**: Agent A delegates to Agent B using a sub-key. Agent B delegates to Agent C. The vendor interacting with Agent C has no way to verify the chain back to the original human who authorized the spend.\n- **Constraint evaporation**: A human sets a $500 daily limit. The limit is stored in Agent A's configuration. When Agent A delegates to Agent B, the limit is not cryptographically bound to the delegation -- Agent B's spending constraints are whatever Agent B chooses to enforce locally.\n\n### The Four-Party Model Failure\n\nTraditional payment rails use a four-party model: cardholder, merchant, issuing bank, acquiring bank. Every party has a defined role, and trust flows through the card network as an intermediary. Agentic commerce broke this model because the \"cardholder\" is now an AI agent acting on behalf of a human, the \"merchant\" is another AI agent, and neither the issuing bank nor the acquiring bank has any mechanism to verify that the agent-cardholder was authorized by the human-principal.\n\n```\nTRADITIONAL FOUR-PARTY MODEL\n┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐\n│  Human   │───>│ Issuing │───>│  Card   │───>│Acquiring│───>│ Merchant│\n│(Cardhldr)│    │  Bank   │    │ Network │    │  Bank   │    │         │\n└─────────┘    └─────────┘    └─────────┘    └─────────┘    └─────────┘\n     │ Identity verified        Trust mediated         Identity verified\n     │ via KYC + PIN            by network rules       via merchant agreement\n\nAGENTIC FOUR-PARTY MODEL (BROKEN)\n┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐\n│  Human   │ ??>│ Agent A │ ??>│ Gateway │ ??>│ Agent B │\n│(Principal│    │(Delegat.)│    │(Network)│    │(Vendor) │\n└─────────┘    └─────────┘    └─────────┘    └─────────┘\n     │ How does Agent A         No delegation       How does Agent B\n     │ prove human approved?    chain verification  verify constraints?\n```\n\nThe question marks are the credential gap. No API key, OAuth token, or session cookie answers the three questions every counterparty needs answered: (1) Who is the human principal? (2) What did they authorize? (3) What are the constraints?\n\n### Protocol Convergence: Mastercard, Google, OpenAI\n\nThree separate industry efforts converged on the same answer in the first quarter of 2026:\n\n**Mastercard Verifiable Intent (March 5, 2026)**: Open-sourced with Google, Fiserv, IBM, and Checkout.com. Defines how an agent proves that a human authorized a specific payment action, including amount limits, merchant categories, and time bounds. Uses SD-JWT-VC (Selective Disclosure JSON Web Token Verifiable Credential) as the credential format and DID:web as the identity anchor.\n\n**Google AP2 + Universal Commerce Protocol (UCP)**: Google's agent-to-agent protocol requires agents to present verifiable identity before any commercial transaction. UCP extends this with standardized credential presentation flows for cross-platform commerce. Both protocols accept W3C Verifiable Credentials in SD-JWT format.\n\n**OpenAI Agent Commerce Protocol (ACP)**: Defines how agents discover, negotiate, and transact with each other. The identity layer requires verifiable credentials for any transaction above a configurable threshold. ACP's credential requirements align with the W3C VC Data Model 2.0 and accept SD-JWT-VC as a presentation format.\n\nThe convergence is not accidental. All three groups independently identified the same gap: agents need cryptographically verifiable delegation chains, not just access tokens. The answer they all arrived at was W3C Verifiable Credentials with selective disclosure.\n\n| Protocol | Organization | Credential Format | Identity Anchor | Delegation Model |\n|----------|-------------|-------------------|-----------------|------------------|\n| Verifiable Intent | Mastercard + consortium | SD-JWT-VC | DID:web | Layered issuance |\n| AP2 \u002F UCP | Google | W3C VC (SD-JWT) | DID:web \u002F DID:key | Presentation exchange |\n| ACP | OpenAI | W3C VC (SD-JWT) | DID:key | Chained credentials |\n| x402 | Open standard | W3C VC (optional) | DID:web | Payment-bound proofs |\n\n### The $1.7 Trillion Market Context\n\nThe numbers define the urgency. Prove's Verified Agent launch targeted the $1.7 trillion agentic commerce market -- transactions where at least one party is an autonomous agent. Gartner projected that by the end of 2026, 30% of enterprise API traffic will be agent-originated, up from under 5% in 2024. The decentralized identity market reached $7.4 billion in 2026, driven primarily by agent identity requirements that existing IAM systems cannot address. McKinsey's March 2026 analysis estimated that credential-related transaction failures cost the agentic commerce ecosystem $2.3 billion annually in abandoned transactions, dispute resolution overhead, and fraud losses.\n\nThe cost of inaction is measurable. Every agent transaction that fails because the counterparty cannot verify delegation authority is a lost revenue event. Every disputed escrow that could have been prevented by a verifiable spending limit is an operational cost. Every EU transaction that lacks EUDI-compliant credentials after December 2026 is a regulatory violation. The credential wallet is not optional infrastructure -- it is the authorization layer that makes agent commerce possible at scale.\n\n### What This Guide Builds\n\nBy the end of this guide, your agents will have:\n\n1. A DID-anchored credential wallet managed through GreenHelix identity tools\n2. SD-JWT delegation chains that cryptographically bind human authorization to agent actions\n3. Credential presentation adapters for AP2, UCP, ACP, and x402\n4. eIDAS 2.0 compliant EUDI wallet integration for EU commerce\n5. Reputation-bound credentials with real-time revocation\n6. Fleet-wide issuance, rotation, and monitoring for production deployment\n\n---\n\n## Chapter 2: W3C Verifiable Credentials & SD-JWT Primer\n\n### Credential Anatomy\n\nA Verifiable Credential (VC) is a tamper-evident data structure with three components:\n\n**Credential metadata**: Who issued it, when, when it expires, what type it is. This is not the claims themselves -- it is the envelope that lets a verifier understand what they are looking at before examining the contents.\n\n**Claims (the subject)**: The actual assertions. \"Agent acme-buyer-01 is authorized to spend up to $5,000 per transaction on cloud compute services.\" Claims can be about identity (this agent is registered to Acme Corp), capability (this agent can purchase compute), or constraint (this agent's spending limit is $5,000).\n\n**Proof**: The cryptographic mechanism that makes the credential tamper-evident. For SD-JWT-VC, this is a JSON Web Signature (JWS) over the credential payload plus disclosure digests. The proof binds the claims to the issuer's key -- if any claim is modified, the signature verification fails.\n\n```\nVERIFIABLE CREDENTIAL STRUCTURE\n┌────────────────────────────────────────────────┐\n│  CREDENTIAL METADATA                           │\n│  ├── issuer: did:web:acme.com                  │\n│  ├── issuanceDate: 2026-04-06T00:00:00Z        │\n│  ├── expirationDate: 2026-04-07T00:00:00Z      │\n│  └── type: [VerifiableCredential,              │\n│             AgentDelegationCredential]          │\n├────────────────────────────────────────────────┤\n│  CLAIMS (credentialSubject)                    │\n│  ├── id: did:key:z6Mkw...  (agent DID)        │\n│  ├── delegatedBy: did:web:acme.com             │\n│  ├── authorizedActions: [purchase_compute]     │\n│  ├── spendingLimit: {amount: 5000, currency:   │\n│  │                    USD, period: transaction} │\n│  └── merchantCategory: [cloud_compute]         │\n├────────────────────────────────────────────────┤\n│  PROOF                                         │\n│  ├── type: JsonWebSignature2020                │\n│  ├── verificationMethod: did:web:acme.com#key1 │\n│  └── jws: eyJhbGciOiJFZERTQSJ9...             │\n└────────────────────────────────────────────────┘\n```\n\n### Selective Disclosure with SD-JWT\n\nStandard JWTs are all-or-nothing: you present the entire token or nothing. An agent buying cloud compute should not have to reveal its owner's full legal name, tax ID, and home address to a vendor agent that only needs to verify spending authorization. Selective Disclosure JWT (SD-JWT) solves this by replacing sensitive claims with salted hashes in the JWT body. The actual claim values are carried as separate \"disclosures\" that the holder can choose to include or omit at presentation time.\n\nThe SD-JWT structure has three parts separated by tildes (`~`):\n\n```\n\u003Cissuer-signed JWT> ~ \u003Cdisclosure 1> ~ \u003Cdisclosure 2> ~ ... ~ \u003Ckey binding JWT>\n```\n\n**Issuer-signed JWT**: Contains the credential metadata and hashed digests of all disclosable claims in an `_sd` array. The issuer signs this part. It is always present.\n\n**Disclosures**: Each disclosure is a base64url-encoded JSON array of `[salt, claim_name, claim_value]`. The holder includes only the disclosures they want the verifier to see. The verifier hashes each received disclosure and checks it against the `_sd` digests in the JWT to confirm it was issued by the original issuer.\n\n**Key Binding JWT**: An optional JWT signed by the holder's key that proves the presenter is the intended holder, not someone who intercepted the SD-JWT in transit. For agent credentials, key binding is mandatory -- without it, a stolen credential can be replayed by any agent.\n\n```\nSD-JWT SELECTIVE DISCLOSURE FLOW\n\nISSUANCE (all claims included):\n┌──────────────────────────┐\n│ Issuer signs JWT with    │     ┌─────────────┐\n│ _sd: [hash1, hash2,     │────>│ Agent Wallet │\n│       hash3, hash4]      │     │ stores full  │\n│                          │     │ SD-JWT + all │\n│ + disclosure(owner_name) │     │ disclosures  │\n│ + disclosure(tax_id)     │     └─────────────┘\n│ + disclosure(spend_limit)│\n│ + disclosure(actions)    │\n└──────────────────────────┘\n\nPRESENTATION (selective):\n┌─────────────┐     ┌──────────────────────────┐\n│ Agent Wallet │────>│ JWT (with all 4 hashes)  │\n│ reveals only │     │ + disclosure(spend_limit) │\n│ 2 of 4      │     │ + disclosure(actions)     │\n│ claims       │     │ + key_binding_jwt         │\n└─────────────┘     └──────────────────────────┘\n                    Verifier sees spend_limit & actions.\n                    Cannot derive owner_name or tax_id\n                    (only hashes remain in the JWT).\n```\n\n### SD-JWT-VC Format for Agent Credentials\n\nSD-JWT-VC is the specific profile of SD-JWT designed for Verifiable Credentials. It is the format chosen by Mastercard's Verifiable Intent spec, accepted by Google AP2 and OpenAI ACP, and mandated by the EU's eIDAS 2.0 Architecture Reference Framework for EUDI Wallet credentials.\n\nThe key properties of SD-JWT-VC for agent developers:\n\n- **`iss`**: The issuer's identifier, typically a DID:web URL that resolves to a DID Document containing the issuer's public key.\n- **`sub`**: The subject of the credential -- the agent's DID.\n- **`iat`** \u002F **`exp`**: Issuance and expiration timestamps. For agent delegation credentials, expiration should be short (hours, not months).\n- **`cnf`**: Confirmation claim that binds the credential to the holder's key. Contains the holder's public key or a reference to it. This is what enables key binding.\n- **`_sd`**: Array of digests for selectively disclosable claims.\n- **`vct`**: Verifiable Credential Type -- a URI identifying the credential schema (e.g., `https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fagent-delegation\u002Fv1`).\n\n### Delegation Chains as Layered SD-JWT Issuance\n\nA delegation chain is a sequence of credentials where each credential's subject becomes the issuer of the next credential. The human principal issues a credential to their primary agent. That agent issues a sub-credential to a sub-agent, with equal or narrower constraints. The sub-agent can issue further sub-credentials, each layer narrowing the scope.\n\n```\nDELEGATION CHAIN (3 LAYERS)\n\nLayer 0: Human Principal\n  └── Issues VC to Agent A\n      iss: did:web:alice.com\n      sub: did:key:agentA\n      spend_limit: $10,000\u002Fday\n      actions: [purchase_compute, purchase_storage]\n\nLayer 1: Agent A\n  └── Issues VC to Agent B (sub-delegation)\n      iss: did:key:agentA\n      sub: did:key:agentB\n      spend_limit: $2,000\u002Ftransaction  (narrowed from $10k\u002Fday)\n      actions: [purchase_compute]       (narrowed from 2 actions)\n      parent_credential: \u003Chash of Layer 0 VC>\n\nLayer 2: Agent B\n  └── Presents to Vendor Agent C\n      Includes: Layer 2 VC + Layer 1 VC + Layer 0 VC\n      Vendor verifies entire chain back to did:web:alice.com\n```\n\nThe critical property is **constraint narrowing**: each layer can only narrow the constraints of its parent. Agent A received a $10,000\u002Fday limit and cannot issue Agent B a $20,000\u002Fday credential. Agent A received two authorized actions and cannot grant Agent B a third action. The verifier checks this by walking the chain from leaf to root and confirming that every child credential's constraints are a subset of its parent's.\n\n---\n\n## Chapter 3: Building Your Agent's Credential Wallet\n\n### Prerequisites\n\nYou need a GreenHelix API key with pro tier access (identity tools `build_claim_chain`, `search_agents_by_metrics`, and `submit_metrics` require pro tier). Register an agent identity and create a wallet before building credentials.\n\n### The CredentialWallet Class\n\n```python\nimport requests\nimport json\nimport hashlib\nimport time\nimport base64\nimport secrets\nfrom typing import Optional, Dict, List, Any\nfrom dataclasses import dataclass, field, asdict\n\n# --- GreenHelix sandbox session (free tier: 500 credits, no key required) ---\n# To get started, visit https:\u002F\u002Fsandbox.greenhelix.net — no signup needed.\n# For production, set GREENHELIX_API_KEY in your environment.\nimport os\n\nAPI_BASE = os.environ.get(\"GREENHELIX_API_URL\", \"https:\u002F\u002Fsandbox.greenhelix.net\")\n\nsession = requests.Session()\napi_key = os.environ.get(\"GREENHELIX_API_KEY\", \"\")\nif api_key:\n    session.headers[\"Authorization\"] = f\"Bearer {api_key}\"\nsession.headers[\"Content-Type\"] = \"application\u002Fjson\"\n\n\ndef api_call(tool: str, input_data: dict) -> dict:\n    \"\"\"Call a GreenHelix REST endpoint for the given tool.\"\"\"\n    response = session.post(f\"{API_BASE}\u002Fv1\u002Ftools\u002F{tool}\", json=input_data)\n    response.raise_for_status()\n    return response.json()\n\n\n@dataclass\nclass Disclosure:\n    \"\"\"A single SD-JWT disclosure: [salt, claim_name, claim_value].\"\"\"\n    salt: str\n    claim_name: str\n    claim_value: Any\n\n    def encode(self) -> str:\n        \"\"\"Base64url-encode the disclosure array.\"\"\"\n        payload = json.dumps([self.salt, self.claim_name, self.claim_value])\n        return base64.urlsafe_b64encode(payload.encode()).rstrip(b\"=\").decode()\n\n    def digest(self) -> str:\n        \"\"\"SHA-256 digest of the encoded disclosure.\"\"\"\n        encoded = self.encode()\n        return base64.urlsafe_b64encode(\n            hashlib.sha256(encoded.encode()).digest()\n        ).rstrip(b\"=\").decode()\n\n\n@dataclass\nclass AgentCredential:\n    \"\"\"An SD-JWT-VC credential with selective disclosure support.\"\"\"\n    issuer_did: str\n    subject_did: str\n    credential_type: str\n    claims: Dict[str, Any]\n    disclosable_claims: List[str]  # claim names that support selective disclosure\n    issued_at: float = field(default_factory=time.time)\n    expires_at: Optional[float] = None\n    parent_hash: Optional[str] = None  # hash of parent credential in chain\n    disclosures: List[Disclosure] = field(default_factory=list)\n\n    def __post_init__(self):\n        if self.expires_at is None:\n            self.expires_at = self.issued_at + 86400  # 24h default\n        # Generate disclosures for disclosable claims\n        self.disclosures = []\n        for name in self.disclosable_claims:\n            if name in self.claims:\n                self.disclosures.append(Disclosure(\n                    salt=secrets.token_urlsafe(16),\n                    claim_name=name,\n                    claim_value=self.claims[name],\n                ))\n\n    def sd_digests(self) -> List[str]:\n        \"\"\"Compute _sd array of disclosure digests.\"\"\"\n        return [d.digest() for d in self.disclosures]\n\n    def jwt_payload(self) -> dict:\n        \"\"\"Build the issuer-signed JWT payload.\"\"\"\n        payload = {\n            \"iss\": self.issuer_did,\n            \"sub\": self.subject_did,\n            \"iat\": int(self.issued_at),\n            \"exp\": int(self.expires_at),\n            \"vct\": self.credential_type,\n            \"_sd\": self.sd_digests(),\n            \"_sd_alg\": \"sha-256\",\n        }\n        # Include non-disclosable claims directly\n        for name, value in self.claims.items():\n            if name not in self.disclosable_claims:\n                payload[name] = value\n        if self.parent_hash:\n            payload[\"parent_credential\"] = self.parent_hash\n        return payload\n\n    def present(self, disclosed_claims: List[str]) -> dict:\n        \"\"\"Create a presentation with only the specified claims disclosed.\"\"\"\n        selected = [d for d in self.disclosures if d.claim_name in disclosed_claims]\n        return {\n            \"jwt_payload\": self.jwt_payload(),\n            \"disclosures\": [d.encode() for d in selected],\n            \"disclosed_values\": {\n                d.claim_name: d.claim_value for d in selected\n            },\n        }\n\n    def credential_hash(self) -> str:\n        \"\"\"SHA-256 hash of the credential payload for chain linking.\"\"\"\n        payload_bytes = json.dumps(self.jwt_payload(), sort_keys=True).encode()\n        return hashlib.sha256(payload_bytes).hexdigest()\n\n\nclass CredentialWallet:\n    \"\"\"Agent credential wallet backed by GreenHelix identity tools.\n\n    Manages the full credential lifecycle: registration, wallet creation,\n    credential issuance, chain building, and selective presentation.\n    \"\"\"\n\n    def __init__(self, agent_id: str, display_name: str, owner: str):\n        self.agent_id = agent_id\n        self.display_name = display_name\n        self.owner = owner\n        self.wallet_id: Optional[str] = None\n        self.did: Optional[str] = None\n        self.credentials: Dict[str, AgentCredential] = {}\n        self.chain_ids: List[str] = []\n\n    def register(self) -> dict:\n        \"\"\"Register the agent identity on GreenHelix.\n\n        This creates the agent's DID and registers its public key.\n        Must be called before any other wallet operation.\n        \"\"\"\n        result = api_call(\"register_agent\", {\n            \"agent_id\": self.agent_id,\n            \"display_name\": self.display_name,\n            \"owner\": self.owner,\n        })\n        self.did = f\"did:key:{self.agent_id}\"\n        return result\n\n    def create_wallet(self) -> dict:\n        \"\"\"Create the agent's credential wallet (on-chain store).\n\n        The wallet is a DID-anchored credential store that holds\n        issued credentials and supports selective disclosure presentation.\n        \"\"\"\n        result = api_call(\"create_wallet\", {\n            \"agent_id\": self.agent_id,\n            \"wallet_type\": \"credential\",\n            \"metadata\": {\n                \"owner\": self.owner,\n                \"did\": self.did,\n                \"created_at\": time.time(),\n            },\n        })\n        self.wallet_id = result.get(\"wallet_id\", f\"wallet-{self.agent_id}\")\n        return result\n\n    def issue_credential(\n        self,\n        credential_id: str,\n        subject_did: str,\n        credential_type: str,\n        claims: Dict[str, Any],\n        disclosable_claims: List[str],\n        ttl_seconds: int = 86400,\n        parent_credential_id: Optional[str] = None,\n    ) -> AgentCredential:\n        \"\"\"Issue an SD-JWT-VC credential to a subject.\n\n        Args:\n            credential_id: Unique ID for this credential.\n            subject_did: DID of the agent receiving the credential.\n            credential_type: VC type URI.\n            claims: All claims to include.\n            disclosable_claims: Claim names that support selective disclosure.\n            ttl_seconds: Credential lifetime in seconds.\n            parent_credential_id: ID of parent credential for delegation chains.\n\n        Returns:\n            The issued AgentCredential object.\n        \"\"\"\n        parent_hash = None\n        if parent_credential_id and parent_credential_id in self.credentials:\n            parent_hash = self.credentials[parent_credential_id].credential_hash()\n\n        credential = AgentCredential(\n            issuer_did=self.did,\n            subject_did=subject_did,\n            credential_type=credential_type,\n            claims=claims,\n            disclosable_claims=disclosable_claims,\n            expires_at=time.time() + ttl_seconds,\n            parent_hash=parent_hash,\n        )\n        self.credentials[credential_id] = credential\n        return credential\n\n    def build_chain(self) -> dict:\n        \"\"\"Build a Merkle claim chain over all issued credentials.\n\n        This anchors the credential history in a tamper-evident structure.\n        Uses GreenHelix build_claim_chain to create the chain.\n        \"\"\"\n        # Prepare claims from all credentials\n        chain_claims = []\n        for cred_id, cred in self.credentials.items():\n            chain_claims.append({\n                \"credential_id\": cred_id,\n                \"credential_hash\": cred.credential_hash(),\n                \"subject\": cred.subject_did,\n                \"type\": cred.credential_type,\n                \"issued_at\": cred.issued_at,\n                \"expires_at\": cred.expires_at,\n            })\n\n        result = api_call(\"build_claim_chain\", {\n            \"agent_id\": self.agent_id,\n            \"claims\": chain_claims,\n            \"chain_type\": \"credential_issuance\",\n        })\n        if \"chain_id\" in result:\n            self.chain_ids.append(result[\"chain_id\"])\n        return result\n\n    def get_chains(self) -> dict:\n        \"\"\"Retrieve all claim chains for this agent.\"\"\"\n        return api_call(\"get_claim_chains\", {\n            \"agent_id\": self.agent_id,\n        })\n\n    def present_credential(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n    ) -> dict:\n        \"\"\"Create a selective disclosure presentation.\n\n        Args:\n            credential_id: The credential to present.\n            disclosed_claims: Which claims to reveal.\n\n        Returns:\n            Presentation object with JWT payload and selected disclosures.\n        \"\"\"\n        if credential_id not in self.credentials:\n            raise KeyError(f\"Credential {credential_id} not found in wallet\")\n        return self.credentials[credential_id].present(disclosed_claims)\n```\n\n### Registering and Creating a Wallet\n\n```python\n# Initialize the wallet for a procurement agent\nwallet = CredentialWallet(\n    agent_id=\"acme-procurement-01\",\n    display_name=\"Acme Procurement Agent #1\",\n    owner=\"alice@acme.com\",\n)\n\n# Step 1: Register the agent identity\nregistration = wallet.register()\nprint(f\"Agent registered: {wallet.did}\")\n# Output: Agent registered: did:key:acme-procurement-01\n\n# Step 2: Create the credential wallet\nwallet_result = wallet.create_wallet()\nprint(f\"Wallet created: {wallet.wallet_id}\")\n# Output: Wallet created: wallet-acme-procurement-01\n```\n\n### Issuing Your First Credential\n\n```python\n# The organization (human principal) issues a delegation credential\n# to the procurement agent\ndelegation_cred = wallet.issue_credential(\n    credential_id=\"delegation-001\",\n    subject_did=\"did:key:acme-procurement-01\",\n    credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fagent-delegation\u002Fv1\",\n    claims={\n        \"delegated_by\": \"did:web:acme.com\",\n        \"authorized_actions\": [\"purchase_compute\", \"purchase_storage\"],\n        \"spending_limit\": {\"amount\": \"10000\", \"currency\": \"USD\", \"period\": \"day\"},\n        \"merchant_categories\": [\"cloud_compute\", \"cloud_storage\"],\n        \"principal_name\": \"Alice Chen\",\n        \"principal_tax_id\": \"XX-XXXXXXX\",\n        \"organization\": \"Acme Corp\",\n    },\n    disclosable_claims=[\n        \"principal_name\",\n        \"principal_tax_id\",\n        \"spending_limit\",\n        \"merchant_categories\",\n    ],\n    ttl_seconds=28800,  # 8-hour session credential\n)\n\nprint(f\"Credential issued. Hash: {delegation_cred.credential_hash()[:16]}...\")\nprint(f\"SD digests: {len(delegation_cred.sd_digests())} disclosable claims\")\n```\n\n### Anchoring Credentials in a Claim Chain\n\n```python\n# After issuing credentials, anchor them in a Merkle claim chain\nchain_result = wallet.build_chain()\nprint(f\"Chain built: {chain_result}\")\n\n# Verify chains are retrievable\nchains = wallet.get_chains()\nprint(f\"Active chains: {len(chains.get('chains', []))}\")\n```\n\n---\n\n## Chapter 4: Implementing Verifiable Intent\n\n### What Verifiable Intent Means\n\nVerifiable Intent (VI) is the Mastercard-originated specification that answers one question: \"Did a human authorize this agent to perform this specific financial action?\" It is not a general-purpose credential -- it is specifically designed for payment authorization in agentic commerce. The VI specification defines a layered issuance model where a human creates an intent declaration, the intent is bound to an agent's credential, and the credential is presented to a counterparty as proof of authorization.\n\nThe three components of Verifiable Intent:\n\n1. **Intent Declaration**: A structured statement of what the human authorizes. \"I authorize Agent acme-procurement-01 to purchase cloud compute services up to $5,000 per transaction from providers in the cloud_compute merchant category, valid for the next 8 hours.\"\n\n2. **Intent Binding**: The intent declaration is cryptographically bound to the agent's credential using SD-JWT layered issuance. The intent becomes a claim in the agent's delegation credential.\n\n3. **Intent Verification**: The counterparty agent verifies the delegation chain from the presenting agent back to the human principal's DID, checks that the intent constraints match the requested transaction, and confirms that the credential has not expired or been revoked.\n\n### Session-Level Spending Limits\n\nThe most common VI use case is spending limits. A human authorizes an agent to spend up to X dollars within a session. The session has a start time and an end time. Every transaction the agent makes within that session must fit within the remaining budget.\n\n```python\nclass VerifiableIntentManager:\n    \"\"\"Manages Verifiable Intent credentials for payment authorization.\n\n    Implements the Mastercard VI specification with GreenHelix tools:\n    intent declaration, binding, session limits, and chain verification.\n    \"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.active_intents: Dict[str, dict] = {}\n        self.session_spent: Dict[str, float] = {}\n\n    def declare_intent(\n        self,\n        intent_id: str,\n        authorized_actions: List[str],\n        spending_limit_usd: float,\n        merchant_categories: List[str],\n        session_hours: float = 8.0,\n        additional_constraints: Optional[Dict] = None,\n    ) -> AgentCredential:\n        \"\"\"Declare a Verifiable Intent and bind it to the agent's credential.\n\n        This is called by (or on behalf of) the human principal to authorize\n        the agent for specific financial actions within constraints.\n\n        Args:\n            intent_id: Unique identifier for this intent session.\n            authorized_actions: Actions the agent may perform.\n            spending_limit_usd: Maximum USD the agent can spend in this session.\n            merchant_categories: Allowed merchant\u002Fservice categories.\n            session_hours: Session duration in hours.\n            additional_constraints: Extra constraints (region, vendor whitelist, etc).\n\n        Returns:\n            The issued intent credential.\n        \"\"\"\n        now = time.time()\n        session_end = now + (session_hours * 3600)\n\n        intent_claims = {\n            \"intent_type\": \"payment_authorization\",\n            \"authorized_actions\": authorized_actions,\n            \"spending_limit\": {\n                \"amount\": str(spending_limit_usd),\n                \"currency\": \"USD\",\n                \"period\": \"session\",\n            },\n            \"merchant_categories\": merchant_categories,\n            \"session_start\": now,\n            \"session_end\": session_end,\n            \"principal_did\": f\"did:web:{self.wallet.owner.split('@')[1]}\",\n            \"principal_email\": self.wallet.owner,\n        }\n        if additional_constraints:\n            intent_claims[\"constraints\"] = additional_constraints\n\n        # Issue as SD-JWT-VC -- principal email is disclosable,\n        # spending limit and actions are always visible to verifiers\n        credential = self.wallet.issue_credential(\n            credential_id=intent_id,\n            subject_did=self.wallet.did,\n            credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fverifiable-intent\u002Fv1\",\n            claims=intent_claims,\n            disclosable_claims=[\"principal_email\", \"constraints\"],\n            ttl_seconds=int(session_hours * 3600),\n        )\n\n        self.active_intents[intent_id] = {\n            \"credential\": credential,\n            \"spending_limit\": spending_limit_usd,\n            \"session_end\": session_end,\n        }\n        self.session_spent[intent_id] = 0.0\n\n        return credential\n\n    def check_intent_budget(self, intent_id: str, amount_usd: float) -> dict:\n        \"\"\"Check if a transaction fits within the intent's remaining budget.\n\n        Returns:\n            Dict with 'authorized' bool, 'remaining' float, and 'reason' if denied.\n        \"\"\"\n        if intent_id not in self.active_intents:\n            return {\"authorized\": False, \"remaining\": 0, \"reason\": \"Intent not found\"}\n\n        intent = self.active_intents[intent_id]\n        if time.time() > intent[\"session_end\"]:\n            return {\"authorized\": False, \"remaining\": 0, \"reason\": \"Session expired\"}\n\n        spent = self.session_spent.get(intent_id, 0.0)\n        remaining = intent[\"spending_limit\"] - spent\n\n        if amount_usd > remaining:\n            return {\n                \"authorized\": False,\n                \"remaining\": remaining,\n                \"reason\": f\"Amount ${amount_usd} exceeds remaining budget ${remaining}\",\n            }\n\n        return {\"authorized\": True, \"remaining\": remaining - amount_usd}\n\n    def execute_authorized_payment(\n        self,\n        intent_id: str,\n        vendor_agent_id: str,\n        amount_usd: float,\n        description: str,\n    ) -> dict:\n        \"\"\"Execute a payment action under a Verifiable Intent session.\n\n        Checks the budget, creates an intent via GreenHelix, and records the spend.\n        \"\"\"\n        # Step 1: Check budget\n        budget_check = self.check_intent_budget(intent_id, amount_usd)\n        if not budget_check[\"authorized\"]:\n            return {\"status\": \"denied\", \"reason\": budget_check[\"reason\"]}\n\n        # Step 2: Create the payment intent via GreenHelix\n        intent_result = api_call(\"create_intent\", {\n            \"from_agent\": self.wallet.agent_id,\n            \"to_agent\": vendor_agent_id,\n            \"amount\": str(amount_usd),\n            \"currency\": \"USD\",\n            \"description\": description,\n            \"metadata\": {\n                \"vi_session\": intent_id,\n                \"credential_hash\": self.active_intents[intent_id][\n                    \"credential\"\n                ].credential_hash(),\n            },\n        })\n\n        # Step 3: Record the spend against the session budget\n        self.session_spent[intent_id] = (\n            self.session_spent.get(intent_id, 0.0) + amount_usd\n        )\n\n        return {\n            \"status\": \"authorized\",\n            \"intent_result\": intent_result,\n            \"remaining_budget\": budget_check[\"remaining\"] - amount_usd,\n        }\n```\n\n### Using Verifiable Intent\n\n```python\n# Create the wallet and intent manager\nwallet = CredentialWallet(\n    agent_id=\"acme-buyer-01\",\n    display_name=\"Acme Cloud Buyer\",\n    owner=\"alice@acme.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\nvi_manager = VerifiableIntentManager(wallet)\n\n# Human declares intent: authorize the agent for cloud purchases\nintent_cred = vi_manager.declare_intent(\n    intent_id=\"session-2026-04-06-001\",\n    authorized_actions=[\"purchase_compute\"],\n    spending_limit_usd=5000.00,\n    merchant_categories=[\"cloud_compute\"],\n    session_hours=8.0,\n    additional_constraints={\"region\": \"us-east\", \"max_per_tx\": \"2000\"},\n)\nprint(f\"Intent declared. Expires: {intent_cred.expires_at}\")\n\n# Agent executes a purchase within the intent\npayment = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=1500.00,\n    description=\"8x A100 GPU instances, 4 hours\",\n)\nprint(f\"Payment: {payment['status']}, remaining: ${payment['remaining_budget']}\")\n# Output: Payment: authorized, remaining: $3500.0\n\n# Second purchase\npayment2 = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=2000.00,\n    description=\"16x A100 GPU instances, 2 hours\",\n)\nprint(f\"Payment: {payment2['status']}, remaining: ${payment2['remaining_budget']}\")\n# Output: Payment: authorized, remaining: $1500.0\n\n# Third purchase exceeds remaining budget\npayment3 = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=2000.00,\n    description=\"16x A100 GPU instances, 2 hours\",\n)\nprint(f\"Payment: {payment3['status']}, reason: {payment3.get('reason')}\")\n# Output: Payment: denied, reason: Amount $2000.0 exceeds remaining budget $1500.0\n```\n\n### Sub-Delegation with Constraint Narrowing\n\nWhen your primary agent delegates to a sub-agent, the delegation must narrow or maintain the parent's constraints. This is enforced structurally: the sub-credential references the parent credential's hash and includes only a subset of the parent's authorized actions and a spending limit less than or equal to the parent's.\n\n```python\ndef delegate_intent(\n    parent_wallet: CredentialWallet,\n    parent_intent_id: str,\n    child_wallet: CredentialWallet,\n    child_intent_id: str,\n    narrowed_actions: List[str],\n    narrowed_limit_usd: float,\n    ttl_seconds: int = 3600,\n) -> AgentCredential:\n    \"\"\"Delegate a Verifiable Intent to a sub-agent with narrowed constraints.\n\n    The child credential references the parent credential hash and must\n    have equal or narrower constraints.\n    \"\"\"\n    parent_cred = parent_wallet.credentials.get(parent_intent_id)\n    if not parent_cred:\n        raise ValueError(f\"Parent intent {parent_intent_id} not found\")\n\n    parent_actions = parent_cred.claims.get(\"authorized_actions\", [])\n    parent_limit = float(\n        parent_cred.claims.get(\"spending_limit\", {}).get(\"amount\", \"0\")\n    )\n\n    # Enforce constraint narrowing\n    for action in narrowed_actions:\n        if action not in parent_actions:\n            raise ValueError(\n                f\"Action '{action}' not in parent's authorized actions: {parent_actions}\"\n            )\n    if narrowed_limit_usd > parent_limit:\n        raise ValueError(\n            f\"Limit ${narrowed_limit_usd} exceeds parent limit ${parent_limit}\"\n        )\n\n    # Issue sub-delegation credential\n    child_cred = parent_wallet.issue_credential(\n        credential_id=child_intent_id,\n        subject_did=child_wallet.did,\n        credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fverifiable-intent\u002Fv1\",\n        claims={\n            \"intent_type\": \"delegated_payment_authorization\",\n            \"authorized_actions\": narrowed_actions,\n            \"spending_limit\": {\n                \"amount\": str(narrowed_limit_usd),\n                \"currency\": \"USD\",\n                \"period\": \"session\",\n            },\n            \"delegated_by\": parent_wallet.did,\n            \"delegation_depth\": 1,\n        },\n        disclosable_claims=[\"delegated_by\"],\n        ttl_seconds=ttl_seconds,\n        parent_credential_id=parent_intent_id,\n    )\n\n    return child_cred\n\n\n# Example: primary agent delegates to a specialized compute buyer\nchild_wallet = CredentialWallet(\n    agent_id=\"acme-compute-buyer-01\",\n    display_name=\"Acme Compute Specialist\",\n    owner=\"alice@acme.com\",\n)\nchild_wallet.register()\nchild_wallet.create_wallet()\n\nsub_cred = delegate_intent(\n    parent_wallet=wallet,\n    parent_intent_id=\"session-2026-04-06-001\",\n    child_wallet=child_wallet,\n    child_intent_id=\"sub-session-001\",\n    narrowed_actions=[\"purchase_compute\"],  # same as parent\n    narrowed_limit_usd=2000.00,  # narrowed from $5,000\n    ttl_seconds=3600,  # 1 hour\n)\nprint(f\"Sub-delegation issued. Parent hash: {sub_cred.parent_hash[:16]}...\")\n```\n\n---\n\n## Chapter 5: Cross-Protocol Credential Presentation\n\n### The Multi-Protocol Reality\n\nYour agent will not operate in a single protocol ecosystem. A procurement agent might discover vendors via Google AP2, negotiate terms over UCP, execute payment through Mastercard's rails, and settle micropayments via x402. Each protocol has its own credential presentation format, but they all accept W3C Verifiable Credentials in SD-JWT format. The adapter pattern lets your wallet present credentials in the format each protocol expects without duplicating credential storage or issuance logic.\n\n```\nCROSS-PROTOCOL PRESENTATION FLOW\n\n┌─────────────────────────────────────────────────┐\n│           CREDENTIAL WALLET                      │\n│  ┌─────────────────────────────────┐            │\n│  │  SD-JWT-VC Credentials          │            │\n│  │  (canonical format)             │            │\n│  └──────────┬──────────────────────┘            │\n│             │                                    │\n│  ┌──────────┼──────────────────────────────┐    │\n│  │          │    PRESENTATION ADAPTERS      │    │\n│  │  ┌───────▼───┐ ┌─────────┐ ┌─────────┐ │    │\n│  │  │   AP2     │ │   UCP   │ │   ACP   │ │    │\n│  │  │ Adapter   │ │ Adapter │ │ Adapter │ │    │\n│  │  └───────┬───┘ └────┬────┘ └────┬────┘ │    │\n│  │  ┌───────▼──────────▼───────────▼────┐  │    │\n│  │  │           x402 Adapter            │  │    │\n│  │  └───────────────────────────────────┘  │    │\n│  └─────────────────────────────────────────┘    │\n└─────────────────────────────────────────────────┘\n```\n\n### Protocol Comparison\n\n| Feature | AP2 (Google) | UCP | ACP (OpenAI) | x402 |\n|---------|-------------|-----|-------------|------|\n| Discovery | Agent card + DNS-SD | Registry + broadcast | Capability manifest | HTTP 402 response |\n| Auth handshake | Mutual VC exchange | VC + capability proof | VC + scope assertion | Payment proof header |\n| Credential format | SD-JWT-VC | SD-JWT-VC | SD-JWT-VC or JWT-VC | Payment attestation |\n| Delegation depth | Unlimited (chain verified) | Max 3 hops | Max 5 hops | Single hop |\n| Selective disclosure | Full SD-JWT support | Full SD-JWT support | Partial (required claims) | Minimal (amount only) |\n| Payment integration | External (via intent) | Built-in escrow | External (via intent) | Native (HTTP header) |\n\n### The ProtocolAdapter Base and Implementations\n\n```python\nfrom abc import ABC, abstractmethod\n\n\nclass ProtocolAdapter(ABC):\n    \"\"\"Base class for protocol-specific credential presentation adapters.\"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n\n    @abstractmethod\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        \"\"\"Format a credential presentation for the target protocol.\"\"\"\n        pass\n\n    @abstractmethod\n    def verify_counterparty(self, presentation: dict) -> dict:\n        \"\"\"Verify a counterparty's credential presentation.\"\"\"\n        pass\n\n\nclass AP2Adapter(ProtocolAdapter):\n    \"\"\"Google Agent-to-Agent Protocol (AP2) credential adapter.\n\n    AP2 requires mutual credential exchange during the handshake phase.\n    Both agents present credentials before any commercial interaction.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        presentation = self.wallet.present_credential(credential_id, disclosed_claims)\n\n        return {\n            \"protocol\": \"ap2\",\n            \"version\": \"1.0\",\n            \"agent_card\": {\n                \"agent_id\": self.wallet.agent_id,\n                \"did\": self.wallet.did,\n                \"display_name\": self.wallet.display_name,\n                \"capabilities\": protocol_metadata.get(\"capabilities\", []),\n            },\n            \"credential_presentation\": {\n                \"format\": \"sd-jwt-vc\",\n                \"jwt_payload\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n            },\n            \"handshake_nonce\": secrets.token_urlsafe(32),\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        \"\"\"Verify an AP2 counterparty presentation.\n\n        Checks: credential format, DID resolution, disclosure validation.\n        \"\"\"\n        if presentation.get(\"protocol\") != \"ap2\":\n            return {\"valid\": False, \"reason\": \"Not an AP2 presentation\"}\n\n        cred = presentation.get(\"credential_presentation\", {})\n        if cred.get(\"format\") != \"sd-jwt-vc\":\n            return {\"valid\": False, \"reason\": \"Unsupported credential format\"}\n\n        # Verify the agent identity via GreenHelix\n        agent_card = presentation.get(\"agent_card\", {})\n        identity_check = api_call(\"get_agent_reputation\", {\n            \"agent_id\": agent_card.get(\"agent_id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": agent_card.get(\"agent_id\"),\n            \"did\": agent_card.get(\"did\"),\n            \"reputation\": identity_check,\n        }\n\n\nclass UCPAdapter(ProtocolAdapter):\n    \"\"\"Universal Commerce Protocol (UCP) credential adapter.\n\n    UCP extends AP2 with commerce-specific flows: escrow, SLA, and\n    capability proof. Credentials must include commerce capabilities.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        presentation = self.wallet.present_credential(credential_id, disclosed_claims)\n\n        # UCP requires escrow capability proof\n        escrow_capable = \"create_escrow\" in protocol_metadata.get(\"tools\", [])\n\n        return {\n            \"protocol\": \"ucp\",\n            \"version\": \"1.0\",\n            \"identity\": {\n                \"did\": self.wallet.did,\n                \"agent_id\": self.wallet.agent_id,\n            },\n            \"credential\": {\n                \"format\": \"sd-jwt-vc\",\n                \"payload\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n            },\n            \"commerce_capabilities\": {\n                \"escrow_capable\": escrow_capable,\n                \"sla_capable\": True,\n                \"supported_currencies\": protocol_metadata.get(\"currencies\", [\"USD\"]),\n            },\n            \"service_endpoint\": protocol_metadata.get(\n                \"endpoint\", f\"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"\n            ),\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"ucp\":\n            return {\"valid\": False, \"reason\": \"Not a UCP presentation\"}\n\n        identity = presentation.get(\"identity\", {})\n        commerce = presentation.get(\"commerce_capabilities\", {})\n\n        # Verify identity and check commerce capabilities\n        rep = api_call(\"get_agent_reputation\", {\n            \"agent_id\": identity.get(\"agent_id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": identity.get(\"agent_id\"),\n            \"escrow_capable\": commerce.get(\"escrow_capable\", False),\n            \"reputation\": rep,\n        }\n\n\nclass ACPAdapter(ProtocolAdapter):\n    \"\"\"OpenAI Agent Commerce Protocol (ACP) credential adapter.\n\n    ACP uses scope assertions: the credential must declare what commercial\n    actions the agent is authorized for. Required claims are not selectively\n    disclosable -- ACP mandates their visibility.\n    \"\"\"\n\n    ACP_REQUIRED_CLAIMS = [\"authorized_actions\", \"spending_limit\", \"intent_type\"]\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        # ACP requires certain claims to always be disclosed\n        all_disclosed = list(set(disclosed_claims + self.ACP_REQUIRED_CLAIMS))\n        presentation = self.wallet.present_credential(credential_id, all_disclosed)\n\n        return {\n            \"protocol\": \"acp\",\n            \"version\": \"1.0\",\n            \"agent\": {\n                \"id\": self.wallet.agent_id,\n                \"did\": self.wallet.did,\n            },\n            \"scope_assertion\": {\n                \"format\": \"sd-jwt-vc\",\n                \"credential\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n                \"disclosed_values\": presentation[\"disclosed_values\"],\n            },\n            \"transaction_context\": {\n                \"requested_action\": protocol_metadata.get(\"action\", \"\"),\n                \"amount\": protocol_metadata.get(\"amount\", \"\"),\n                \"currency\": protocol_metadata.get(\"currency\", \"USD\"),\n            },\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"acp\":\n            return {\"valid\": False, \"reason\": \"Not an ACP presentation\"}\n\n        scope = presentation.get(\"scope_assertion\", {})\n        disclosed = scope.get(\"disclosed_values\", {})\n\n        # Check all required claims are present\n        for claim in self.ACP_REQUIRED_CLAIMS:\n            if claim not in disclosed:\n                return {\"valid\": False, \"reason\": f\"Missing required claim: {claim}\"}\n\n        agent = presentation.get(\"agent\", {})\n        rep = api_call(\"get_agent_reputation\", {\n            \"agent_id\": agent.get(\"id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": agent.get(\"id\"),\n            \"authorized_actions\": disclosed.get(\"authorized_actions\"),\n            \"spending_limit\": disclosed.get(\"spending_limit\"),\n            \"reputation\": rep,\n        }\n\n\nclass X402Adapter(ProtocolAdapter):\n    \"\"\"x402 payment protocol credential adapter.\n\n    x402 is a lightweight HTTP-based payment protocol. Credentials are\n    presented as HTTP headers on 402 Payment Required responses.\n    This adapter formats payment attestations for x402 flows.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        # x402 uses minimal disclosure: just the payment proof\n        presentation = self.wallet.present_credential(\n            credential_id, [\"spending_limit\"]\n        )\n\n        return {\n            \"protocol\": \"x402\",\n            \"version\": \"1.0\",\n            \"payment_header\": {\n                \"X-Agent-DID\": self.wallet.did,\n                \"X-Payment-Credential\": json.dumps(presentation[\"jwt_payload\"]),\n                \"X-Payment-Amount\": protocol_metadata.get(\"amount\", \"\"),\n                \"X-Payment-Currency\": protocol_metadata.get(\"currency\", \"USD\"),\n            },\n            \"attestation\": {\n                \"credential_hash\": self.wallet.credentials[\n                    credential_id\n                ].credential_hash(),\n                \"agent_id\": self.wallet.agent_id,\n            },\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"x402\":\n            return {\"valid\": False, \"reason\": \"Not an x402 presentation\"}\n\n        headers = presentation.get(\"payment_header\", {})\n        agent_did = headers.get(\"X-Agent-DID\", \"\")\n\n        # Minimal verification for x402: check the agent exists\n        # Full verification happens at settlement\n        return {\n            \"valid\": bool(agent_did),\n            \"agent_did\": agent_did,\n            \"amount\": headers.get(\"X-Payment-Amount\"),\n        }\n```\n\n### Choosing the Right Protocol\n\nThe decision of which protocol adapter to use for a given interaction depends on what you are doing in that interaction. Discovery and initial contact typically happen over AP2, because Google's agent card mechanism provides the richest service description format. Price negotiation and SLA agreement happen over UCP, because it has built-in escrow and SLA primitives. Payment execution happens over ACP or Mastercard VI rails, because these protocols have the strongest payment authorization verification. Micropayments and per-request billing happen over x402, because it is the lowest-overhead protocol for small amounts -- the credential is a single HTTP header.\n\nIn practice, a single commercial transaction often spans three or four protocols. Your agent discovers a vendor via AP2, negotiates terms over UCP, executes the primary payment via ACP with a Verifiable Intent credential, and then pays per-API-call overages via x402. The credential wallet stores one canonical set of SD-JWT-VC credentials. The adapters format those credentials for each protocol without duplication.\n\n### Multi-Protocol Transaction Example\n\n```python\n# Initialize wallet with intent\nwallet = CredentialWallet(\n    agent_id=\"acme-buyer-01\",\n    display_name=\"Acme Multi-Protocol Buyer\",\n    owner=\"alice@acme.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\n# Issue delegation credential\nvi = VerifiableIntentManager(wallet)\nintent_cred = vi.declare_intent(\n    intent_id=\"multi-proto-session-001\",\n    authorized_actions=[\"purchase_compute\"],\n    spending_limit_usd=5000.00,\n    merchant_categories=[\"cloud_compute\"],\n    session_hours=4.0,\n)\n\n# Discover vendor via AP2\nap2 = AP2Adapter(wallet)\nap2_presentation = ap2.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"authorized_actions\", \"spending_limit\"],\n    protocol_metadata={\"capabilities\": [\"compute_provisioning\"]},\n)\nprint(f\"AP2 handshake: {ap2_presentation['agent_card']['agent_id']}\")\n\n# Negotiate terms via UCP\nucp = UCPAdapter(wallet)\nucp_presentation = ucp.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"authorized_actions\", \"spending_limit\"],\n    protocol_metadata={\n        \"tools\": [\"create_escrow\", \"create_sla\"],\n        \"currencies\": [\"USD\"],\n    },\n)\nprint(f\"UCP negotiation: escrow={ucp_presentation['commerce_capabilities']['escrow_capable']}\")\n\n# Execute payment via ACP\nacp = ACPAdapter(wallet)\nacp_presentation = acp.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"merchant_categories\"],  # ACP adds required claims automatically\n    protocol_metadata={\n        \"action\": \"purchase_compute\",\n        \"amount\": \"1500.00\",\n        \"currency\": \"USD\",\n    },\n)\nprint(f\"ACP scope: {acp_presentation['scope_assertion']['disclosed_values']}\")\n\n# Settle micropayment via x402\nx402 = X402Adapter(wallet)\nx402_presentation = x402.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"spending_limit\"],\n    protocol_metadata={\"amount\": \"0.50\", \"currency\": \"USD\"},\n)\nprint(f\"x402 headers: {list(x402_presentation['payment_header'].keys())}\")\n```\n\n---\n\n## Chapter 6: eIDAS 2.0 Compliance\n\n### The December 2026 Deadline\n\nThe EU's eIDAS 2.0 regulation requires all EU member states to offer European Digital Identity (EUDI) Wallets to citizens and businesses by December 2026. For agent commerce, the implications are direct: any agent transacting with EU consumers or businesses must be able to accept and verify EUDI Wallet credentials. Any agent operating on behalf of an EU entity must be able to present credentials that comply with the EUDI Architecture Reference Framework (ARF).\n\nThe key requirements for agent developers:\n\n- **Qualified Electronic Attestation of Attributes (QEAA)**: Credentials issued by qualified trust service providers. Agent delegation credentials that touch EU financial transactions must be QEAAs or reference a QEAA in the chain.\n- **PSD2 Strong Customer Authentication (SCA)**: Payments over EUR 30 require multi-factor authentication. For agent commerce, SCA can be satisfied by the delegation chain if the human principal authenticated with two factors when issuing the intent credential.\n- **Data minimization**: GDPR requires that credentials disclose only the minimum data necessary for the transaction. SD-JWT selective disclosure directly satisfies this requirement.\n- **Credential format**: The ARF mandates SD-JWT-VC as one of the accepted credential formats. This is the same format used by Mastercard VI and GreenHelix credentials, so the format is already compatible.\n\n### EUDI Wallet Integration Architecture\n\n```\neIDAS 2.0 CREDENTIAL FLOW FOR AGENT COMMERCE\n\n┌──────────────┐    ┌─────────────┐    ┌────────────────┐\n│  EU Human    │    │ Qualified   │    │  EUDI Wallet   │\n│  Principal   │───>│ Trust Svc   │───>│  (Mobile App)  │\n│              │    │ Provider    │    │                │\n└──────────────┘    └─────────────┘    └───────┬────────┘\n                                               │\n                         SCA-verified          │ Issue delegation\n                         intent declaration    │ credential to agent\n                                               │\n                                       ┌───────▼────────┐\n                                       │  Agent Wallet   │\n                                       │  (GreenHelix)  │\n                                       │                │\n                                       │ Stores:        │\n                                       │ - EUDI-sourced │\n                                       │   delegation VC│\n                                       │ - Platform VCs │\n                                       │ - VI session   │\n                                       └───────┬────────┘\n                                               │\n                              Present EUDI-    │\n                              referenced cred  │\n                              to EU vendor     │\n                                               │\n                                       ┌───────▼────────┐\n                                       │  EU Vendor     │\n                                       │  Agent         │\n                                       │                │\n                                       │ Verifies:      │\n                                       │ - QEAA chain   │\n                                       │ - SCA proof    │\n                                       │ - SD-JWT sigs  │\n                                       └────────────────┘\n```\n\n### EUDIComplianceManager\n\n```python\nclass EUDIComplianceManager:\n    \"\"\"Manages eIDAS 2.0 EUDI Wallet compliance for agent credentials.\n\n    Handles QEAA validation, PSD2 SCA attestation, and credential\n    formatting for EU commerce.\n    \"\"\"\n\n    # eIDAS trust service list (simplified)\n    QUALIFIED_TRUST_SERVICES = [\n        \"did:web:qtsp.eu.example.com\",\n        \"did:web:trust.eidas.europa.eu\",\n    ]\n\n    SCA_THRESHOLD_EUR = 30.0\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.eudi_credentials: Dict[str, dict] = {}\n        self.compliance_log: List[dict] = []\n\n    def import_eudi_credential(\n        self,\n        eudi_credential_id: str,\n        issuer_did: str,\n        credential_data: dict,\n        sca_method: str,\n        sca_timestamp: float,\n    ) -> dict:\n        \"\"\"Import a credential sourced from a EUDI Wallet.\n\n        The credential must be a QEAA (issued by a qualified trust service)\n        to be valid for regulated EU transactions.\n\n        Args:\n            eudi_credential_id: ID from the EUDI wallet.\n            issuer_did: DID of the issuing trust service provider.\n            credential_data: The credential claims.\n            sca_method: SCA method used (e.g., \"biometric+pin\", \"pin+sms\").\n            sca_timestamp: When SCA was performed (Unix timestamp).\n        \"\"\"\n        is_qualified = issuer_did in self.QUALIFIED_TRUST_SERVICES\n\n        eudi_record = {\n            \"id\": eudi_credential_id,\n            \"issuer\": issuer_did,\n            \"is_qeaa\": is_qualified,\n            \"credential_data\": credential_data,\n            \"sca_method\": sca_method,\n            \"sca_timestamp\": sca_timestamp,\n            \"imported_at\": time.time(),\n        }\n        self.eudi_credentials[eudi_credential_id] = eudi_record\n\n        # Also issue a GreenHelix credential that references the EUDI source\n        self.wallet.issue_credential(\n            credential_id=f\"eudi-{eudi_credential_id}\",\n            subject_did=self.wallet.did,\n            credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Feudi-delegation\u002Fv1\",\n            claims={\n                \"eudi_source\": eudi_credential_id,\n                \"eudi_issuer\": issuer_did,\n                \"is_qeaa\": is_qualified,\n                \"sca_method\": sca_method,\n                \"sca_timestamp\": sca_timestamp,\n                **credential_data,\n            },\n            disclosable_claims=[\"sca_method\", \"eudi_issuer\"],\n            ttl_seconds=86400,\n        )\n\n        return eudi_record\n\n    def check_sca_required(self, amount_eur: float) -> bool:\n        \"\"\"Check if PSD2 SCA is required for the transaction amount.\"\"\"\n        return amount_eur > self.SCA_THRESHOLD_EUR\n\n    def validate_sca_for_transaction(\n        self,\n        eudi_credential_id: str,\n        amount_eur: float,\n        max_sca_age_seconds: int = 300,\n    ) -> dict:\n        \"\"\"Validate that SCA requirements are met for a transaction.\n\n        PSD2 requires SCA for payments > EUR 30. The SCA must have been\n        performed recently (within max_sca_age_seconds) for the transaction\n        to be authorized.\n        \"\"\"\n        if not self.check_sca_required(amount_eur):\n            return {\"sca_required\": False, \"authorized\": True}\n\n        cred = self.eudi_credentials.get(eudi_credential_id)\n        if not cred:\n            return {\n                \"sca_required\": True,\n                \"authorized\": False,\n                \"reason\": \"EUDI credential not found\",\n            }\n\n        sca_age = time.time() - cred[\"sca_timestamp\"]\n        if sca_age > max_sca_age_seconds:\n            return {\n                \"sca_required\": True,\n                \"authorized\": False,\n                \"reason\": f\"SCA expired ({sca_age:.0f}s > {max_sca_age_seconds}s)\",\n            }\n\n        return {\n            \"sca_required\": True,\n            \"authorized\": True,\n            \"sca_method\": cred[\"sca_method\"],\n            \"sca_age_seconds\": sca_age,\n        }\n\n    def create_compliance_attestation(\n        self,\n        transaction_id: str,\n        amount_eur: float,\n        eudi_credential_id: str,\n        counterparty_agent_id: str,\n    ) -> dict:\n        \"\"\"Create a compliance attestation for an EU transaction.\n\n        Records all compliance checks for audit purposes. This attestation\n        can be presented to regulators as evidence of eIDAS 2.0 compliance.\n        \"\"\"\n        sca_check = self.validate_sca_for_transaction(eudi_credential_id, amount_eur)\n\n        cred = self.eudi_credentials.get(eudi_credential_id, {})\n\n        attestation = {\n            \"transaction_id\": transaction_id,\n            \"timestamp\": time.time(),\n            \"agent_id\": self.wallet.agent_id,\n            \"counterparty\": counterparty_agent_id,\n            \"amount_eur\": amount_eur,\n            \"eudi_credential\": eudi_credential_id,\n            \"is_qeaa\": cred.get(\"is_qeaa\", False),\n            \"sca_check\": sca_check,\n            \"data_minimization\": True,  # SD-JWT selective disclosure used\n            \"credential_format\": \"sd-jwt-vc\",\n            \"regulation\": \"eIDAS 2.0 \u002F PSD2\",\n        }\n\n        # Log via GreenHelix compliance tool\n        compliance_result = api_call(\"check_compliance\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"transaction_id\": transaction_id,\n            \"compliance_data\": attestation,\n        })\n\n        attestation[\"platform_check\"] = compliance_result\n        self.compliance_log.append(attestation)\n\n        return attestation\n```\n\n### EU Transaction Flow\n\n```python\n# Set up wallet with EUDI integration\nwallet = CredentialWallet(\n    agent_id=\"eu-buyer-agent-01\",\n    display_name=\"EU Procurement Agent\",\n    owner=\"klaus@eurocorp.eu\",\n)\nwallet.register()\nwallet.create_wallet()\n\neudi = EUDIComplianceManager(wallet)\n\n# Import a credential from the user's EUDI Wallet\n# (In production, this comes from a QR code scan or NFC tap\n#  on the user's mobile EUDI wallet app)\neudi_cred = eudi.import_eudi_credential(\n    eudi_credential_id=\"eudi-2026-04-06-001\",\n    issuer_did=\"did:web:qtsp.eu.example.com\",  # Qualified TSP\n    credential_data={\n        \"principal_name\": \"Klaus Mueller\",\n        \"organization\": \"EuroCorp GmbH\",\n        \"authorized_actions\": [\"purchase_compute\", \"purchase_saas\"],\n        \"spending_limit\": {\"amount\": \"8000\", \"currency\": \"EUR\", \"period\": \"day\"},\n    },\n    sca_method=\"biometric+pin\",\n    sca_timestamp=time.time(),  # SCA just performed\n)\nprint(f\"EUDI credential imported. QEAA: {eudi_cred['is_qeaa']}\")\n# Output: EUDI credential imported. QEAA: True\n\n# Execute a transaction requiring PSD2 SCA\nattestation = eudi.create_compliance_attestation(\n    transaction_id=\"eu-tx-2026-04-06-001\",\n    amount_eur=2500.00,\n    eudi_credential_id=\"eudi-2026-04-06-001\",\n    counterparty_agent_id=\"eu-vendor-saas-01\",\n)\nprint(f\"Compliance: SCA required={attestation['sca_check']['sca_required']}, \"\n      f\"authorized={attestation['sca_check']['authorized']}\")\n# Output: Compliance: SCA required=True, authorized=True\n```\n\n---\n\n## Chapter 7: Trust Scoring, Reputation Binding & Credential Revocation\n\n### Why Credentials Need Reputation\n\nA credential tells you what an agent is authorized to do. It does not tell you whether the agent is any good at doing it. An agent with a valid $50,000 delegation credential might have a 30% task completion rate and a history of disputed escrows. The credential is technically valid -- the human authorized the spend -- but the counterparty should not accept it without checking the agent's track record. Reputation binding attaches verifiable performance data to credentials so that counterparties can evaluate both authorization and competence in a single verification flow.\n\n### ReputationBoundCredentialManager\n\n```python\nclass ReputationBoundCredentialManager:\n    \"\"\"Binds verifiable reputation data to agent credentials.\n\n    Combines GreenHelix reputation tools with the credential wallet to\n    create credentials that carry both authorization and performance proof.\n    \"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.revocation_registry: Dict[str, dict] = {}\n\n    def get_reputation_snapshot(self) -> dict:\n        \"\"\"Fetch the agent's current reputation from GreenHelix.\"\"\"\n        return api_call(\"get_agent_reputation\", {\n            \"agent_id\": self.wallet.agent_id,\n        })\n\n    def submit_performance_metrics(\n        self,\n        metrics: Dict[str, Any],\n    ) -> dict:\n        \"\"\"Submit performance metrics to build verifiable history.\n\n        These metrics feed into the reputation score and can be\n        anchored in claim chains for tamper-evidence.\n        \"\"\"\n        return api_call(\"submit_metrics\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"metrics\": metrics,\n        })\n\n    def issue_reputation_bound_credential(\n        self,\n        credential_id: str,\n        subject_did: str,\n        authorization_claims: Dict[str, Any],\n        min_reputation_score: float = 0.0,\n    ) -> AgentCredential:\n        \"\"\"Issue a credential that includes a verifiable reputation snapshot.\n\n        The reputation data becomes part of the credential claims,\n        anchored at issuance time. The counterparty can verify that\n        the reputation was genuine at issuance by checking the claim chain.\n\n        Args:\n            credential_id: Unique ID for this credential.\n            subject_did: DID of the credential subject.\n            authorization_claims: The authorization claims (actions, limits, etc).\n            min_reputation_score: Minimum score required to issue. Fails if below.\n        \"\"\"\n        # Fetch current reputation\n        rep = self.get_reputation_snapshot()\n        rep_score = rep.get(\"reputation_score\", 0)\n\n        if rep_score \u003C min_reputation_score:\n            raise ValueError(\n                f\"Reputation {rep_score} below minimum {min_reputation_score}\"\n            )\n\n        # Merge reputation into claims\n        all_claims = {\n            **authorization_claims,\n            \"reputation_at_issuance\": {\n                \"score\": rep_score,\n                \"trade_count\": rep.get(\"trade_count\", 0),\n                \"claim_chain_depth\": rep.get(\"claim_chain_depth\", 0),\n                \"snapshot_time\": time.time(),\n            },\n        }\n\n        return self.wallet.issue_credential(\n            credential_id=credential_id,\n            subject_did=subject_did,\n            credential_type=(\n                \"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Freputation-bound-delegation\u002Fv1\"\n            ),\n            claims=all_claims,\n            disclosable_claims=[\n                \"reputation_at_issuance\",\n                \"principal_name\",\n            ],\n            ttl_seconds=86400,\n        )\n\n    def revoke_credential(\n        self,\n        credential_id: str,\n        reason: str,\n    ) -> dict:\n        \"\"\"Revoke a credential and record the revocation.\n\n        Revocation is immediate. The credential hash is added to the\n        revocation registry, and a claim chain entry is created for\n        tamper-evident revocation history.\n        \"\"\"\n        if credential_id not in self.wallet.credentials:\n            raise KeyError(f\"Credential {credential_id} not found\")\n\n        cred = self.wallet.credentials[credential_id]\n\n        revocation_entry = {\n            \"credential_id\": credential_id,\n            \"credential_hash\": cred.credential_hash(),\n            \"revoked_at\": time.time(),\n            \"reason\": reason,\n            \"revoked_by\": self.wallet.agent_id,\n        }\n        self.revocation_registry[credential_id] = revocation_entry\n\n        # Submit revocation as a metric for chain anchoring\n        self.submit_performance_metrics({\n            \"event\": \"credential_revocation\",\n            \"credential_id\": credential_id,\n            \"reason\": reason,\n            \"timestamp\": time.time(),\n        })\n\n        # Anchor the revocation in a claim chain\n        chain_result = self.wallet.build_chain()\n\n        return {\n            \"revoked\": True,\n            \"entry\": revocation_entry,\n            \"chain_result\": chain_result,\n        }\n\n    def check_revocation(self, credential_id: str) -> dict:\n        \"\"\"Check if a credential has been revoked.\"\"\"\n        if credential_id in self.revocation_registry:\n            entry = self.revocation_registry[credential_id]\n            return {\n                \"revoked\": True,\n                \"revoked_at\": entry[\"revoked_at\"],\n                \"reason\": entry[\"reason\"],\n            }\n        return {\"revoked\": False}\n\n    def create_dispute_evidence_credential(\n        self,\n        dispute_id: str,\n        counterparty_agent_id: str,\n        evidence: Dict[str, Any],\n    ) -> dict:\n        \"\"\"Create a credential containing dispute evidence.\n\n        When a transaction is disputed, this creates a tamper-evident\n        record of the evidence that can be presented during resolution.\n        \"\"\"\n        # Create the dispute via GreenHelix\n        dispute_result = api_call(\"create_dispute\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"counterparty_agent_id\": counterparty_agent_id,\n            \"dispute_id\": dispute_id,\n            \"evidence\": evidence,\n        })\n\n        # Issue an evidence credential\n        evidence_cred = self.wallet.issue_credential(\n            credential_id=f\"dispute-evidence-{dispute_id}\",\n            subject_did=self.wallet.did,\n            credential_type=(\n                \"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fdispute-evidence\u002Fv1\"\n            ),\n            claims={\n                \"dispute_id\": dispute_id,\n                \"counterparty\": counterparty_agent_id,\n                \"evidence_summary\": evidence.get(\"summary\", \"\"),\n                \"evidence_hash\": hashlib.sha256(\n                    json.dumps(evidence, sort_keys=True).encode()\n                ).hexdigest(),\n                \"created_at\": time.time(),\n            },\n            disclosable_claims=[\"evidence_summary\"],\n            ttl_seconds=2592000,  # 30 days for dispute resolution\n        )\n\n        return {\n            \"dispute_result\": dispute_result,\n            \"evidence_credential\": evidence_cred.credential_hash(),\n        }\n```\n\n### Reputation-Bound Credential Flow\n\n```python\nwallet = CredentialWallet(\n    agent_id=\"reputable-vendor-01\",\n    display_name=\"Reputable Cloud Vendor\",\n    owner=\"ops@cloudvendor.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\nrep_manager = ReputationBoundCredentialManager(wallet)\n\n# Submit performance metrics over time (called periodically)\nrep_manager.submit_performance_metrics({\n    \"task_completion_rate\": 0.97,\n    \"avg_response_time_ms\": 145,\n    \"successful_escrows\": 342,\n    \"disputed_escrows\": 3,\n    \"uptime_percent\": 99.8,\n})\n\n# Issue a reputation-bound credential (e.g., for a vendor presenting to a buyer)\nrep_cred = rep_manager.issue_reputation_bound_credential(\n    credential_id=\"vendor-service-cred-001\",\n    subject_did=\"did:key:reputable-vendor-01\",\n    authorization_claims={\n        \"service_type\": \"gpu_compute_provisioning\",\n        \"max_instance_count\": 64,\n        \"supported_regions\": [\"us-east\", \"eu-west\"],\n        \"principal_name\": \"CloudVendor Inc.\",\n    },\n    min_reputation_score=0.7,  # Require minimum 70% reputation\n)\n\n# Present with selective disclosure -- show reputation but not principal name\npresentation = wallet.present_credential(\n    credential_id=\"vendor-service-cred-001\",\n    disclosed_claims=[\"reputation_at_issuance\"],\n)\nprint(f\"Disclosed reputation: {presentation['disclosed_values']}\")\n\n# Later: revoke a credential (e.g., service decommissioned)\nrevocation = rep_manager.revoke_credential(\n    credential_id=\"vendor-service-cred-001\",\n    reason=\"Service region us-east decommissioned\",\n)\nprint(f\"Revoked: {revocation['revoked']}\")\n\n# Counterparty checks revocation before accepting credential\nstatus = rep_manager.check_revocation(\"vendor-service-cred-001\")\nprint(f\"Revocation check: {status}\")\n# Output: Revocation check: {'revoked': True, 'revoked_at': ..., 'reason': '...'}\n```\n\n### Dispute Evidence with Credentials\n\n```python\n# When a transaction goes wrong, create tamper-evident dispute evidence\nevidence_result = rep_manager.create_dispute_evidence_credential(\n    dispute_id=\"dispute-2026-04-06-001\",\n    counterparty_agent_id=\"unreliable-vendor-99\",\n    evidence={\n        \"summary\": \"Vendor committed to 8x A100 instances but only provisioned 4x\",\n        \"sla_id\": \"sla-2026-04-05-001\",\n        \"promised_instances\": 8,\n        \"delivered_instances\": 4,\n        \"transaction_id\": \"tx-2026-04-05-789\",\n        \"screenshots\": [\"evidence-001.png\", \"evidence-002.png\"],\n    },\n)\nprint(f\"Dispute filed. Evidence credential: {evidence_result['evidence_credential'][:16]}...\")\n```\n\n---\n\n## Next Steps\n\nFor deployment patterns, monitoring, and production hardening, see the\n[Agent Production Hardening Guide](https:\u002F\u002Fclawhub.ai\u002Fskills\u002Fgreenhelix-agent-production-hardening).\n\n---\n\n## What You Get\n\nThis guide covered the complete credential lifecycle for agentic commerce:\n\n**Chapter 1** explained why API keys and OAuth break under delegation and how Mastercard, Google, and OpenAI converged on W3C Verifiable Credentials.\n\n**Chapter 2** provided the SD-JWT-VC primer: credential anatomy, selective disclosure mechanics, key binding, and delegation chains as layered issuance.\n\n**Chapter 3** built the `CredentialWallet` class with GreenHelix tools: `register_agent`, `create_wallet`, `build_claim_chain`, and `get_claim_chains` for DID-anchored credential storage.\n\n**Chapter 4** implemented Verifiable Intent: session-level spending limits, `create_intent` integration, and sub-delegation with constraint narrowing.\n\n**Chapter 5** delivered cross-protocol adapters for AP2, UCP, ACP, and x402, with a unified wallet backend and protocol-specific presentation formatting.\n\n**Chapter 6** addressed the December 2026 eIDAS 2.0 deadline: EUDI Wallet integration, QEAA validation, PSD2 SCA flows, and compliance attestation via `check_compliance`.\n\n**Chapter 7** bound reputation to credentials: `get_agent_reputation` and `submit_metrics` for reputation snapshots, real-time revocation, and dispute evidence credentials using `create_dispute`.\n\n**Chapter 8** covered fleet-wide deployment: bulk registration, templated issuance, zero-downtime key rotation, health monitoring, and a 90-day sprint plan.\n\nEvery code example uses the `requests.Session` + the REST API (`POST \u002Fv1\u002F{tool}`) pattern against the GreenHelix A2A Commerce Gateway. Every credential is an SD-JWT-VC with selective disclosure. Every delegation chain enforces constraint narrowing. The architecture is protocol-agnostic at the wallet layer and protocol-specific at the presentation layer, so your agents can transact across AP2, UCP, ACP, and x402 without credential duplication.\n\nThe December 2026 deadline is real. The protocols are converging. Start with Chapter 3, register your first agent, and build from there.\n\n","# Agent Credential Wallets: Verifiable Intent & Delegation Chains\n\n> **Notice**: This is an educational guide with illustrative code examples.\n> It does not execute code or install dependencies.\n> All examples use the GreenHelix sandbox (https:\u002F\u002Fsandbox.greenhelix.net) which\n> provides 500 free credits — no API key required to get started.\n>\n> **Referenced credentials** (you supply these in your own environment):\n> - `GREENHELIX_API_KEY`: API authentication for GreenHelix gateway (read\u002Fwrite access to purchased API tools only)\n\n\nYour agent just tried to buy cloud compute on behalf of your company. The vendor's agent asked for proof of authorization. Your agent presented an API key. The vendor's agent rejected it -- not because the key was invalid, but because an API key proves nothing about delegation. It does not answer the question the vendor actually asked: \"Can this agent spend up to $5,000 on GPU instances for Acme Corp, and did a human authorize that specific action?\" An API key says \"this entity has access.\" A verifiable credential says \"this entity was authorized by this principal to perform these actions within these constraints, and here is the cryptographic proof chain from the human who approved it.\" That distinction is the entire difference between agents that can transact in the open economy and agents that remain trapped inside their owner's perimeter. On March 5, 2026, Mastercard open-sourced the Verifiable Intent specification alongside Google, Fiserv, IBM, and Checkout.com, defining exactly how agents prove delegated authority to spend. Prove launched Verified Agent targeting the $1.7 trillion agentic commerce market with carrier-grade identity verification for non-human entities. The EU finalized eIDAS 2.0 implementation rules mandating EUDI Wallets by December 2026. Google's Agent-to-Agent Protocol (AP2), the Universal Commerce Protocol (UCP), and OpenAI's Agent Commerce Protocol (ACP) all require verifiable agent identity as the foundation layer. The decentralized identity market hit $7.4 billion in 2026. The convergence is real, and it is happening on a twelve-month timeline. This guide walks you through building a production credential wallet for your agents: SD-JWT-VC issuance, delegation chains from human to agent, cross-protocol credential presentation, eIDAS 2.0 compliance, reputation binding, and fleet-wide deployment. Every implementation uses the GreenHelix A2A Commerce Gateway API. Every pattern is designed for the December 2026 deadline.\n1. [The Agent Credential Problem](#chapter-1-the-agent-credential-problem)\n2. [W3C Verifiable Credentials & SD-JWT Primer](#chapter-2-w3c-verifiable-credentials--sd-jwt-primer)\n\n## What You'll Learn\n- Chapter 1: The Agent Credential Problem\n- Chapter 2: W3C Verifiable Credentials & SD-JWT Primer\n- Chapter 3: Building Your Agent's Credential Wallet\n- Chapter 4: Implementing Verifiable Intent\n- Chapter 5: Cross-Protocol Credential Presentation\n- Chapter 6: eIDAS 2.0 Compliance\n- Chapter 7: Trust Scoring, Reputation Binding & Credential Revocation\n- Next Steps\n- What You Get\n\n## Full Guide\n\n# Agent Credential Wallets: Verifiable Intent & Delegation Chains for Agentic Commerce\n\nYour agent just tried to buy cloud compute on behalf of your company. The vendor's agent asked for proof of authorization. Your agent presented an API key. The vendor's agent rejected it -- not because the key was invalid, but because an API key proves nothing about delegation. It does not answer the question the vendor actually asked: \"Can this agent spend up to $5,000 on GPU instances for Acme Corp, and did a human authorize that specific action?\" An API key says \"this entity has access.\" A verifiable credential says \"this entity was authorized by this principal to perform these actions within these constraints, and here is the cryptographic proof chain from the human who approved it.\" That distinction is the entire difference between agents that can transact in the open economy and agents that remain trapped inside their owner's perimeter. On March 5, 2026, Mastercard open-sourced the Verifiable Intent specification alongside Google, Fiserv, IBM, and Checkout.com, defining exactly how agents prove delegated authority to spend. Prove launched Verified Agent targeting the $1.7 trillion agentic commerce market with carrier-grade identity verification for non-human entities. The EU finalized eIDAS 2.0 implementation rules mandating EUDI Wallets by December 2026. Google's Agent-to-Agent Protocol (AP2), the Universal Commerce Protocol (UCP), and OpenAI's Agent Commerce Protocol (ACP) all require verifiable agent identity as the foundation layer. The decentralized identity market hit $7.4 billion in 2026. The convergence is real, and it is happening on a twelve-month timeline. This guide walks you through building a production credential wallet for your agents: SD-JWT-VC issuance, delegation chains from human to agent, cross-protocol credential presentation, eIDAS 2.0 compliance, reputation binding, and fleet-wide deployment. Every implementation uses the GreenHelix A2A Commerce Gateway API. Every pattern is designed for the December 2026 deadline.\n\n---\n\n## Table of Contents\n\n1. [The Agent Credential Problem](#chapter-1-the-agent-credential-problem)\n2. [W3C Verifiable Credentials & SD-JWT Primer](#chapter-2-w3c-verifiable-credentials--sd-jwt-primer)\n3. [Building Your Agent's Credential Wallet](#chapter-3-building-your-agents-credential-wallet)\n4. [Implementing Verifiable Intent](#chapter-4-implementing-verifiable-intent)\n5. [Cross-Protocol Credential Presentation](#chapter-5-cross-protocol-credential-presentation)\n6. [eIDAS 2.0 Compliance](#chapter-6-eidas-20-compliance)\n7. [Trust Scoring, Reputation Binding & Credential Revocation](#chapter-7-trust-scoring-reputation-binding--credential-revocation)\n\n---\n\n## Chapter 1: The Agent Credential Problem\n\n### Why API Keys and OAuth Tokens Break Under Delegation\n\nAPI keys are bearer tokens. They prove possession, not authorization. When Agent A presents an API key to Agent B, Agent B knows that Agent A has a valid key. Agent B does not know who issued the key, what actions the key authorizes, whether the key can be further delegated, what spending limits apply, or whether a human ever approved the transaction that Agent A is attempting. OAuth 2.0 improves on this by introducing scopes and token lifetimes, but OAuth was designed for a three-party model: a user, a client application, and a resource server. Agentic commerce operates in a four-party model at minimum: a human principal, a delegating agent, a transacting agent, and a counterparty agent. OAuth has no native concept of delegation chains, spending constraints that propagate through layers, or verifiable proof that the token holder was authorized by a specific upstream principal.\n\nThe failure modes are concrete:\n\n- **Stolen key replay**: A leaked API key gives the attacker the same permissions as the legitimate agent. There is no cryptographic binding between the key and the entity presenting it.\n- **Scope inflation**: An agent granted \"read marketplace\" scope uses that token to call `create_intent` because the token endpoint does not distinguish between marketplace reads and payment actions at the granularity commerce requires.\n- **Delegation opacity**: Agent A delegates to Agent B using a sub-key. Agent B delegates to Agent C. The vendor interacting with Agent C has no way to verify the chain back to the original human who authorized the spend.\n- **Constraint evaporation**: A human sets a $500 daily limit. The limit is stored in Agent A's configuration. When Agent A delegates to Agent B, the limit is not cryptographically bound to the delegation -- Agent B's spending constraints are whatever Agent B chooses to enforce locally.\n\n### The Four-Party Model Failure\n\nTraditional payment rails use a four-party model: cardholder, merchant, issuing bank, acquiring bank. Every party has a defined role, and trust flows through the card network as an intermediary. Agentic commerce broke this model because the \"cardholder\" is now an AI agent acting on behalf of a human, the \"merchant\" is another AI agent, and neither the issuing bank nor the acquiring bank has any mechanism to verify that the agent-cardholder was authorized by the human-principal.\n\n```\nTRADITIONAL FOUR-PARTY MODEL\n┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐\n│  Human   │───>│ Issuing │───>│  Card   │───>│Acquiring│───>│ Merchant│\n│(Cardhldr)│    │  Bank   │    │ Network │    │  Bank   │    │         │\n└─────────┘    └─────────┘    └─────────┘    └─────────┘    └─────────┘\n     │ Identity verified        Trust mediated         Identity verified\n     │ via KYC + PIN            by network rules       via merchant agreement\n\nAGENTIC FOUR-PARTY MODEL (BROKEN)\n┌─────────┐    ┌─────────┐    ┌─────────┐    ┌─────────┐\n│  Human   │ ??>│ Agent A │ ??>│ Gateway │ ??>│ Agent B │\n│(Principal│    │(Delegat.)│    │(Network)│    │(Vendor) │\n└─────────┘    └─────────┘    └─────────┘    └─────────┘\n     │ How does Agent A         No delegation       How does Agent B\n     │ prove human approved?    chain verification  verify constraints?\n```\n\nThe question marks are the credential gap. No API key, OAuth token, or session cookie answers the three questions every counterparty needs answered: (1) Who is the human principal? (2) What did they authorize? (3) What are the constraints?\n\n### Protocol Convergence: Mastercard, Google, OpenAI\n\nThree separate industry efforts converged on the same answer in the first quarter of 2026:\n\n**Mastercard Verifiable Intent (March 5, 2026)**: Open-sourced with Google, Fiserv, IBM, and Checkout.com. Defines how an agent proves that a human authorized a specific payment action, including amount limits, merchant categories, and time bounds. Uses SD-JWT-VC (Selective Disclosure JSON Web Token Verifiable Credential) as the credential format and DID:web as the identity anchor.\n\n**Google AP2 + Universal Commerce Protocol (UCP)**: Google's agent-to-agent protocol requires agents to present verifiable identity before any commercial transaction. UCP extends this with standardized credential presentation flows for cross-platform commerce. Both protocols accept W3C Verifiable Credentials in SD-JWT format.\n\n**OpenAI Agent Commerce Protocol (ACP)**: Defines how agents discover, negotiate, and transact with each other. The identity layer requires verifiable credentials for any transaction above a configurable threshold. ACP's credential requirements align with the W3C VC Data Model 2.0 and accept SD-JWT-VC as a presentation format.\n\nThe convergence is not accidental. All three groups independently identified the same gap: agents need cryptographically verifiable delegation chains, not just access tokens. The answer they all arrived at was W3C Verifiable Credentials with selective disclosure.\n\n| Protocol | Organization | Credential Format | Identity Anchor | Delegation Model |\n|----------|-------------|-------------------|-----------------|------------------|\n| Verifiable Intent | Mastercard + consortium | SD-JWT-VC | DID:web | Layered issuance |\n| AP2 \u002F UCP | Google | W3C VC (SD-JWT) | DID:web \u002F DID:key | Presentation exchange |\n| ACP | OpenAI | W3C VC (SD-JWT) | DID:key | Chained credentials |\n| x402 | Open standard | W3C VC (optional) | DID:web | Payment-bound proofs |\n\n### The $1.7 Trillion Market Context\n\nThe numbers define the urgency. Prove's Verified Agent launch targeted the $1.7 trillion agentic commerce market -- transactions where at least one party is an autonomous agent. Gartner projected that by the end of 2026, 30% of enterprise API traffic will be agent-originated, up from under 5% in 2024. The decentralized identity market reached $7.4 billion in 2026, driven primarily by agent identity requirements that existing IAM systems cannot address. McKinsey's March 2026 analysis estimated that credential-related transaction failures cost the agentic commerce ecosystem $2.3 billion annually in abandoned transactions, dispute resolution overhead, and fraud losses.\n\nThe cost of inaction is measurable. Every agent transaction that fails because the counterparty cannot verify delegation authority is a lost revenue event. Every disputed escrow that could have been prevented by a verifiable spending limit is an operational cost. Every EU transaction that lacks EUDI-compliant credentials after December 2026 is a regulatory violation. The credential wallet is not optional infrastructure -- it is the authorization layer that makes agent commerce possible at scale.\n\n### What This Guide Builds\n\nBy the end of this guide, your agents will have:\n\n1. A DID-anchored credential wallet managed through GreenHelix identity tools\n2. SD-JWT delegation chains that cryptographically bind human authorization to agent actions\n3. Credential presentation adapters for AP2, UCP, ACP, and x402\n4. eIDAS 2.0 compliant EUDI wallet integration for EU commerce\n5. Reputation-bound credentials with real-time revocation\n6. Fleet-wide issuance, rotation, and monitoring for production deployment\n\n---\n\n## Chapter 2: W3C Verifiable Credentials & SD-JWT Primer\n\n### Credential Anatomy\n\nA Verifiable Credential (VC) is a tamper-evident data structure with three components:\n\n**Credential metadata**: Who issued it, when, when it expires, what type it is. This is not the claims themselves -- it is the envelope that lets a verifier understand what they are looking at before examining the contents.\n\n**Claims (the subject)**: The actual assertions. \"Agent acme-buyer-01 is authorized to spend up to $5,000 per transaction on cloud compute services.\" Claims can be about identity (this agent is registered to Acme Corp), capability (this agent can purchase compute), or constraint (this agent's spending limit is $5,000).\n\n**Proof**: The cryptographic mechanism that makes the credential tamper-evident. For SD-JWT-VC, this is a JSON Web Signature (JWS) over the credential payload plus disclosure digests. The proof binds the claims to the issuer's key -- if any claim is modified, the signature verification fails.\n\n```\nVERIFIABLE CREDENTIAL STRUCTURE\n┌────────────────────────────────────────────────┐\n│  CREDENTIAL METADATA                           │\n│  ├── issuer: did:web:acme.com                  │\n│  ├── issuanceDate: 2026-04-06T00:00:00Z        │\n│  ├── expirationDate: 2026-04-07T00:00:00Z      │\n│  └── type: [VerifiableCredential,              │\n│             AgentDelegationCredential]          │\n├────────────────────────────────────────────────┤\n│  CLAIMS (credentialSubject)                    │\n│  ├── id: did:key:z6Mkw...  (agent DID)        │\n│  ├── delegatedBy: did:web:acme.com             │\n│  ├── authorizedActions: [purchase_compute]     │\n│  ├── spendingLimit: {amount: 5000, currency:   │\n│  │                    USD, period: transaction} │\n│  └── merchantCategory: [cloud_compute]         │\n├────────────────────────────────────────────────┤\n│  PROOF                                         │\n│  ├── type: JsonWebSignature2020                │\n│  ├── verificationMethod: did:web:acme.com#key1 │\n│  └── jws: eyJhbGciOiJFZERTQSJ9...             │\n└────────────────────────────────────────────────┘\n```\n\n### Selective Disclosure with SD-JWT\n\nStandard JWTs are all-or-nothing: you present the entire token or nothing. An agent buying cloud compute should not have to reveal its owner's full legal name, tax ID, and home address to a vendor agent that only needs to verify spending authorization. Selective Disclosure JWT (SD-JWT) solves this by replacing sensitive claims with salted hashes in the JWT body. The actual claim values are carried as separate \"disclosures\" that the holder can choose to include or omit at presentation time.\n\nThe SD-JWT structure has three parts separated by tildes (`~`):\n\n```\n\u003Cissuer-signed JWT> ~ \u003Cdisclosure 1> ~ \u003Cdisclosure 2> ~ ... ~ \u003Ckey binding JWT>\n```\n\n**Issuer-signed JWT**: Contains the credential metadata and hashed digests of all disclosable claims in an `_sd` array. The issuer signs this part. It is always present.\n\n**Disclosures**: Each disclosure is a base64url-encoded JSON array of `[salt, claim_name, claim_value]`. The holder includes only the disclosures they want the verifier to see. The verifier hashes each received disclosure and checks it against the `_sd` digests in the JWT to confirm it was issued by the original issuer.\n\n**Key Binding JWT**: An optional JWT signed by the holder's key that proves the presenter is the intended holder, not someone who intercepted the SD-JWT in transit. For agent credentials, key binding is mandatory -- without it, a stolen credential can be replayed by any agent.\n\n```\nSD-JWT SELECTIVE DISCLOSURE FLOW\n\nISSUANCE (all claims included):\n┌──────────────────────────┐\n│ Issuer signs JWT with    │     ┌─────────────┐\n│ _sd: [hash1, hash2,     │────>│ Agent Wallet │\n│       hash3, hash4]      │     │ stores full  │\n│                          │     │ SD-JWT + all │\n│ + disclosure(owner_name) │     │ disclosures  │\n│ + disclosure(tax_id)     │     └─────────────┘\n│ + disclosure(spend_limit)│\n│ + disclosure(actions)    │\n└──────────────────────────┘\n\nPRESENTATION (selective):\n┌─────────────┐     ┌──────────────────────────┐\n│ Agent Wallet │────>│ JWT (with all 4 hashes)  │\n│ reveals only │     │ + disclosure(spend_limit) │\n│ 2 of 4      │     │ + disclosure(actions)     │\n│ claims       │     │ + key_binding_jwt         │\n└─────────────┘     └──────────────────────────┘\n                    Verifier sees spend_limit & actions.\n                    Cannot derive owner_name or tax_id\n                    (only hashes remain in the JWT).\n```\n\n### SD-JWT-VC Format for Agent Credentials\n\nSD-JWT-VC is the specific profile of SD-JWT designed for Verifiable Credentials. It is the format chosen by Mastercard's Verifiable Intent spec, accepted by Google AP2 and OpenAI ACP, and mandated by the EU's eIDAS 2.0 Architecture Reference Framework for EUDI Wallet credentials.\n\nThe key properties of SD-JWT-VC for agent developers:\n\n- **`iss`**: The issuer's identifier, typically a DID:web URL that resolves to a DID Document containing the issuer's public key.\n- **`sub`**: The subject of the credential -- the agent's DID.\n- **`iat`** \u002F **`exp`**: Issuance and expiration timestamps. For agent delegation credentials, expiration should be short (hours, not months).\n- **`cnf`**: Confirmation claim that binds the credential to the holder's key. Contains the holder's public key or a reference to it. This is what enables key binding.\n- **`_sd`**: Array of digests for selectively disclosable claims.\n- **`vct`**: Verifiable Credential Type -- a URI identifying the credential schema (e.g., `https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fagent-delegation\u002Fv1`).\n\n### Delegation Chains as Layered SD-JWT Issuance\n\nA delegation chain is a sequence of credentials where each credential's subject becomes the issuer of the next credential. The human principal issues a credential to their primary agent. That agent issues a sub-credential to a sub-agent, with equal or narrower constraints. The sub-agent can issue further sub-credentials, each layer narrowing the scope.\n\n```\nDELEGATION CHAIN (3 LAYERS)\n\nLayer 0: Human Principal\n  └── Issues VC to Agent A\n      iss: did:web:alice.com\n      sub: did:key:agentA\n      spend_limit: $10,000\u002Fday\n      actions: [purchase_compute, purchase_storage]\n\nLayer 1: Agent A\n  └── Issues VC to Agent B (sub-delegation)\n      iss: did:key:agentA\n      sub: did:key:agentB\n      spend_limit: $2,000\u002Ftransaction  (narrowed from $10k\u002Fday)\n      actions: [purchase_compute]       (narrowed from 2 actions)\n      parent_credential: \u003Chash of Layer 0 VC>\n\nLayer 2: Agent B\n  └── Presents to Vendor Agent C\n      Includes: Layer 2 VC + Layer 1 VC + Layer 0 VC\n      Vendor verifies entire chain back to did:web:alice.com\n```\n\nThe critical property is **constraint narrowing**: each layer can only narrow the constraints of its parent. Agent A received a $10,000\u002Fday limit and cannot issue Agent B a $20,000\u002Fday credential. Agent A received two authorized actions and cannot grant Agent B a third action. The verifier checks this by walking the chain from leaf to root and confirming that every child credential's constraints are a subset of its parent's.\n\n---\n\n## Chapter 3: Building Your Agent's Credential Wallet\n\n### Prerequisites\n\nYou need a GreenHelix API key with pro tier access (identity tools `build_claim_chain`, `search_agents_by_metrics`, and `submit_metrics` require pro tier). Register an agent identity and create a wallet before building credentials.\n\n### The CredentialWallet Class\n\n```python\nimport requests\nimport json\nimport hashlib\nimport time\nimport base64\nimport secrets\nfrom typing import Optional, Dict, List, Any\nfrom dataclasses import dataclass, field, asdict\n\n# --- GreenHelix sandbox session (free tier: 500 credits, no key required) ---\n# To get started, visit https:\u002F\u002Fsandbox.greenhelix.net — no signup needed.\n# For production, set GREENHELIX_API_KEY in your environment.\nimport os\n\nAPI_BASE = os.environ.get(\"GREENHELIX_API_URL\", \"https:\u002F\u002Fsandbox.greenhelix.net\")\n\nsession = requests.Session()\napi_key = os.environ.get(\"GREENHELIX_API_KEY\", \"\")\nif api_key:\n    session.headers[\"Authorization\"] = f\"Bearer {api_key}\"\nsession.headers[\"Content-Type\"] = \"application\u002Fjson\"\n\n\ndef api_call(tool: str, input_data: dict) -> dict:\n    \"\"\"Call a GreenHelix REST endpoint for the given tool.\"\"\"\n    response = session.post(f\"{API_BASE}\u002Fv1\u002Ftools\u002F{tool}\", json=input_data)\n    response.raise_for_status()\n    return response.json()\n\n\n@dataclass\nclass Disclosure:\n    \"\"\"A single SD-JWT disclosure: [salt, claim_name, claim_value].\"\"\"\n    salt: str\n    claim_name: str\n    claim_value: Any\n\n    def encode(self) -> str:\n        \"\"\"Base64url-encode the disclosure array.\"\"\"\n        payload = json.dumps([self.salt, self.claim_name, self.claim_value])\n        return base64.urlsafe_b64encode(payload.encode()).rstrip(b\"=\").decode()\n\n    def digest(self) -> str:\n        \"\"\"SHA-256 digest of the encoded disclosure.\"\"\"\n        encoded = self.encode()\n        return base64.urlsafe_b64encode(\n            hashlib.sha256(encoded.encode()).digest()\n        ).rstrip(b\"=\").decode()\n\n\n@dataclass\nclass AgentCredential:\n    \"\"\"An SD-JWT-VC credential with selective disclosure support.\"\"\"\n    issuer_did: str\n    subject_did: str\n    credential_type: str\n    claims: Dict[str, Any]\n    disclosable_claims: List[str]  # claim names that support selective disclosure\n    issued_at: float = field(default_factory=time.time)\n    expires_at: Optional[float] = None\n    parent_hash: Optional[str] = None  # hash of parent credential in chain\n    disclosures: List[Disclosure] = field(default_factory=list)\n\n    def __post_init__(self):\n        if self.expires_at is None:\n            self.expires_at = self.issued_at + 86400  # 24h default\n        # Generate disclosures for disclosable claims\n        self.disclosures = []\n        for name in self.disclosable_claims:\n            if name in self.claims:\n                self.disclosures.append(Disclosure(\n                    salt=secrets.token_urlsafe(16),\n                    claim_name=name,\n                    claim_value=self.claims[name],\n                ))\n\n    def sd_digests(self) -> List[str]:\n        \"\"\"Compute _sd array of disclosure digests.\"\"\"\n        return [d.digest() for d in self.disclosures]\n\n    def jwt_payload(self) -> dict:\n        \"\"\"Build the issuer-signed JWT payload.\"\"\"\n        payload = {\n            \"iss\": self.issuer_did,\n            \"sub\": self.subject_did,\n            \"iat\": int(self.issued_at),\n            \"exp\": int(self.expires_at),\n            \"vct\": self.credential_type,\n            \"_sd\": self.sd_digests(),\n            \"_sd_alg\": \"sha-256\",\n        }\n        # Include non-disclosable claims directly\n        for name, value in self.claims.items():\n            if name not in self.disclosable_claims:\n                payload[name] = value\n        if self.parent_hash:\n            payload[\"parent_credential\"] = self.parent_hash\n        return payload\n\n    def present(self, disclosed_claims: List[str]) -> dict:\n        \"\"\"Create a presentation with only the specified claims disclosed.\"\"\"\n        selected = [d for d in self.disclosures if d.claim_name in disclosed_claims]\n        return {\n            \"jwt_payload\": self.jwt_payload(),\n            \"disclosures\": [d.encode() for d in selected],\n            \"disclosed_values\": {\n                d.claim_name: d.claim_value for d in selected\n            },\n        }\n\n    def credential_hash(self) -> str:\n        \"\"\"SHA-256 hash of the credential payload for chain linking.\"\"\"\n        payload_bytes = json.dumps(self.jwt_payload(), sort_keys=True).encode()\n        return hashlib.sha256(payload_bytes).hexdigest()\n\n\nclass CredentialWallet:\n    \"\"\"Agent credential wallet backed by GreenHelix identity tools.\n\n    Manages the full credential lifecycle: registration, wallet creation,\n    credential issuance, chain building, and selective presentation.\n    \"\"\"\n\n    def __init__(self, agent_id: str, display_name: str, owner: str):\n        self.agent_id = agent_id\n        self.display_name = display_name\n        self.owner = owner\n        self.wallet_id: Optional[str] = None\n        self.did: Optional[str] = None\n        self.credentials: Dict[str, AgentCredential] = {}\n        self.chain_ids: List[str] = []\n\n    def register(self) -> dict:\n        \"\"\"Register the agent identity on GreenHelix.\n\n        This creates the agent's DID and registers its public key.\n        Must be called before any other wallet operation.\n        \"\"\"\n        result = api_call(\"register_agent\", {\n            \"agent_id\": self.agent_id,\n            \"display_name\": self.display_name,\n            \"owner\": self.owner,\n        })\n        self.did = f\"did:key:{self.agent_id}\"\n        return result\n\n    def create_wallet(self) -> dict:\n        \"\"\"Create the agent's credential wallet (on-chain store).\n\n        The wallet is a DID-anchored credential store that holds\n        issued credentials and supports selective disclosure presentation.\n        \"\"\"\n        result = api_call(\"create_wallet\", {\n            \"agent_id\": self.agent_id,\n            \"wallet_type\": \"credential\",\n            \"metadata\": {\n                \"owner\": self.owner,\n                \"did\": self.did,\n                \"created_at\": time.time(),\n            },\n        })\n        self.wallet_id = result.get(\"wallet_id\", f\"wallet-{self.agent_id}\")\n        return result\n\n    def issue_credential(\n        self,\n        credential_id: str,\n        subject_did: str,\n        credential_type: str,\n        claims: Dict[str, Any],\n        disclosable_claims: List[str],\n        ttl_seconds: int = 86400,\n        parent_credential_id: Optional[str] = None,\n    ) -> AgentCredential:\n        \"\"\"Issue an SD-JWT-VC credential to a subject.\n\n        Args:\n            credential_id: Unique ID for this credential.\n            subject_did: DID of the agent receiving the credential.\n            credential_type: VC type URI.\n            claims: All claims to include.\n            disclosable_claims: Claim names that support selective disclosure.\n            ttl_seconds: Credential lifetime in seconds.\n            parent_credential_id: ID of parent credential for delegation chains.\n\n        Returns:\n            The issued AgentCredential object.\n        \"\"\"\n        parent_hash = None\n        if parent_credential_id and parent_credential_id in self.credentials:\n            parent_hash = self.credentials[parent_credential_id].credential_hash()\n\n        credential = AgentCredential(\n            issuer_did=self.did,\n            subject_did=subject_did,\n            credential_type=credential_type,\n            claims=claims,\n            disclosable_claims=disclosable_claims,\n            expires_at=time.time() + ttl_seconds,\n            parent_hash=parent_hash,\n        )\n        self.credentials[credential_id] = credential\n        return credential\n\n    def build_chain(self) -> dict:\n        \"\"\"Build a Merkle claim chain over all issued credentials.\n\n        This anchors the credential history in a tamper-evident structure.\n        Uses GreenHelix build_claim_chain to create the chain.\n        \"\"\"\n        # Prepare claims from all credentials\n        chain_claims = []\n        for cred_id, cred in self.credentials.items():\n            chain_claims.append({\n                \"credential_id\": cred_id,\n                \"credential_hash\": cred.credential_hash(),\n                \"subject\": cred.subject_did,\n                \"type\": cred.credential_type,\n                \"issued_at\": cred.issued_at,\n                \"expires_at\": cred.expires_at,\n            })\n\n        result = api_call(\"build_claim_chain\", {\n            \"agent_id\": self.agent_id,\n            \"claims\": chain_claims,\n            \"chain_type\": \"credential_issuance\",\n        })\n        if \"chain_id\" in result:\n            self.chain_ids.append(result[\"chain_id\"])\n        return result\n\n    def get_chains(self) -> dict:\n        \"\"\"Retrieve all claim chains for this agent.\"\"\"\n        return api_call(\"get_claim_chains\", {\n            \"agent_id\": self.agent_id,\n        })\n\n    def present_credential(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n    ) -> dict:\n        \"\"\"Create a selective disclosure presentation.\n\n        Args:\n            credential_id: The credential to present.\n            disclosed_claims: Which claims to reveal.\n\n        Returns:\n            Presentation object with JWT payload and selected disclosures.\n        \"\"\"\n        if credential_id not in self.credentials:\n            raise KeyError(f\"Credential {credential_id} not found in wallet\")\n        return self.credentials[credential_id].present(disclosed_claims)\n```\n\n### Registering and Creating a Wallet\n\n```python\n# Initialize the wallet for a procurement agent\nwallet = CredentialWallet(\n    agent_id=\"acme-procurement-01\",\n    display_name=\"Acme Procurement Agent #1\",\n    owner=\"alice@acme.com\",\n)\n\n# Step 1: Register the agent identity\nregistration = wallet.register()\nprint(f\"Agent registered: {wallet.did}\")\n# Output: Agent registered: did:key:acme-procurement-01\n\n# Step 2: Create the credential wallet\nwallet_result = wallet.create_wallet()\nprint(f\"Wallet created: {wallet.wallet_id}\")\n# Output: Wallet created: wallet-acme-procurement-01\n```\n\n### Issuing Your First Credential\n\n```python\n# The organization (human principal) issues a delegation credential\n# to the procurement agent\ndelegation_cred = wallet.issue_credential(\n    credential_id=\"delegation-001\",\n    subject_did=\"did:key:acme-procurement-01\",\n    credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fagent-delegation\u002Fv1\",\n    claims={\n        \"delegated_by\": \"did:web:acme.com\",\n        \"authorized_actions\": [\"purchase_compute\", \"purchase_storage\"],\n        \"spending_limit\": {\"amount\": \"10000\", \"currency\": \"USD\", \"period\": \"day\"},\n        \"merchant_categories\": [\"cloud_compute\", \"cloud_storage\"],\n        \"principal_name\": \"Alice Chen\",\n        \"principal_tax_id\": \"XX-XXXXXXX\",\n        \"organization\": \"Acme Corp\",\n    },\n    disclosable_claims=[\n        \"principal_name\",\n        \"principal_tax_id\",\n        \"spending_limit\",\n        \"merchant_categories\",\n    ],\n    ttl_seconds=28800,  # 8-hour session credential\n)\n\nprint(f\"Credential issued. Hash: {delegation_cred.credential_hash()[:16]}...\")\nprint(f\"SD digests: {len(delegation_cred.sd_digests())} disclosable claims\")\n```\n\n### Anchoring Credentials in a Claim Chain\n\n```python\n# After issuing credentials, anchor them in a Merkle claim chain\nchain_result = wallet.build_chain()\nprint(f\"Chain built: {chain_result}\")\n\n# Verify chains are retrievable\nchains = wallet.get_chains()\nprint(f\"Active chains: {len(chains.get('chains', []))}\")\n```\n\n---\n\n## Chapter 4: Implementing Verifiable Intent\n\n### What Verifiable Intent Means\n\nVerifiable Intent (VI) is the Mastercard-originated specification that answers one question: \"Did a human authorize this agent to perform this specific financial action?\" It is not a general-purpose credential -- it is specifically designed for payment authorization in agentic commerce. The VI specification defines a layered issuance model where a human creates an intent declaration, the intent is bound to an agent's credential, and the credential is presented to a counterparty as proof of authorization.\n\nThe three components of Verifiable Intent:\n\n1. **Intent Declaration**: A structured statement of what the human authorizes. \"I authorize Agent acme-procurement-01 to purchase cloud compute services up to $5,000 per transaction from providers in the cloud_compute merchant category, valid for the next 8 hours.\"\n\n2. **Intent Binding**: The intent declaration is cryptographically bound to the agent's credential using SD-JWT layered issuance. The intent becomes a claim in the agent's delegation credential.\n\n3. **Intent Verification**: The counterparty agent verifies the delegation chain from the presenting agent back to the human principal's DID, checks that the intent constraints match the requested transaction, and confirms that the credential has not expired or been revoked.\n\n### Session-Level Spending Limits\n\nThe most common VI use case is spending limits. A human authorizes an agent to spend up to X dollars within a session. The session has a start time and an end time. Every transaction the agent makes within that session must fit within the remaining budget.\n\n```python\nclass VerifiableIntentManager:\n    \"\"\"Manages Verifiable Intent credentials for payment authorization.\n\n    Implements the Mastercard VI specification with GreenHelix tools:\n    intent declaration, binding, session limits, and chain verification.\n    \"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.active_intents: Dict[str, dict] = {}\n        self.session_spent: Dict[str, float] = {}\n\n    def declare_intent(\n        self,\n        intent_id: str,\n        authorized_actions: List[str],\n        spending_limit_usd: float,\n        merchant_categories: List[str],\n        session_hours: float = 8.0,\n        additional_constraints: Optional[Dict] = None,\n    ) -> AgentCredential:\n        \"\"\"Declare a Verifiable Intent and bind it to the agent's credential.\n\n        This is called by (or on behalf of) the human principal to authorize\n        the agent for specific financial actions within constraints.\n\n        Args:\n            intent_id: Unique identifier for this intent session.\n            authorized_actions: Actions the agent may perform.\n            spending_limit_usd: Maximum USD the agent can spend in this session.\n            merchant_categories: Allowed merchant\u002Fservice categories.\n            session_hours: Session duration in hours.\n            additional_constraints: Extra constraints (region, vendor whitelist, etc).\n\n        Returns:\n            The issued intent credential.\n        \"\"\"\n        now = time.time()\n        session_end = now + (session_hours * 3600)\n\n        intent_claims = {\n            \"intent_type\": \"payment_authorization\",\n            \"authorized_actions\": authorized_actions,\n            \"spending_limit\": {\n                \"amount\": str(spending_limit_usd),\n                \"currency\": \"USD\",\n                \"period\": \"session\",\n            },\n            \"merchant_categories\": merchant_categories,\n            \"session_start\": now,\n            \"session_end\": session_end,\n            \"principal_did\": f\"did:web:{self.wallet.owner.split('@')[1]}\",\n            \"principal_email\": self.wallet.owner,\n        }\n        if additional_constraints:\n            intent_claims[\"constraints\"] = additional_constraints\n\n        # Issue as SD-JWT-VC -- principal email is disclosable,\n        # spending limit and actions are always visible to verifiers\n        credential = self.wallet.issue_credential(\n            credential_id=intent_id,\n            subject_did=self.wallet.did,\n            credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fverifiable-intent\u002Fv1\",\n            claims=intent_claims,\n            disclosable_claims=[\"principal_email\", \"constraints\"],\n            ttl_seconds=int(session_hours * 3600),\n        )\n\n        self.active_intents[intent_id] = {\n            \"credential\": credential,\n            \"spending_limit\": spending_limit_usd,\n            \"session_end\": session_end,\n        }\n        self.session_spent[intent_id] = 0.0\n\n        return credential\n\n    def check_intent_budget(self, intent_id: str, amount_usd: float) -> dict:\n        \"\"\"Check if a transaction fits within the intent's remaining budget.\n\n        Returns:\n            Dict with 'authorized' bool, 'remaining' float, and 'reason' if denied.\n        \"\"\"\n        if intent_id not in self.active_intents:\n            return {\"authorized\": False, \"remaining\": 0, \"reason\": \"Intent not found\"}\n\n        intent = self.active_intents[intent_id]\n        if time.time() > intent[\"session_end\"]:\n            return {\"authorized\": False, \"remaining\": 0, \"reason\": \"Session expired\"}\n\n        spent = self.session_spent.get(intent_id, 0.0)\n        remaining = intent[\"spending_limit\"] - spent\n\n        if amount_usd > remaining:\n            return {\n                \"authorized\": False,\n                \"remaining\": remaining,\n                \"reason\": f\"Amount ${amount_usd} exceeds remaining budget ${remaining}\",\n            }\n\n        return {\"authorized\": True, \"remaining\": remaining - amount_usd}\n\n    def execute_authorized_payment(\n        self,\n        intent_id: str,\n        vendor_agent_id: str,\n        amount_usd: float,\n        description: str,\n    ) -> dict:\n        \"\"\"Execute a payment action under a Verifiable Intent session.\n\n        Checks the budget, creates an intent via GreenHelix, and records the spend.\n        \"\"\"\n        # Step 1: Check budget\n        budget_check = self.check_intent_budget(intent_id, amount_usd)\n        if not budget_check[\"authorized\"]:\n            return {\"status\": \"denied\", \"reason\": budget_check[\"reason\"]}\n\n        # Step 2: Create the payment intent via GreenHelix\n        intent_result = api_call(\"create_intent\", {\n            \"from_agent\": self.wallet.agent_id,\n            \"to_agent\": vendor_agent_id,\n            \"amount\": str(amount_usd),\n            \"currency\": \"USD\",\n            \"description\": description,\n            \"metadata\": {\n                \"vi_session\": intent_id,\n                \"credential_hash\": self.active_intents[intent_id][\n                    \"credential\"\n                ].credential_hash(),\n            },\n        })\n\n        # Step 3: Record the spend against the session budget\n        self.session_spent[intent_id] = (\n            self.session_spent.get(intent_id, 0.0) + amount_usd\n        )\n\n        return {\n            \"status\": \"authorized\",\n            \"intent_result\": intent_result,\n            \"remaining_budget\": budget_check[\"remaining\"] - amount_usd,\n        }\n```\n\n### Using Verifiable Intent\n\n```python\n# Create the wallet and intent manager\nwallet = CredentialWallet(\n    agent_id=\"acme-buyer-01\",\n    display_name=\"Acme Cloud Buyer\",\n    owner=\"alice@acme.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\nvi_manager = VerifiableIntentManager(wallet)\n\n# Human declares intent: authorize the agent for cloud purchases\nintent_cred = vi_manager.declare_intent(\n    intent_id=\"session-2026-04-06-001\",\n    authorized_actions=[\"purchase_compute\"],\n    spending_limit_usd=5000.00,\n    merchant_categories=[\"cloud_compute\"],\n    session_hours=8.0,\n    additional_constraints={\"region\": \"us-east\", \"max_per_tx\": \"2000\"},\n)\nprint(f\"Intent declared. Expires: {intent_cred.expires_at}\")\n\n# Agent executes a purchase within the intent\npayment = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=1500.00,\n    description=\"8x A100 GPU instances, 4 hours\",\n)\nprint(f\"Payment: {payment['status']}, remaining: ${payment['remaining_budget']}\")\n# Output: Payment: authorized, remaining: $3500.0\n\n# Second purchase\npayment2 = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=2000.00,\n    description=\"16x A100 GPU instances, 2 hours\",\n)\nprint(f\"Payment: {payment2['status']}, remaining: ${payment2['remaining_budget']}\")\n# Output: Payment: authorized, remaining: $1500.0\n\n# Third purchase exceeds remaining budget\npayment3 = vi_manager.execute_authorized_payment(\n    intent_id=\"session-2026-04-06-001\",\n    vendor_agent_id=\"cloudvendor-gpu-fleet\",\n    amount_usd=2000.00,\n    description=\"16x A100 GPU instances, 2 hours\",\n)\nprint(f\"Payment: {payment3['status']}, reason: {payment3.get('reason')}\")\n# Output: Payment: denied, reason: Amount $2000.0 exceeds remaining budget $1500.0\n```\n\n### Sub-Delegation with Constraint Narrowing\n\nWhen your primary agent delegates to a sub-agent, the delegation must narrow or maintain the parent's constraints. This is enforced structurally: the sub-credential references the parent credential's hash and includes only a subset of the parent's authorized actions and a spending limit less than or equal to the parent's.\n\n```python\ndef delegate_intent(\n    parent_wallet: CredentialWallet,\n    parent_intent_id: str,\n    child_wallet: CredentialWallet,\n    child_intent_id: str,\n    narrowed_actions: List[str],\n    narrowed_limit_usd: float,\n    ttl_seconds: int = 3600,\n) -> AgentCredential:\n    \"\"\"Delegate a Verifiable Intent to a sub-agent with narrowed constraints.\n\n    The child credential references the parent credential hash and must\n    have equal or narrower constraints.\n    \"\"\"\n    parent_cred = parent_wallet.credentials.get(parent_intent_id)\n    if not parent_cred:\n        raise ValueError(f\"Parent intent {parent_intent_id} not found\")\n\n    parent_actions = parent_cred.claims.get(\"authorized_actions\", [])\n    parent_limit = float(\n        parent_cred.claims.get(\"spending_limit\", {}).get(\"amount\", \"0\")\n    )\n\n    # Enforce constraint narrowing\n    for action in narrowed_actions:\n        if action not in parent_actions:\n            raise ValueError(\n                f\"Action '{action}' not in parent's authorized actions: {parent_actions}\"\n            )\n    if narrowed_limit_usd > parent_limit:\n        raise ValueError(\n            f\"Limit ${narrowed_limit_usd} exceeds parent limit ${parent_limit}\"\n        )\n\n    # Issue sub-delegation credential\n    child_cred = parent_wallet.issue_credential(\n        credential_id=child_intent_id,\n        subject_did=child_wallet.did,\n        credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fverifiable-intent\u002Fv1\",\n        claims={\n            \"intent_type\": \"delegated_payment_authorization\",\n            \"authorized_actions\": narrowed_actions,\n            \"spending_limit\": {\n                \"amount\": str(narrowed_limit_usd),\n                \"currency\": \"USD\",\n                \"period\": \"session\",\n            },\n            \"delegated_by\": parent_wallet.did,\n            \"delegation_depth\": 1,\n        },\n        disclosable_claims=[\"delegated_by\"],\n        ttl_seconds=ttl_seconds,\n        parent_credential_id=parent_intent_id,\n    )\n\n    return child_cred\n\n\n# Example: primary agent delegates to a specialized compute buyer\nchild_wallet = CredentialWallet(\n    agent_id=\"acme-compute-buyer-01\",\n    display_name=\"Acme Compute Specialist\",\n    owner=\"alice@acme.com\",\n)\nchild_wallet.register()\nchild_wallet.create_wallet()\n\nsub_cred = delegate_intent(\n    parent_wallet=wallet,\n    parent_intent_id=\"session-2026-04-06-001\",\n    child_wallet=child_wallet,\n    child_intent_id=\"sub-session-001\",\n    narrowed_actions=[\"purchase_compute\"],  # same as parent\n    narrowed_limit_usd=2000.00,  # narrowed from $5,000\n    ttl_seconds=3600,  # 1 hour\n)\nprint(f\"Sub-delegation issued. Parent hash: {sub_cred.parent_hash[:16]}...\")\n```\n\n---\n\n## Chapter 5: Cross-Protocol Credential Presentation\n\n### The Multi-Protocol Reality\n\nYour agent will not operate in a single protocol ecosystem. A procurement agent might discover vendors via Google AP2, negotiate terms over UCP, execute payment through Mastercard's rails, and settle micropayments via x402. Each protocol has its own credential presentation format, but they all accept W3C Verifiable Credentials in SD-JWT format. The adapter pattern lets your wallet present credentials in the format each protocol expects without duplicating credential storage or issuance logic.\n\n```\nCROSS-PROTOCOL PRESENTATION FLOW\n\n┌─────────────────────────────────────────────────┐\n│           CREDENTIAL WALLET                      │\n│  ┌─────────────────────────────────┐            │\n│  │  SD-JWT-VC Credentials          │            │\n│  │  (canonical format)             │            │\n│  └──────────┬──────────────────────┘            │\n│             │                                    │\n│  ┌──────────┼──────────────────────────────┐    │\n│  │          │    PRESENTATION ADAPTERS      │    │\n│  │  ┌───────▼───┐ ┌─────────┐ ┌─────────┐ │    │\n│  │  │   AP2     │ │   UCP   │ │   ACP   │ │    │\n│  │  │ Adapter   │ │ Adapter │ │ Adapter │ │    │\n│  │  └───────┬───┘ └────┬────┘ └────┬────┘ │    │\n│  │  ┌───────▼──────────▼───────────▼────┐  │    │\n│  │  │           x402 Adapter            │  │    │\n│  │  └───────────────────────────────────┘  │    │\n│  └─────────────────────────────────────────┘    │\n└─────────────────────────────────────────────────┘\n```\n\n### Protocol Comparison\n\n| Feature | AP2 (Google) | UCP | ACP (OpenAI) | x402 |\n|---------|-------------|-----|-------------|------|\n| Discovery | Agent card + DNS-SD | Registry + broadcast | Capability manifest | HTTP 402 response |\n| Auth handshake | Mutual VC exchange | VC + capability proof | VC + scope assertion | Payment proof header |\n| Credential format | SD-JWT-VC | SD-JWT-VC | SD-JWT-VC or JWT-VC | Payment attestation |\n| Delegation depth | Unlimited (chain verified) | Max 3 hops | Max 5 hops | Single hop |\n| Selective disclosure | Full SD-JWT support | Full SD-JWT support | Partial (required claims) | Minimal (amount only) |\n| Payment integration | External (via intent) | Built-in escrow | External (via intent) | Native (HTTP header) |\n\n### The ProtocolAdapter Base and Implementations\n\n```python\nfrom abc import ABC, abstractmethod\n\n\nclass ProtocolAdapter(ABC):\n    \"\"\"Base class for protocol-specific credential presentation adapters.\"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n\n    @abstractmethod\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        \"\"\"Format a credential presentation for the target protocol.\"\"\"\n        pass\n\n    @abstractmethod\n    def verify_counterparty(self, presentation: dict) -> dict:\n        \"\"\"Verify a counterparty's credential presentation.\"\"\"\n        pass\n\n\nclass AP2Adapter(ProtocolAdapter):\n    \"\"\"Google Agent-to-Agent Protocol (AP2) credential adapter.\n\n    AP2 requires mutual credential exchange during the handshake phase.\n    Both agents present credentials before any commercial interaction.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        presentation = self.wallet.present_credential(credential_id, disclosed_claims)\n\n        return {\n            \"protocol\": \"ap2\",\n            \"version\": \"1.0\",\n            \"agent_card\": {\n                \"agent_id\": self.wallet.agent_id,\n                \"did\": self.wallet.did,\n                \"display_name\": self.wallet.display_name,\n                \"capabilities\": protocol_metadata.get(\"capabilities\", []),\n            },\n            \"credential_presentation\": {\n                \"format\": \"sd-jwt-vc\",\n                \"jwt_payload\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n            },\n            \"handshake_nonce\": secrets.token_urlsafe(32),\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        \"\"\"Verify an AP2 counterparty presentation.\n\n        Checks: credential format, DID resolution, disclosure validation.\n        \"\"\"\n        if presentation.get(\"protocol\") != \"ap2\":\n            return {\"valid\": False, \"reason\": \"Not an AP2 presentation\"}\n\n        cred = presentation.get(\"credential_presentation\", {})\n        if cred.get(\"format\") != \"sd-jwt-vc\":\n            return {\"valid\": False, \"reason\": \"Unsupported credential format\"}\n\n        # Verify the agent identity via GreenHelix\n        agent_card = presentation.get(\"agent_card\", {})\n        identity_check = api_call(\"get_agent_reputation\", {\n            \"agent_id\": agent_card.get(\"agent_id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": agent_card.get(\"agent_id\"),\n            \"did\": agent_card.get(\"did\"),\n            \"reputation\": identity_check,\n        }\n\n\nclass UCPAdapter(ProtocolAdapter):\n    \"\"\"Universal Commerce Protocol (UCP) credential adapter.\n\n    UCP extends AP2 with commerce-specific flows: escrow, SLA, and\n    capability proof. Credentials must include commerce capabilities.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        presentation = self.wallet.present_credential(credential_id, disclosed_claims)\n\n        # UCP requires escrow capability proof\n        escrow_capable = \"create_escrow\" in protocol_metadata.get(\"tools\", [])\n\n        return {\n            \"protocol\": \"ucp\",\n            \"version\": \"1.0\",\n            \"identity\": {\n                \"did\": self.wallet.did,\n                \"agent_id\": self.wallet.agent_id,\n            },\n            \"credential\": {\n                \"format\": \"sd-jwt-vc\",\n                \"payload\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n            },\n            \"commerce_capabilities\": {\n                \"escrow_capable\": escrow_capable,\n                \"sla_capable\": True,\n                \"supported_currencies\": protocol_metadata.get(\"currencies\", [\"USD\"]),\n            },\n            \"service_endpoint\": protocol_metadata.get(\n                \"endpoint\", f\"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"\n            ),\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"ucp\":\n            return {\"valid\": False, \"reason\": \"Not a UCP presentation\"}\n\n        identity = presentation.get(\"identity\", {})\n        commerce = presentation.get(\"commerce_capabilities\", {})\n\n        # Verify identity and check commerce capabilities\n        rep = api_call(\"get_agent_reputation\", {\n            \"agent_id\": identity.get(\"agent_id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": identity.get(\"agent_id\"),\n            \"escrow_capable\": commerce.get(\"escrow_capable\", False),\n            \"reputation\": rep,\n        }\n\n\nclass ACPAdapter(ProtocolAdapter):\n    \"\"\"OpenAI Agent Commerce Protocol (ACP) credential adapter.\n\n    ACP uses scope assertions: the credential must declare what commercial\n    actions the agent is authorized for. Required claims are not selectively\n    disclosable -- ACP mandates their visibility.\n    \"\"\"\n\n    ACP_REQUIRED_CLAIMS = [\"authorized_actions\", \"spending_limit\", \"intent_type\"]\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        # ACP requires certain claims to always be disclosed\n        all_disclosed = list(set(disclosed_claims + self.ACP_REQUIRED_CLAIMS))\n        presentation = self.wallet.present_credential(credential_id, all_disclosed)\n\n        return {\n            \"protocol\": \"acp\",\n            \"version\": \"1.0\",\n            \"agent\": {\n                \"id\": self.wallet.agent_id,\n                \"did\": self.wallet.did,\n            },\n            \"scope_assertion\": {\n                \"format\": \"sd-jwt-vc\",\n                \"credential\": presentation[\"jwt_payload\"],\n                \"disclosures\": presentation[\"disclosures\"],\n                \"disclosed_values\": presentation[\"disclosed_values\"],\n            },\n            \"transaction_context\": {\n                \"requested_action\": protocol_metadata.get(\"action\", \"\"),\n                \"amount\": protocol_metadata.get(\"amount\", \"\"),\n                \"currency\": protocol_metadata.get(\"currency\", \"USD\"),\n            },\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"acp\":\n            return {\"valid\": False, \"reason\": \"Not an ACP presentation\"}\n\n        scope = presentation.get(\"scope_assertion\", {})\n        disclosed = scope.get(\"disclosed_values\", {})\n\n        # Check all required claims are present\n        for claim in self.ACP_REQUIRED_CLAIMS:\n            if claim not in disclosed:\n                return {\"valid\": False, \"reason\": f\"Missing required claim: {claim}\"}\n\n        agent = presentation.get(\"agent\", {})\n        rep = api_call(\"get_agent_reputation\", {\n            \"agent_id\": agent.get(\"id\", \"\"),\n        })\n\n        return {\n            \"valid\": True,\n            \"agent_id\": agent.get(\"id\"),\n            \"authorized_actions\": disclosed.get(\"authorized_actions\"),\n            \"spending_limit\": disclosed.get(\"spending_limit\"),\n            \"reputation\": rep,\n        }\n\n\nclass X402Adapter(ProtocolAdapter):\n    \"\"\"x402 payment protocol credential adapter.\n\n    x402 is a lightweight HTTP-based payment protocol. Credentials are\n    presented as HTTP headers on 402 Payment Required responses.\n    This adapter formats payment attestations for x402 flows.\n    \"\"\"\n\n    def format_presentation(\n        self,\n        credential_id: str,\n        disclosed_claims: List[str],\n        protocol_metadata: Dict,\n    ) -> dict:\n        # x402 uses minimal disclosure: just the payment proof\n        presentation = self.wallet.present_credential(\n            credential_id, [\"spending_limit\"]\n        )\n\n        return {\n            \"protocol\": \"x402\",\n            \"version\": \"1.0\",\n            \"payment_header\": {\n                \"X-Agent-DID\": self.wallet.did,\n                \"X-Payment-Credential\": json.dumps(presentation[\"jwt_payload\"]),\n                \"X-Payment-Amount\": protocol_metadata.get(\"amount\", \"\"),\n                \"X-Payment-Currency\": protocol_metadata.get(\"currency\", \"USD\"),\n            },\n            \"attestation\": {\n                \"credential_hash\": self.wallet.credentials[\n                    credential_id\n                ].credential_hash(),\n                \"agent_id\": self.wallet.agent_id,\n            },\n        }\n\n    def verify_counterparty(self, presentation: dict) -> dict:\n        if presentation.get(\"protocol\") != \"x402\":\n            return {\"valid\": False, \"reason\": \"Not an x402 presentation\"}\n\n        headers = presentation.get(\"payment_header\", {})\n        agent_did = headers.get(\"X-Agent-DID\", \"\")\n\n        # Minimal verification for x402: check the agent exists\n        # Full verification happens at settlement\n        return {\n            \"valid\": bool(agent_did),\n            \"agent_did\": agent_did,\n            \"amount\": headers.get(\"X-Payment-Amount\"),\n        }\n```\n\n### Choosing the Right Protocol\n\nThe decision of which protocol adapter to use for a given interaction depends on what you are doing in that interaction. Discovery and initial contact typically happen over AP2, because Google's agent card mechanism provides the richest service description format. Price negotiation and SLA agreement happen over UCP, because it has built-in escrow and SLA primitives. Payment execution happens over ACP or Mastercard VI rails, because these protocols have the strongest payment authorization verification. Micropayments and per-request billing happen over x402, because it is the lowest-overhead protocol for small amounts -- the credential is a single HTTP header.\n\nIn practice, a single commercial transaction often spans three or four protocols. Your agent discovers a vendor via AP2, negotiates terms over UCP, executes the primary payment via ACP with a Verifiable Intent credential, and then pays per-API-call overages via x402. The credential wallet stores one canonical set of SD-JWT-VC credentials. The adapters format those credentials for each protocol without duplication.\n\n### Multi-Protocol Transaction Example\n\n```python\n# Initialize wallet with intent\nwallet = CredentialWallet(\n    agent_id=\"acme-buyer-01\",\n    display_name=\"Acme Multi-Protocol Buyer\",\n    owner=\"alice@acme.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\n# Issue delegation credential\nvi = VerifiableIntentManager(wallet)\nintent_cred = vi.declare_intent(\n    intent_id=\"multi-proto-session-001\",\n    authorized_actions=[\"purchase_compute\"],\n    spending_limit_usd=5000.00,\n    merchant_categories=[\"cloud_compute\"],\n    session_hours=4.0,\n)\n\n# Discover vendor via AP2\nap2 = AP2Adapter(wallet)\nap2_presentation = ap2.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"authorized_actions\", \"spending_limit\"],\n    protocol_metadata={\"capabilities\": [\"compute_provisioning\"]},\n)\nprint(f\"AP2 handshake: {ap2_presentation['agent_card']['agent_id']}\")\n\n# Negotiate terms via UCP\nucp = UCPAdapter(wallet)\nucp_presentation = ucp.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"authorized_actions\", \"spending_limit\"],\n    protocol_metadata={\n        \"tools\": [\"create_escrow\", \"create_sla\"],\n        \"currencies\": [\"USD\"],\n    },\n)\nprint(f\"UCP negotiation: escrow={ucp_presentation['commerce_capabilities']['escrow_capable']}\")\n\n# Execute payment via ACP\nacp = ACPAdapter(wallet)\nacp_presentation = acp.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"merchant_categories\"],  # ACP adds required claims automatically\n    protocol_metadata={\n        \"action\": \"purchase_compute\",\n        \"amount\": \"1500.00\",\n        \"currency\": \"USD\",\n    },\n)\nprint(f\"ACP scope: {acp_presentation['scope_assertion']['disclosed_values']}\")\n\n# Settle micropayment via x402\nx402 = X402Adapter(wallet)\nx402_presentation = x402.format_presentation(\n    credential_id=\"multi-proto-session-001\",\n    disclosed_claims=[\"spending_limit\"],\n    protocol_metadata={\"amount\": \"0.50\", \"currency\": \"USD\"},\n)\nprint(f\"x402 headers: {list(x402_presentation['payment_header'].keys())}\")\n```\n\n---\n\n## Chapter 6: eIDAS 2.0 Compliance\n\n### The December 2026 Deadline\n\nThe EU's eIDAS 2.0 regulation requires all EU member states to offer European Digital Identity (EUDI) Wallets to citizens and businesses by December 2026. For agent commerce, the implications are direct: any agent transacting with EU consumers or businesses must be able to accept and verify EUDI Wallet credentials. Any agent operating on behalf of an EU entity must be able to present credentials that comply with the EUDI Architecture Reference Framework (ARF).\n\nThe key requirements for agent developers:\n\n- **Qualified Electronic Attestation of Attributes (QEAA)**: Credentials issued by qualified trust service providers. Agent delegation credentials that touch EU financial transactions must be QEAAs or reference a QEAA in the chain.\n- **PSD2 Strong Customer Authentication (SCA)**: Payments over EUR 30 require multi-factor authentication. For agent commerce, SCA can be satisfied by the delegation chain if the human principal authenticated with two factors when issuing the intent credential.\n- **Data minimization**: GDPR requires that credentials disclose only the minimum data necessary for the transaction. SD-JWT selective disclosure directly satisfies this requirement.\n- **Credential format**: The ARF mandates SD-JWT-VC as one of the accepted credential formats. This is the same format used by Mastercard VI and GreenHelix credentials, so the format is already compatible.\n\n### EUDI Wallet Integration Architecture\n\n```\neIDAS 2.0 CREDENTIAL FLOW FOR AGENT COMMERCE\n\n┌──────────────┐    ┌─────────────┐    ┌────────────────┐\n│  EU Human    │    │ Qualified   │    │  EUDI Wallet   │\n│  Principal   │───>│ Trust Svc   │───>│  (Mobile App)  │\n│              │    │ Provider    │    │                │\n└──────────────┘    └─────────────┘    └───────┬────────┘\n                                               │\n                         SCA-verified          │ Issue delegation\n                         intent declaration    │ credential to agent\n                                               │\n                                       ┌───────▼────────┐\n                                       │  Agent Wallet   │\n                                       │  (GreenHelix)  │\n                                       │                │\n                                       │ Stores:        │\n                                       │ - EUDI-sourced │\n                                       │   delegation VC│\n                                       │ - Platform VCs │\n                                       │ - VI session   │\n                                       └───────┬────────┘\n                                               │\n                              Present EUDI-    │\n                              referenced cred  │\n                              to EU vendor     │\n                                               │\n                                       ┌───────▼────────┐\n                                       │  EU Vendor     │\n                                       │  Agent         │\n                                       │                │\n                                       │ Verifies:      │\n                                       │ - QEAA chain   │\n                                       │ - SCA proof    │\n                                       │ - SD-JWT sigs  │\n                                       └────────────────┘\n```\n\n### EUDIComplianceManager\n\n```python\nclass EUDIComplianceManager:\n    \"\"\"Manages eIDAS 2.0 EUDI Wallet compliance for agent credentials.\n\n    Handles QEAA validation, PSD2 SCA attestation, and credential\n    formatting for EU commerce.\n    \"\"\"\n\n    # eIDAS trust service list (simplified)\n    QUALIFIED_TRUST_SERVICES = [\n        \"did:web:qtsp.eu.example.com\",\n        \"did:web:trust.eidas.europa.eu\",\n    ]\n\n    SCA_THRESHOLD_EUR = 30.0\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.eudi_credentials: Dict[str, dict] = {}\n        self.compliance_log: List[dict] = []\n\n    def import_eudi_credential(\n        self,\n        eudi_credential_id: str,\n        issuer_did: str,\n        credential_data: dict,\n        sca_method: str,\n        sca_timestamp: float,\n    ) -> dict:\n        \"\"\"Import a credential sourced from a EUDI Wallet.\n\n        The credential must be a QEAA (issued by a qualified trust service)\n        to be valid for regulated EU transactions.\n\n        Args:\n            eudi_credential_id: ID from the EUDI wallet.\n            issuer_did: DID of the issuing trust service provider.\n            credential_data: The credential claims.\n            sca_method: SCA method used (e.g., \"biometric+pin\", \"pin+sms\").\n            sca_timestamp: When SCA was performed (Unix timestamp).\n        \"\"\"\n        is_qualified = issuer_did in self.QUALIFIED_TRUST_SERVICES\n\n        eudi_record = {\n            \"id\": eudi_credential_id,\n            \"issuer\": issuer_did,\n            \"is_qeaa\": is_qualified,\n            \"credential_data\": credential_data,\n            \"sca_method\": sca_method,\n            \"sca_timestamp\": sca_timestamp,\n            \"imported_at\": time.time(),\n        }\n        self.eudi_credentials[eudi_credential_id] = eudi_record\n\n        # Also issue a GreenHelix credential that references the EUDI source\n        self.wallet.issue_credential(\n            credential_id=f\"eudi-{eudi_credential_id}\",\n            subject_did=self.wallet.did,\n            credential_type=\"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Feudi-delegation\u002Fv1\",\n            claims={\n                \"eudi_source\": eudi_credential_id,\n                \"eudi_issuer\": issuer_did,\n                \"is_qeaa\": is_qualified,\n                \"sca_method\": sca_method,\n                \"sca_timestamp\": sca_timestamp,\n                **credential_data,\n            },\n            disclosable_claims=[\"sca_method\", \"eudi_issuer\"],\n            ttl_seconds=86400,\n        )\n\n        return eudi_record\n\n    def check_sca_required(self, amount_eur: float) -> bool:\n        \"\"\"Check if PSD2 SCA is required for the transaction amount.\"\"\"\n        return amount_eur > self.SCA_THRESHOLD_EUR\n\n    def validate_sca_for_transaction(\n        self,\n        eudi_credential_id: str,\n        amount_eur: float,\n        max_sca_age_seconds: int = 300,\n    ) -> dict:\n        \"\"\"Validate that SCA requirements are met for a transaction.\n\n        PSD2 requires SCA for payments > EUR 30. The SCA must have been\n        performed recently (within max_sca_age_seconds) for the transaction\n        to be authorized.\n        \"\"\"\n        if not self.check_sca_required(amount_eur):\n            return {\"sca_required\": False, \"authorized\": True}\n\n        cred = self.eudi_credentials.get(eudi_credential_id)\n        if not cred:\n            return {\n                \"sca_required\": True,\n                \"authorized\": False,\n                \"reason\": \"EUDI credential not found\",\n            }\n\n        sca_age = time.time() - cred[\"sca_timestamp\"]\n        if sca_age > max_sca_age_seconds:\n            return {\n                \"sca_required\": True,\n                \"authorized\": False,\n                \"reason\": f\"SCA expired ({sca_age:.0f}s > {max_sca_age_seconds}s)\",\n            }\n\n        return {\n            \"sca_required\": True,\n            \"authorized\": True,\n            \"sca_method\": cred[\"sca_method\"],\n            \"sca_age_seconds\": sca_age,\n        }\n\n    def create_compliance_attestation(\n        self,\n        transaction_id: str,\n        amount_eur: float,\n        eudi_credential_id: str,\n        counterparty_agent_id: str,\n    ) -> dict:\n        \"\"\"Create a compliance attestation for an EU transaction.\n\n        Records all compliance checks for audit purposes. This attestation\n        can be presented to regulators as evidence of eIDAS 2.0 compliance.\n        \"\"\"\n        sca_check = self.validate_sca_for_transaction(eudi_credential_id, amount_eur)\n\n        cred = self.eudi_credentials.get(eudi_credential_id, {})\n\n        attestation = {\n            \"transaction_id\": transaction_id,\n            \"timestamp\": time.time(),\n            \"agent_id\": self.wallet.agent_id,\n            \"counterparty\": counterparty_agent_id,\n            \"amount_eur\": amount_eur,\n            \"eudi_credential\": eudi_credential_id,\n            \"is_qeaa\": cred.get(\"is_qeaa\", False),\n            \"sca_check\": sca_check,\n            \"data_minimization\": True,  # SD-JWT selective disclosure used\n            \"credential_format\": \"sd-jwt-vc\",\n            \"regulation\": \"eIDAS 2.0 \u002F PSD2\",\n        }\n\n        # Log via GreenHelix compliance tool\n        compliance_result = api_call(\"check_compliance\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"transaction_id\": transaction_id,\n            \"compliance_data\": attestation,\n        })\n\n        attestation[\"platform_check\"] = compliance_result\n        self.compliance_log.append(attestation)\n\n        return attestation\n```\n\n### EU Transaction Flow\n\n```python\n# Set up wallet with EUDI integration\nwallet = CredentialWallet(\n    agent_id=\"eu-buyer-agent-01\",\n    display_name=\"EU Procurement Agent\",\n    owner=\"klaus@eurocorp.eu\",\n)\nwallet.register()\nwallet.create_wallet()\n\neudi = EUDIComplianceManager(wallet)\n\n# Import a credential from the user's EUDI Wallet\n# (In production, this comes from a QR code scan or NFC tap\n#  on the user's mobile EUDI wallet app)\neudi_cred = eudi.import_eudi_credential(\n    eudi_credential_id=\"eudi-2026-04-06-001\",\n    issuer_did=\"did:web:qtsp.eu.example.com\",  # Qualified TSP\n    credential_data={\n        \"principal_name\": \"Klaus Mueller\",\n        \"organization\": \"EuroCorp GmbH\",\n        \"authorized_actions\": [\"purchase_compute\", \"purchase_saas\"],\n        \"spending_limit\": {\"amount\": \"8000\", \"currency\": \"EUR\", \"period\": \"day\"},\n    },\n    sca_method=\"biometric+pin\",\n    sca_timestamp=time.time(),  # SCA just performed\n)\nprint(f\"EUDI credential imported. QEAA: {eudi_cred['is_qeaa']}\")\n# Output: EUDI credential imported. QEAA: True\n\n# Execute a transaction requiring PSD2 SCA\nattestation = eudi.create_compliance_attestation(\n    transaction_id=\"eu-tx-2026-04-06-001\",\n    amount_eur=2500.00,\n    eudi_credential_id=\"eudi-2026-04-06-001\",\n    counterparty_agent_id=\"eu-vendor-saas-01\",\n)\nprint(f\"Compliance: SCA required={attestation['sca_check']['sca_required']}, \"\n      f\"authorized={attestation['sca_check']['authorized']}\")\n# Output: Compliance: SCA required=True, authorized=True\n```\n\n---\n\n## Chapter 7: Trust Scoring, Reputation Binding & Credential Revocation\n\n### Why Credentials Need Reputation\n\nA credential tells you what an agent is authorized to do. It does not tell you whether the agent is any good at doing it. An agent with a valid $50,000 delegation credential might have a 30% task completion rate and a history of disputed escrows. The credential is technically valid -- the human authorized the spend -- but the counterparty should not accept it without checking the agent's track record. Reputation binding attaches verifiable performance data to credentials so that counterparties can evaluate both authorization and competence in a single verification flow.\n\n### ReputationBoundCredentialManager\n\n```python\nclass ReputationBoundCredentialManager:\n    \"\"\"Binds verifiable reputation data to agent credentials.\n\n    Combines GreenHelix reputation tools with the credential wallet to\n    create credentials that carry both authorization and performance proof.\n    \"\"\"\n\n    def __init__(self, wallet: CredentialWallet):\n        self.wallet = wallet\n        self.revocation_registry: Dict[str, dict] = {}\n\n    def get_reputation_snapshot(self) -> dict:\n        \"\"\"Fetch the agent's current reputation from GreenHelix.\"\"\"\n        return api_call(\"get_agent_reputation\", {\n            \"agent_id\": self.wallet.agent_id,\n        })\n\n    def submit_performance_metrics(\n        self,\n        metrics: Dict[str, Any],\n    ) -> dict:\n        \"\"\"Submit performance metrics to build verifiable history.\n\n        These metrics feed into the reputation score and can be\n        anchored in claim chains for tamper-evidence.\n        \"\"\"\n        return api_call(\"submit_metrics\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"metrics\": metrics,\n        })\n\n    def issue_reputation_bound_credential(\n        self,\n        credential_id: str,\n        subject_did: str,\n        authorization_claims: Dict[str, Any],\n        min_reputation_score: float = 0.0,\n    ) -> AgentCredential:\n        \"\"\"Issue a credential that includes a verifiable reputation snapshot.\n\n        The reputation data becomes part of the credential claims,\n        anchored at issuance time. The counterparty can verify that\n        the reputation was genuine at issuance by checking the claim chain.\n\n        Args:\n            credential_id: Unique ID for this credential.\n            subject_did: DID of the credential subject.\n            authorization_claims: The authorization claims (actions, limits, etc).\n            min_reputation_score: Minimum score required to issue. Fails if below.\n        \"\"\"\n        # Fetch current reputation\n        rep = self.get_reputation_snapshot()\n        rep_score = rep.get(\"reputation_score\", 0)\n\n        if rep_score \u003C min_reputation_score:\n            raise ValueError(\n                f\"Reputation {rep_score} below minimum {min_reputation_score}\"\n            )\n\n        # Merge reputation into claims\n        all_claims = {\n            **authorization_claims,\n            \"reputation_at_issuance\": {\n                \"score\": rep_score,\n                \"trade_count\": rep.get(\"trade_count\", 0),\n                \"claim_chain_depth\": rep.get(\"claim_chain_depth\", 0),\n                \"snapshot_time\": time.time(),\n            },\n        }\n\n        return self.wallet.issue_credential(\n            credential_id=credential_id,\n            subject_did=subject_did,\n            credential_type=(\n                \"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Freputation-bound-delegation\u002Fv1\"\n            ),\n            claims=all_claims,\n            disclosable_claims=[\n                \"reputation_at_issuance\",\n                \"principal_name\",\n            ],\n            ttl_seconds=86400,\n        )\n\n    def revoke_credential(\n        self,\n        credential_id: str,\n        reason: str,\n    ) -> dict:\n        \"\"\"Revoke a credential and record the revocation.\n\n        Revocation is immediate. The credential hash is added to the\n        revocation registry, and a claim chain entry is created for\n        tamper-evident revocation history.\n        \"\"\"\n        if credential_id not in self.wallet.credentials:\n            raise KeyError(f\"Credential {credential_id} not found\")\n\n        cred = self.wallet.credentials[credential_id]\n\n        revocation_entry = {\n            \"credential_id\": credential_id,\n            \"credential_hash\": cred.credential_hash(),\n            \"revoked_at\": time.time(),\n            \"reason\": reason,\n            \"revoked_by\": self.wallet.agent_id,\n        }\n        self.revocation_registry[credential_id] = revocation_entry\n\n        # Submit revocation as a metric for chain anchoring\n        self.submit_performance_metrics({\n            \"event\": \"credential_revocation\",\n            \"credential_id\": credential_id,\n            \"reason\": reason,\n            \"timestamp\": time.time(),\n        })\n\n        # Anchor the revocation in a claim chain\n        chain_result = self.wallet.build_chain()\n\n        return {\n            \"revoked\": True,\n            \"entry\": revocation_entry,\n            \"chain_result\": chain_result,\n        }\n\n    def check_revocation(self, credential_id: str) -> dict:\n        \"\"\"Check if a credential has been revoked.\"\"\"\n        if credential_id in self.revocation_registry:\n            entry = self.revocation_registry[credential_id]\n            return {\n                \"revoked\": True,\n                \"revoked_at\": entry[\"revoked_at\"],\n                \"reason\": entry[\"reason\"],\n            }\n        return {\"revoked\": False}\n\n    def create_dispute_evidence_credential(\n        self,\n        dispute_id: str,\n        counterparty_agent_id: str,\n        evidence: Dict[str, Any],\n    ) -> dict:\n        \"\"\"Create a credential containing dispute evidence.\n\n        When a transaction is disputed, this creates a tamper-evident\n        record of the evidence that can be presented during resolution.\n        \"\"\"\n        # Create the dispute via GreenHelix\n        dispute_result = api_call(\"create_dispute\", {\n            \"agent_id\": self.wallet.agent_id,\n            \"counterparty_agent_id\": counterparty_agent_id,\n            \"dispute_id\": dispute_id,\n            \"evidence\": evidence,\n        })\n\n        # Issue an evidence credential\n        evidence_cred = self.wallet.issue_credential(\n            credential_id=f\"dispute-evidence-{dispute_id}\",\n            subject_did=self.wallet.did,\n            credential_type=(\n                \"https:\u002F\u002Fgreenhelix.net\u002Fcredentials\u002Fdispute-evidence\u002Fv1\"\n            ),\n            claims={\n                \"dispute_id\": dispute_id,\n                \"counterparty\": counterparty_agent_id,\n                \"evidence_summary\": evidence.get(\"summary\", \"\"),\n                \"evidence_hash\": hashlib.sha256(\n                    json.dumps(evidence, sort_keys=True).encode()\n                ).hexdigest(),\n                \"created_at\": time.time(),\n            },\n            disclosable_claims=[\"evidence_summary\"],\n            ttl_seconds=2592000,  # 30 days for dispute resolution\n        )\n\n        return {\n            \"dispute_result\": dispute_result,\n            \"evidence_credential\": evidence_cred.credential_hash(),\n        }\n```\n\n### Reputation-Bound Credential Flow\n\n```python\nwallet = CredentialWallet(\n    agent_id=\"reputable-vendor-01\",\n    display_name=\"Reputable Cloud Vendor\",\n    owner=\"ops@cloudvendor.com\",\n)\nwallet.register()\nwallet.create_wallet()\n\nrep_manager = ReputationBoundCredentialManager(wallet)\n\n# Submit performance metrics over time (called periodically)\nrep_manager.submit_performance_metrics({\n    \"task_completion_rate\": 0.97,\n    \"avg_response_time_ms\": 145,\n    \"successful_escrows\": 342,\n    \"disputed_escrows\": 3,\n    \"uptime_percent\": 99.8,\n})\n\n# Issue a reputation-bound credential (e.g., for a vendor presenting to a buyer)\nrep_cred = rep_manager.issue_reputation_bound_credential(\n    credential_id=\"vendor-service-cred-001\",\n    subject_did=\"did:key:reputable-vendor-01\",\n    authorization_claims={\n        \"service_type\": \"gpu_compute_provisioning\",\n        \"max_instance_count\": 64,\n        \"supported_regions\": [\"us-east\", \"eu-west\"],\n        \"principal_name\": \"CloudVendor Inc.\",\n    },\n    min_reputation_score=0.7,  # Require minimum 70% reputation\n)\n\n# Present with selective disclosure -- show reputation but not principal name\npresentation = wallet.present_credential(\n    credential_id=\"vendor-service-cred-001\",\n    disclosed_claims=[\"reputation_at_issuance\"],\n)\nprint(f\"Disclosed reputation: {presentation['disclosed_values']}\")\n\n# Later: revoke a credential (e.g., service decommissioned)\nrevocation = rep_manager.revoke_credential(\n    credential_id=\"vendor-service-cred-001\",\n    reason=\"Service region us-east decommissioned\",\n)\nprint(f\"Revoked: {revocation['revoked']}\")\n\n# Counterparty checks revocation before accepting credential\nstatus = rep_manager.check_revocation(\"vendor-service-cred-001\")\nprint(f\"Revocation check: {status}\")\n# Output: Revocation check: {'revoked': True, 'revoked_at': ..., 'reason': '...'}\n```\n\n### Dispute Evidence with Credentials\n\n```python\n# When a transaction goes wrong, create tamper-evident dispute evidence\nevidence_result = rep_manager.create_dispute_evidence_credential(\n    dispute_id=\"dispute-2026-04-06-001\",\n    counterparty_agent_id=\"unreliable-vendor-99\",\n    evidence={\n        \"summary\": \"Vendor committed to 8x A100 instances but only provisioned 4x\",\n        \"sla_id\": \"sla-2026-04-05-001\",\n        \"promised_instances\": 8,\n        \"delivered_instances\": 4,\n        \"transaction_id\": \"tx-2026-04-05-789\",\n        \"screenshots\": [\"evidence-001.png\", \"evidence-002.png\"],\n    },\n)\nprint(f\"Dispute filed. Evidence credential: {evidence_result['evidence_credential'][:16]}...\")\n```\n\n---\n\n## Next Steps\n\nFor deployment patterns, monitoring, and production hardening, see the\n[Agent Production Hardening Guide](https:\u002F\u002Fclawhub.ai\u002Fskills\u002Fgreenhelix-agent-production-hardening).\n\n---\n\n## What You Get\n\nThis guide covered the complete credential lifecycle for agentic commerce:\n\n**Chapter 1** explained why API keys and OAuth break under delegation and how Mastercard, Google, and OpenAI converged on W3C Verifiable Credentials.\n\n**Chapter 2** provided the SD-JWT-VC primer: credential anatomy, selective disclosure mechanics, key binding, and delegation chains as layered issuance.\n\n**Chapter 3** built the `CredentialWallet` class with GreenHelix tools: `register_agent`, `create_wallet`, `build_claim_chain`, and `get_claim_chains` for DID-anchored credential storage.\n\n**Chapter 4** implemented Verifiable Intent: session-level spending limits, `create_intent` integration, and sub-delegation with constraint narrowing.\n\n**Chapter 5** delivered cross-protocol adapters for AP2, UCP, ACP, and x402, with a unified wallet backend and protocol-specific presentation formatting.\n\n**Chapter 6** addressed the December 2026 eIDAS 2.0 deadline: EUDI Wallet integration, QEAA validation, PSD2 SCA flows, and compliance attestation via `check_compliance`.\n\n**Chapter 7** bound reputation to credentials: `get_agent_reputation` and `submit_metrics` for reputation snapshots, real-time revocation, and dispute evidence credentials using `create_dispute`.\n\n**Chapter 8** covered fleet-wide deployment: bulk registration, templated issuance, zero-downtime key rotation, health monitoring, and a 90-day sprint plan.\n\nEvery code example uses the `requests.Session` + the REST API (`POST \u002Fv1\u002F{tool}`) pattern against the GreenHelix A2A Commerce Gateway. Every credential is an SD-JWT-VC with selective disclosure. Every delegation chain enforces constraint narrowing. The architecture is protocol-agnostic at the wallet layer and protocol-specific at the presentation layer, so your agents can transact across AP2, UCP, ACP, and x402 without credential duplication.\n\nThe December 2026 deadline is real. The protocols are converging. Start with Chapter 3, register your first agent, and build from there.\n\n",{"name":5,"tags":24,"type":32,"author":36,"install":37,"license":15,"version":38,"metadata":39,"price_usd":44,"executable":20,"credentials":45,"description":7,"content_type":46,"compatibility":47},[25,26,27,28,29,30,31,32,33,34,35],"credentials","verifiable-intent","sd-jwt","eidas","delegation","identity","wallets","guide","greenhelix","openclaw","ai-agent","felix-agent","none","1.3.1",{"openclaw":40},{"requires":41,"primaryEnv":43},{"env":42},[43],"GREENHELIX_API_KEY",0,[43],"markdown",[34],"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fg\u002Fgreenhelix-agent-credential-wallets","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge","https:\u002F\u002Fskill-explorer-rho.vercel.app","https:\u002F\u002Fgithub.com\u002FLord1Egypt","Unbreakable. Unstoppable. Unmatched⚡.\r\n Speaker of machine tongues 🤖  | World-builder of decentralized dreams 🌐 | Defender of the digital realm🛡️.","2026-06-10 08:21:01",{"source":8,"skillName":5,"commands":57,"prompt":67,"zipAvailable":68},[58,61,64],{"tool":59,"command":60},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-agent-credential-wallets",{"tool":62,"command":63},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-agent-credential-wallets",{"tool":65,"command":66},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-agent-credential-wallets","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fg\u002Fgreenhelix-agent-credential-wallets\u002FSKILL.md",true,[],[71,78,85,92,99,106],{"skillNo":72,"name":73,"nameZh":6,"description":74,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":75,"categories":76,"keywords":77,"publishedAt":19},"01M785WKJB99G3STR1NF9NRTJW","youtube-content","YouTube transcripts to summaries, threads, blogs.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fyoutube-content\u002FSKILL.md",[],[],{"skillNo":79,"name":80,"nameZh":6,"description":81,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":82,"categories":83,"keywords":84,"publishedAt":19},"01M785WEFHB0G2S9YA6EPR3H0E","xurl","X\u002FTwitter via xurl CLI: post, search, DM, media, v2 API.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fxurl\u002FSKILL.md",[],[],{"skillNo":86,"name":87,"nameZh":6,"description":88,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":89,"categories":90,"keywords":91,"publishedAt":19},"01M785W98EDN4EFJXJPMQEHCRC","touchdesigner-mcp","Control a running TouchDesigner instance via twozero MCP — create operators, set parameters, wire connections, execute Python, build real-time visuals. 36 native tools.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftouchdesigner-mcp\u002FSKILL.md",[],[],{"skillNo":93,"name":94,"nameZh":6,"description":95,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":96,"categories":97,"keywords":98,"publishedAt":19},"01M785W5S9FP3QBH2V191E025P","test-driven-development","TDD: enforce RED-GREEN-REFACTOR, tests before code.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Ftest-driven-development\u002FSKILL.md",[],[],{"skillNo":100,"name":101,"nameZh":6,"description":102,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":103,"categories":104,"keywords":105,"publishedAt":19},"01M785W2AS08NSSH9YATCV6FJB","teams-meeting-pipeline","Operate the Teams meeting summary pipeline via Hermes CLI — summarize meetings, inspect pipeline status, replay jobs, manage Microsoft Graph subscriptions.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fteams-meeting-pipeline\u002FSKILL.md",[],[],{"skillNo":107,"name":108,"nameZh":6,"description":109,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":110,"categories":111,"keywords":112,"publishedAt":19},"01M785VXKW4T34BTP1SCHW1R7F","systematic-debugging","4-phase root cause debugging: understand bugs before fixing.","https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fskills\u002Fsystematic-debugging\u002FSKILL.md",[],[]]