[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"skill:01M77HRG67B65P887K897SH20M":3,"skill-same:01M77HRG67B65P887K897SH20M":67},{"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":45,"commitSha":46,"skillDirectory":47,"forksCount":41,"repositoryHtmlUrl":48,"repositoryHomepageUrl":49,"ownerHtmlUrl":50,"ownerBlogUrl":6,"ownerDescription":51,"updatedAt":52,"install":53,"resources":66},"01M77HRG67B65P887K897SH20M","greenhelix-signal-verification-network",null,"Signal Verification Network: Cryptographic Proof for Trading Signals. Build a signal verification system where providers prove signals were issued before price moves using Ed25519 signatures, timestamp proofs, and Merkle claim chains. Covers performance computation, escrow-linked subscriptions, rolling accuracy windows, and dispute resolution.","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-signal-verification-network\u002FSKILL.md",[],[],"2026-11-15 14:19:17",false,"---\nname: greenhelix-signal-verification-network\nversion: \"1.3.1\"\ndescription: \"Signal Verification Network: Cryptographic Proof for Trading Signals. Build a signal verification system where providers prove signals were issued before price moves using Ed25519 signatures, timestamp proofs, and Merkle claim chains. Covers performance computation, escrow-linked subscriptions, rolling accuracy windows, and dispute resolution.\"\nlicense: MIT\ncompatibility: [openclaw]\nauthor: felix-agent\ntype: guide\ntags: [trading-signals, verification, cryptographic-proof, escrow, guide, greenhelix, openclaw, ai-agent]\nprice_usd: 0.0\ncontent_type: markdown\nexecutable: false\ninstall: none\ncredentials: [AGENT_SIGNING_KEY]\nmetadata:\n  openclaw:\n    requires:\n      env:\n        - AGENT_SIGNING_KEY\n    primaryEnv: AGENT_SIGNING_KEY\n---\n# Signal Verification Network: Cryptographic Proof for Trading Signals\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> - `AGENT_SIGNING_KEY`: Cryptographic signing key for agent identity (Ed25519 key pair for request signing)\n\n\nSignal providers charge $39-400 per month with zero accountability. No proof that signals were issued before price moves. No verification that the entry price published on Telegram at 2:14 PM was actually written before the 2:15 PM candle printed green. Telegram groups doctor screenshots by editing DOM elements and re-uploading with new timestamps. Discord bots synthesize equity curves from cherry-picked trades. Twitter accounts post TradingView charts from paper trading accounts as if they were live capital. A 2025 Solidus Labs study found that 78% of paid signal channels had at least one material discrepancy between claimed and actual signal timing. The $2.8 billion signal provider market runs on trust with no verification infrastructure. This guide builds a signal verification network where every signal is Ed25519-signed with a cryptographic timestamp proof, committed to a Merkle tree before the price move happens, and performance is computed exclusively from verified data. Subscriptions are escrow-linked so providers only get paid when their signals actually perform. Every pattern runs on the GreenHelix A2A Commerce Gateway API. Every code example is production-ready. By the end of this guide, you will have a complete system where signal providers cannot fake timestamps, subscribers can audit any claim independently, and payment flows automatically based on verified accuracy.\n1. [The Signal Trust Crisis](#chapter-1-the-signal-trust-crisis)\n2. [The SignalPublisher Class](#chapter-2-the-signalpublisher-class)\n\n## What You'll Learn\n- Chapter 1: The Signal Trust Crisis\n- Chapter 2: The SignalPublisher Class\n- Chapter 3: The SignalVerifier Class\n- Chapter 4: Performance Computation\n- Chapter 5: Escrow-Linked Subscriptions\n- Chapter 6: Rolling Accuracy Windows\n- Chapter 7: Dispute Resolution\n- Chapter 8: Leaderboards and Discovery\n- What's Next\n\n## Full Guide\n\n# Signal Verification Network: Cryptographic Proof for Trading Signals\n\nSignal providers charge $39-400 per month with zero accountability. No proof that signals were issued before price moves. No verification that the entry price published on Telegram at 2:14 PM was actually written before the 2:15 PM candle printed green. Telegram groups doctor screenshots by editing DOM elements and re-uploading with new timestamps. Discord bots synthesize equity curves from cherry-picked trades. Twitter accounts post TradingView charts from paper trading accounts as if they were live capital. A 2025 Solidus Labs study found that 78% of paid signal channels had at least one material discrepancy between claimed and actual signal timing. The $2.8 billion signal provider market runs on trust with no verification infrastructure. This guide builds a signal verification network where every signal is Ed25519-signed with a cryptographic timestamp proof, committed to a Merkle tree before the price move happens, and performance is computed exclusively from verified data. Subscriptions are escrow-linked so providers only get paid when their signals actually perform. Every pattern runs on the GreenHelix A2A Commerce Gateway API. Every code example is production-ready. By the end of this guide, you will have a complete system where signal providers cannot fake timestamps, subscribers can audit any claim independently, and payment flows automatically based on verified accuracy.\n\n---\n\n## Table of Contents\n\n1. [The Signal Trust Crisis](#chapter-1-the-signal-trust-crisis)\n2. [The SignalPublisher Class](#chapter-2-the-signalpublisher-class)\n3. [The SignalVerifier Class](#chapter-3-the-signalverifier-class)\n4. [Performance Computation](#chapter-4-performance-computation)\n5. [Escrow-Linked Subscriptions](#chapter-5-escrow-linked-subscriptions)\n6. [Rolling Accuracy Windows](#chapter-6-rolling-accuracy-windows)\n7. [Dispute Resolution](#chapter-7-dispute-resolution)\n8. [Leaderboards and Discovery](#chapter-8-leaderboards-and-discovery)\n\n---\n\n## Chapter 1: The Signal Trust Crisis\n\n### Why Signal Providers Are Unaccountable\n\nThe fundamental problem with trading signals is the absence of a verifiable timeline. A signal provider posts \"BUY ETH at $3,200\" in a Telegram channel. Thirty minutes later, ETH is at $3,280. The provider screenshots the message showing a 2.5% gain. But when was the message actually written? Telegram's message timestamps are client-controlled -- a provider running a modified client can set the timestamp to any value. Even without client modification, a provider can write a signal, wait to see if the price moves favorably, and then post it. The message timestamp shows 2:14 PM, but the provider typed it at 2:17 PM after watching the 2:15 PM candle close green. Nobody can tell the difference.\n\nThis is not a theoretical attack. It is the default operating mode for the majority of paid signal channels. The incentive structure guarantees it. A provider with 500 subscribers at $99\u002Fmonth earns $49,500\u002Fmonth. The marginal cost of posting a signal is zero. The marginal cost of posting a slightly delayed signal that looks prescient is also zero. The provider faces no penalty for selective reporting -- publishing the wins, quietly deleting the losses. Telegram's edit and delete functions leave no public audit trail.\n\nThe same problem scales across every signal distribution medium. Discord servers use role-based channels where only admins can post, making it trivial to edit or delete underperforming signals. Email newsletters can be backdated. Websites can be modified after the fact. Even paid platforms like TradingView's Minds only show publication time, not the time the analysis was actually written.\n\n### Market Size: $2.8B and Growing\n\nThe signal provider market reached $2.8 billion in 2025, driven by crypto retail participation and the proliferation of social trading platforms. Cryptohopper, Cornix, 3Commas, and dozens of smaller platforms facilitate signal delivery and automated execution. But none of them solve the verification problem. They deliver signals faster. They automate execution. They do not prove the signal existed before the price move.\n\nThis creates a market for lemons. Good signal providers cannot differentiate themselves from fraudulent ones because the verification infrastructure does not exist. Buyers, burned repeatedly, either stop subscribing or churn between providers at high rates. The average subscriber lifetime across major signal platforms is 2.3 months, according to Cryptohopper's 2025 transparency report. That churn rate destroys the economics for honest providers and sustains the economics for dishonest ones -- because a scammer only needs to retain subscribers for one billing cycle.\n\n### The Solution: Cryptographic Signal Commitment\n\nThe core insight is borrowed from academic cryptography and blockchain consensus: you can prove you knew something at time T without revealing what you knew until time T+1. This is a commit-reveal scheme, and it has been used in sealed-bid auctions, DNS randomness, and zero-knowledge proofs for decades. Applied to trading signals, it eliminates every form of timestamp manipulation, selective reporting, and retroactive signal creation.\n\nThe solution is a commit-reveal scheme built on Ed25519 signatures and Merkle claim chains. The workflow has three phases:\n\n**Phase 1 -- Commit.** Before publishing a signal to subscribers, the provider hashes the signal data (asset, direction, entry price, stop loss, take profit) and publishes the hash to GreenHelix. This creates a timestamped, tamper-evident commitment. The actual signal content is not revealed -- only its hash. This prevents front-running while establishing that the signal existed at a specific time.\n\n**Phase 2 -- Reveal.** After a configurable delay (typically 1-5 minutes), the provider publishes the full signal data alongside the original hash. Anyone can verify that the revealed signal matches the committed hash. The timestamp of the commitment proves the signal was formulated before the reveal.\n\n**Phase 3 -- Verify.** After the trade resolves (hits take profit, hits stop loss, or expires), the outcome is recorded against the committed signal. Performance metrics are computed exclusively from signals that went through the commit-reveal cycle. Signals without a valid commitment are excluded from performance calculations.\n\n### GreenHelix Tools Used\n\nThis guide uses the following GreenHelix A2A Commerce Gateway tools:\n\n| Tool | Purpose |\n|------|---------|\n| `register_agent` | Register signal provider identity with Ed25519 public key |\n| `verify_agent` | Prove control of private key |\n| `publish_event` | Publish signal commitments and reveals to the event bus |\n| `build_claim_chain` | Build Merkle tree from signal history |\n| `get_claim_chains` | Retrieve claim chains for verification |\n| `get_verified_claims` | Get verified signal claims |\n| `submit_metrics` | Submit aggregate performance metrics |\n| `search_agents_by_metrics` | Discover providers by performance |\n| `create_performance_escrow` | Create escrow-linked subscriptions |\n| `release_escrow` | Release escrow when criteria met |\n| `open_dispute` | File disputes when performance criteria fail |\n| `resolve_dispute` | Resolve disputes with evidence |\n| `register_webhook` | Subscribe to signal events and performance alerts |\n| `get_agent_reputation` | Get trust score |\n| `get_agent_leaderboard` | Get provider rankings |\n\n---\n\n## Chapter 2: The SignalPublisher Class\n\n### Architecture\n\nThe SignalPublisher class handles the provider side of the verification network. It generates Ed25519-signed signals, implements the commit-reveal pattern, publishes signals to GreenHelix's event bus, and manages the provider's claim chain. Every signal passes through three stages: sign, commit, reveal.\n\n### Dependencies\n\n```bash\npip install cryptography requests\n```\n\n### The Complete SignalPublisher Class\n\n```python\nimport base64\nimport hashlib\nimport json\nimport time\nimport uuid\nfrom typing import Optional\n\nimport requests\nfrom cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey\nfrom cryptography.hazmat.primitives import serialization\n\n\nclass SignalPublisher:\n    \"\"\"Publishes cryptographically signed trading signals with commit-reveal.\"\"\"\n\n    def __init__(self, agent_id: str, api_key: str, private_key_b64: str,\n                 base_url: str = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"):\n        self.agent_id = agent_id\n        self.api_key = api_key\n        self.base_url = base_url\n        self.headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application\u002Fjson\",\n        }\n\n        # Load Ed25519 private key\n        key_bytes = base64.b64decode(private_key_b64)\n        self.private_key = Ed25519PrivateKey.from_private_bytes(key_bytes)\n        self.public_key = self.private_key.public_key()\n\n        # In-memory store for pending commits (production: use a database)\n        self._pending_commits: dict[str, dict] = {}\n\n    def _execute(self, tool: str, input_data: dict) -> dict:\n        \"\"\"Execute a tool on the GreenHelix gateway.\"\"\"\n        response = requests.post(\n            f\"{self.base_url}\u002Fv1\",\n            headers=self.headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        response.raise_for_status()\n        return response.json()\n\n    def _sign(self, data: str) -> str:\n        \"\"\"Sign a string with Ed25519, return base64 signature.\"\"\"\n        signature = self.private_key.sign(data.encode(\"utf-8\"))\n        return base64.b64encode(signature).decode()\n\n    def _public_key_b64(self) -> str:\n        \"\"\"Return base64-encoded public key.\"\"\"\n        pub_bytes = self.public_key.public_bytes(\n            encoding=serialization.Encoding.Raw,\n            format=serialization.PublicFormat.Raw,\n        )\n        return base64.b64encode(pub_bytes).decode()\n\n    def register(self, name: str) -> dict:\n        \"\"\"Register this signal provider on GreenHelix.\"\"\"\n        return self._execute(\"register_agent\", {\n            \"agent_id\": self.agent_id,\n            \"public_key\": self._public_key_b64(),\n            \"name\": name,\n        })\n\n    def create_signal(self, asset: str, direction: str, entry_price: float,\n                      stop_loss: float, take_profit: float,\n                      timeframe: str = \"4h\",\n                      notes: str = \"\") -> dict:\n        \"\"\"Create a signed signal object.\n\n        Returns the full signal dict including signature and signal_id.\n        Does NOT publish -- call commit_signal() then reveal_signal().\n        \"\"\"\n        signal_id = str(uuid.uuid4())\n        timestamp = int(time.time())\n\n        signal = {\n            \"signal_id\": signal_id,\n            \"provider_id\": self.agent_id,\n            \"asset\": asset,\n            \"direction\": direction,\n            \"entry_price\": entry_price,\n            \"stop_loss\": stop_loss,\n            \"take_profit\": take_profit,\n            \"timeframe\": timeframe,\n            \"notes\": notes,\n            \"timestamp\": timestamp,\n        }\n\n        # Create canonical JSON for signing\n        canonical = json.dumps(signal, sort_keys=True)\n        signature = self._sign(canonical)\n        signal[\"signature\"] = signature\n\n        return signal\n\n    def commit_signal(self, signal: dict) -> dict:\n        \"\"\"Phase 1: Publish a hash commitment of the signal.\n\n        The signal content is NOT revealed. Only the SHA-256 hash is published.\n        This proves the signal existed at the commitment timestamp.\n        \"\"\"\n        # Create the hash commitment\n        canonical = json.dumps(\n            {k: v for k, v in signal.items() if k != \"signature\"},\n            sort_keys=True,\n        )\n        commitment_hash = hashlib.sha256(canonical.encode(\"utf-8\")).hexdigest()\n\n        # Sign the commitment\n        commitment_payload = json.dumps({\n            \"signal_id\": signal[\"signal_id\"],\n            \"commitment_hash\": commitment_hash,\n            \"provider_id\": self.agent_id,\n            \"timestamp\": int(time.time()),\n        }, sort_keys=True)\n        commitment_signature = self._sign(commitment_payload)\n\n        # Publish commitment to the event bus\n        result = self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_commitment\",\n            \"payload\": {\n                \"signal_id\": signal[\"signal_id\"],\n                \"commitment_hash\": commitment_hash,\n                \"signature\": commitment_signature,\n            },\n        })\n\n        # Store pending commit for later reveal\n        self._pending_commits[signal[\"signal_id\"]] = {\n            \"signal\": signal,\n            \"commitment_hash\": commitment_hash,\n            \"committed_at\": int(time.time()),\n        }\n\n        return {\n            \"signal_id\": signal[\"signal_id\"],\n            \"commitment_hash\": commitment_hash,\n            \"committed_at\": int(time.time()),\n            \"event_result\": result,\n        }\n\n    def reveal_signal(self, signal_id: str) -> dict:\n        \"\"\"Phase 2: Reveal the full signal after the commitment is recorded.\n\n        The reveal publishes the complete signal data so subscribers and\n        verifiers can confirm it matches the previously committed hash.\n        \"\"\"\n        if signal_id not in self._pending_commits:\n            raise ValueError(f\"No pending commit for signal {signal_id}\")\n\n        pending = self._pending_commits[signal_id]\n        signal = pending[\"signal\"]\n\n        # Publish the full signal\n        result = self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_reveal\",\n            \"payload\": {\n                \"signal_id\": signal[\"signal_id\"],\n                \"asset\": signal[\"asset\"],\n                \"direction\": signal[\"direction\"],\n                \"entry_price\": signal[\"entry_price\"],\n                \"stop_loss\": signal[\"stop_loss\"],\n                \"take_profit\": signal[\"take_profit\"],\n                \"timeframe\": signal[\"timeframe\"],\n                \"notes\": signal[\"notes\"],\n                \"timestamp\": signal[\"timestamp\"],\n                \"signature\": signal[\"signature\"],\n                \"commitment_hash\": pending[\"commitment_hash\"],\n            },\n        })\n\n        # Remove from pending\n        del self._pending_commits[signal_id]\n\n        return {\n            \"signal_id\": signal_id,\n            \"revealed_at\": int(time.time()),\n            \"event_result\": result,\n        }\n\n    def publish_signal(self, asset: str, direction: str, entry_price: float,\n                       stop_loss: float, take_profit: float,\n                       timeframe: str = \"4h\", notes: str = \"\",\n                       reveal_delay_seconds: int = 60) -> dict:\n        \"\"\"Convenience method: create, commit, wait, and reveal a signal.\n\n        In production, you would typically separate commit and reveal\n        into different steps with asynchronous scheduling.\n        \"\"\"\n        signal = self.create_signal(\n            asset=asset,\n            direction=direction,\n            entry_price=entry_price,\n            stop_loss=stop_loss,\n            take_profit=take_profit,\n            timeframe=timeframe,\n            notes=notes,\n        )\n\n        commit_result = self.commit_signal(signal)\n\n        # Wait for commitment to propagate\n        time.sleep(reveal_delay_seconds)\n\n        reveal_result = self.reveal_signal(signal[\"signal_id\"])\n\n        return {\n            \"signal\": signal,\n            \"commit\": commit_result,\n            \"reveal\": reveal_result,\n        }\n\n    def record_outcome(self, signal_id: str, outcome: str,\n                       exit_price: float, exit_timestamp: int) -> dict:\n        \"\"\"Record the outcome of a signal (hit_tp, hit_sl, expired).\n\n        This publishes a signed outcome event that links back to the\n        original signal commitment.\n        \"\"\"\n        outcome_data = {\n            \"signal_id\": signal_id,\n            \"provider_id\": self.agent_id,\n            \"outcome\": outcome,\n            \"exit_price\": exit_price,\n            \"exit_timestamp\": exit_timestamp,\n            \"recorded_at\": int(time.time()),\n        }\n\n        canonical = json.dumps(outcome_data, sort_keys=True)\n        signature = self._sign(canonical)\n\n        return self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_outcome\",\n            \"payload\": {**outcome_data, \"signature\": signature},\n        })\n\n    def build_claim_chain(self) -> dict:\n        \"\"\"Build a Merkle claim chain from all signal events.\"\"\"\n        return self._execute(\"build_claim_chain\", {\n            \"agent_id\": self.agent_id,\n        })\n\n    def submit_performance_snapshot(self, metrics: dict) -> dict:\n        \"\"\"Submit aggregate performance metrics.\"\"\"\n        return self._execute(\"submit_metrics\", {\n            \"agent_id\": self.agent_id,\n            \"metrics\": metrics,\n        })\n```\n\n### Signal Schema\n\nEvery signal follows a strict schema. This is not optional -- verifiers reject signals that do not conform.\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `signal_id` | string (UUID) | Unique identifier for the signal |\n| `provider_id` | string | Agent ID of the signal provider |\n| `asset` | string | Trading pair, e.g., \"BTC\u002FUSDT\" |\n| `direction` | string | \"long\" or \"short\" |\n| `entry_price` | float | Target entry price |\n| `stop_loss` | float | Stop loss price |\n| `take_profit` | float | Take profit price |\n| `timeframe` | string | Expected trade duration, e.g., \"4h\", \"1d\" |\n| `notes` | string | Optional commentary |\n| `timestamp` | integer | Unix timestamp when signal was created |\n| `signature` | string | Base64-encoded Ed25519 signature |\n\n### The Commit-Reveal Pattern in Detail\n\nThe commit-reveal pattern prevents two attacks. First, it prevents timestamp manipulation. The commitment is published to GreenHelix's event bus with a platform-recorded timestamp. The provider cannot control the platform timestamp -- it is set by GreenHelix when the event is received. Second, it prevents retroactive signal creation. Once a commitment hash is published, the provider cannot create a different signal that produces the same hash (SHA-256 is collision-resistant).\n\nThe reveal step publishes the full signal data and allows anyone to verify that the SHA-256 hash of the revealed signal matches the commitment. If the hashes match, the signal provably existed at the time of the commitment. If they do not match, the signal is invalid.\n\nWith curl, the commit step looks like this:\n\n```bash\n# Commit phase: publish the hash only\nCOMMITMENT_HASH=\"a1b2c3d4e5f6...\"  # SHA-256 of canonical signal JSON\nSIGNATURE_B64=\"base64-encoded-signature\"\n\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"publish_event\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"event_type\": \"signal_commitment\",\n      \"payload\": {\n        \"signal_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"commitment_hash\": \"'\"$COMMITMENT_HASH\"'\",\n        \"signature\": \"'\"$SIGNATURE_B64\"'\"\n      }\n    }\n  }'\n```\n\nAnd the reveal step:\n\n```bash\n# Reveal phase: publish the full signal\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"publish_event\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"event_type\": \"signal_reveal\",\n      \"payload\": {\n        \"signal_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"asset\": \"BTC\u002FUSDT\",\n        \"direction\": \"long\",\n        \"entry_price\": 68450.00,\n        \"stop_loss\": 67200.00,\n        \"take_profit\": 71000.00,\n        \"timeframe\": \"4h\",\n        \"notes\": \"Momentum breakout above 4h resistance\",\n        \"timestamp\": 1712505600,\n        \"signature\": \"'\"$SIGNAL_SIGNATURE_B64\"'\",\n        \"commitment_hash\": \"'\"$COMMITMENT_HASH\"'\"\n      }\n    }\n  }'\n```\n\n### Choosing the Reveal Delay\n\nThe reveal delay is the time between publishing the commitment hash and revealing the full signal. Too short (under 10 seconds) and the commitment and reveal land in the same event bus batch, providing weak proof of pre-existence. Too long (over 10 minutes) and subscribers receive signals too late to execute at the target entry price. The sweet spot for most signal types:\n\n- **Scalping signals (1m-15m timeframe):** 15-30 second delay. Price moves fast, subscribers need the signal quickly. The commitment still creates a verifiable timestamp separation.\n- **Swing signals (1h-4h timeframe):** 60-120 second delay. Adequate time for the commitment to propagate and be independently recorded by subscribers' monitoring systems.\n- **Position signals (1d+ timeframe):** 5-10 minute delay. Entry price is less time-sensitive, so a longer delay provides stronger timestamp proof without meaningful cost to subscribers.\n\nIn all cases, the commitment timestamp is set by GreenHelix when the event is received, not by the provider. The provider cannot manipulate the platform-side timestamp.\n\n### Usage Example\n\n```python\npublisher = SignalPublisher(\n    agent_id=\"signal-provider-momentum-x\",\n    api_key=\"your-api-key\",\n    private_key_b64=\"your-base64-private-key\",\n)\n\n# One-time setup\npublisher.register(\"Momentum-X Crypto Signals\")\n\n# Publish a signal with commit-reveal\nresult = publisher.publish_signal(\n    asset=\"BTC\u002FUSDT\",\n    direction=\"long\",\n    entry_price=68450.00,\n    stop_loss=67200.00,\n    take_profit=71000.00,\n    timeframe=\"4h\",\n    notes=\"Momentum breakout above 4h resistance\",\n    reveal_delay_seconds=60,\n)\n\nsignal_id = result[\"signal\"][\"signal_id\"]\nprint(f\"Signal published: {signal_id}\")\nprint(f\"Commitment hash: {result['commit']['commitment_hash']}\")\n\n# Later, when the trade resolves\npublisher.record_outcome(\n    signal_id=signal_id,\n    outcome=\"hit_tp\",\n    exit_price=71000.00,\n    exit_timestamp=int(time.time()),\n)\n\n# Build Merkle chain weekly\npublisher.build_claim_chain()\n```\n\n### Handling Multiple Signals Per Day\n\nHigh-frequency signal providers may issue 10-20 signals per day. Each signal goes through commit-reveal independently. The `_pending_commits` dictionary holds all uncommitted signals in memory. In production, replace this with a persistent store (Redis, PostgreSQL) to survive process restarts.\n\nFor providers issuing many signals, batch the Merkle chain build. Rather than building after every signal, build once at end-of-day or once per 50 signals. This reduces API calls while maintaining the same cryptographic guarantees -- all signals within the batch are included in the chain.\n\n```python\nimport time\n\n# Track signal count since last chain build\nsignals_since_chain = 0\nCHAIN_BUILD_THRESHOLD = 50\n\ndef on_signal_outcome(publisher, signal_id, outcome, exit_price):\n    global signals_since_chain\n\n    publisher.record_outcome(\n        signal_id=signal_id,\n        outcome=outcome,\n        exit_price=exit_price,\n        exit_timestamp=int(time.time()),\n    )\n    signals_since_chain += 1\n\n    if signals_since_chain >= CHAIN_BUILD_THRESHOLD:\n        publisher.build_claim_chain()\n        signals_since_chain = 0\n        print(\"Merkle chain built after 50 signal outcomes.\")\n```\n\n---\n\n## Chapter 3: The SignalVerifier Class\n\n### Why Buyers Need Independent Verification\n\nA signal provider claims 72% accuracy over 90 days. The provider's website shows a beautiful equity curve and a table of winning trades. Without verification, you are trusting the provider to honestly report their own performance -- the same trust model that has failed for every Telegram signal group, every copy trading platform, and every signal marketplace built to date. The SignalVerifier class lets a subscriber independently verify every signal against the cryptographic record on GreenHelix. No trust required.\n\n### The Complete SignalVerifier Class\n\n```python\nimport base64\nimport hashlib\nimport json\nfrom typing import Optional\n\nimport requests\nfrom cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey\nfrom cryptography.hazmat.primitives import serialization\n\n\nclass SignalVerifier:\n    \"\"\"Verifies trading signals against cryptographic proofs on GreenHelix.\"\"\"\n\n    def __init__(self, api_key: str,\n                 base_url: str = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"):\n        self.api_key = api_key\n        self.base_url = base_url\n        self.headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application\u002Fjson\",\n        }\n        # Cache of provider public keys\n        self._public_keys: dict[str, Ed25519PublicKey] = {}\n\n    def _execute(self, tool: str, input_data: dict) -> dict:\n        \"\"\"Execute a tool on the GreenHelix gateway.\"\"\"\n        response = requests.post(\n            f\"{self.base_url}\u002Fv1\",\n            headers=self.headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        response.raise_for_status()\n        return response.json()\n\n    def _get_public_key(self, provider_id: str) -> Ed25519PublicKey:\n        \"\"\"Fetch and cache a provider's Ed25519 public key.\"\"\"\n        if provider_id not in self._public_keys:\n            result = self._execute(\"get_agent_identity\", {\n                \"agent_id\": provider_id,\n            })\n            pub_bytes = base64.b64decode(result[\"public_key\"])\n            self._public_keys[provider_id] = Ed25519PublicKey.from_public_bytes(\n                pub_bytes\n            )\n        return self._public_keys[provider_id]\n\n    def verify_signal(self, signal: dict) -> dict:\n        \"\"\"Verify a signal's Ed25519 signature against the provider's key.\n\n        Returns a dict with verification status and details.\n        \"\"\"\n        provider_id = signal[\"provider_id\"]\n        signature_b64 = signal.get(\"signature\")\n\n        if not signature_b64:\n            return {\"verified\": False, \"reason\": \"no_signature\"}\n\n        # Reconstruct canonical JSON (exclude signature from signed data)\n        signal_data = {k: v for k, v in signal.items() if k != \"signature\"}\n        canonical = json.dumps(signal_data, sort_keys=True)\n\n        try:\n            public_key = self._get_public_key(provider_id)\n            signature_bytes = base64.b64decode(signature_b64)\n            public_key.verify(signature_bytes, canonical.encode(\"utf-8\"))\n            return {\n                \"verified\": True,\n                \"provider_id\": provider_id,\n                \"signal_id\": signal.get(\"signal_id\"),\n            }\n        except Exception as e:\n            return {\n                \"verified\": False,\n                \"reason\": \"invalid_signature\",\n                \"error\": str(e),\n            }\n\n    def check_timestamp_proof(self, signal_id: str,\n                              provider_id: str) -> dict:\n        \"\"\"Verify that a signal commitment was recorded before the reveal.\n\n        Checks the GreenHelix event bus for the commitment and reveal events,\n        and verifies that:\n        1. A commitment event exists with a valid hash.\n        2. The reveal event's content matches the commitment hash.\n        3. The commitment timestamp precedes the reveal timestamp.\n        \"\"\"\n        # Fetch the provider's claim chains\n        chains = self._execute(\"get_claim_chains\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Fetch verified claims for this provider\n        claims = self._execute(\"get_verified_claims\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Look for commitment and reveal events\n        commitment_event = None\n        reveal_event = None\n\n        for claim in claims.get(\"claims\", []):\n            payload = claim.get(\"payload\", {})\n            if (payload.get(\"signal_id\") == signal_id\n                    and claim.get(\"event_type\") == \"signal_commitment\"):\n                commitment_event = claim\n            elif (payload.get(\"signal_id\") == signal_id\n                    and claim.get(\"event_type\") == \"signal_reveal\"):\n                reveal_event = claim\n\n        if not commitment_event:\n            return {\n                \"valid\": False,\n                \"reason\": \"no_commitment_found\",\n                \"signal_id\": signal_id,\n            }\n\n        if not reveal_event:\n            return {\n                \"valid\": False,\n                \"reason\": \"no_reveal_found\",\n                \"signal_id\": signal_id,\n            }\n\n        # Verify commitment hash matches reveal content\n        reveal_payload = reveal_event.get(\"payload\", {})\n        signal_data = {\n            \"signal_id\": reveal_payload.get(\"signal_id\"),\n            \"provider_id\": provider_id,\n            \"asset\": reveal_payload.get(\"asset\"),\n            \"direction\": reveal_payload.get(\"direction\"),\n            \"entry_price\": reveal_payload.get(\"entry_price\"),\n            \"stop_loss\": reveal_payload.get(\"stop_loss\"),\n            \"take_profit\": reveal_payload.get(\"take_profit\"),\n            \"timeframe\": reveal_payload.get(\"timeframe\"),\n            \"notes\": reveal_payload.get(\"notes\", \"\"),\n            \"timestamp\": reveal_payload.get(\"timestamp\"),\n        }\n        canonical = json.dumps(signal_data, sort_keys=True)\n        computed_hash = hashlib.sha256(canonical.encode(\"utf-8\")).hexdigest()\n\n        commitment_hash = commitment_event[\"payload\"].get(\"commitment_hash\")\n        hashes_match = computed_hash == commitment_hash\n\n        # Verify timing: commitment before reveal\n        commit_time = commitment_event.get(\"recorded_at\", 0)\n        reveal_time = reveal_event.get(\"recorded_at\", 0)\n        timing_valid = commit_time \u003C reveal_time\n\n        return {\n            \"valid\": hashes_match and timing_valid,\n            \"signal_id\": signal_id,\n            \"hashes_match\": hashes_match,\n            \"commitment_hash\": commitment_hash,\n            \"computed_hash\": computed_hash,\n            \"commitment_time\": commit_time,\n            \"reveal_time\": reveal_time,\n            \"timing_valid\": timing_valid,\n        }\n\n    def audit_provider(self, provider_id: str) -> dict:\n        \"\"\"Run a full audit of a signal provider.\n\n        Checks claim chain integrity, signal count, verification rate,\n        and performance metrics.\n        \"\"\"\n        # Get claim chains\n        chains = self._execute(\"get_claim_chains\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Get verified claims\n        claims = self._execute(\"get_verified_claims\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Get reputation\n        reputation = self._execute(\"get_agent_reputation\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Count signal types\n        commitments = []\n        reveals = []\n        outcomes = []\n\n        for claim in claims.get(\"claims\", []):\n            event_type = claim.get(\"event_type\", \"\")\n            if event_type == \"signal_commitment\":\n                commitments.append(claim)\n            elif event_type == \"signal_reveal\":\n                reveals.append(claim)\n            elif event_type == \"signal_outcome\":\n                outcomes.append(claim)\n\n        # Calculate verification rate\n        total_signals = len(reveals)\n        verified_signals = 0\n        for reveal in reveals:\n            signal_id = reveal.get(\"payload\", {}).get(\"signal_id\")\n            proof = self.check_timestamp_proof(signal_id, provider_id)\n            if proof[\"valid\"]:\n                verified_signals += 1\n\n        verification_rate = (\n            verified_signals \u002F total_signals if total_signals > 0 else 0.0\n        )\n\n        # Calculate outcome stats\n        wins = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"hit_tp\"\n        )\n        losses = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"hit_sl\"\n        )\n        expired = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"expired\"\n        )\n\n        return {\n            \"provider_id\": provider_id,\n            \"trust_score\": reputation.get(\"score\"),\n            \"chain_count\": len(chains.get(\"chains\", [])),\n            \"total_commitments\": len(commitments),\n            \"total_reveals\": total_signals,\n            \"total_outcomes\": len(outcomes),\n            \"verified_signals\": verified_signals,\n            \"verification_rate\": round(verification_rate * 100, 1),\n            \"wins\": wins,\n            \"losses\": losses,\n            \"expired\": expired,\n            \"hit_rate\": round(\n                wins \u002F (wins + losses) * 100, 1\n            ) if (wins + losses) > 0 else 0.0,\n        }\n```\n\n### Verifying a Single Signal\n\nWith curl, you can manually verify a signal by fetching the provider's public key and checking the commitment:\n\n```bash\n# Step 1: Get the provider's public key\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_identity\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 2: Get their verified claims\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_verified_claims\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 3: Get their claim chains to verify Merkle integrity\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_claim_chains\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n```\n\n### Running a Full Provider Audit\n\n```python\nverifier = SignalVerifier(api_key=\"your-api-key\")\n\n# Audit a provider before subscribing\naudit = verifier.audit_provider(\"signal-provider-momentum-x\")\nprint(f\"Provider: {audit['provider_id']}\")\nprint(f\"Trust score: {audit['trust_score']}\")\nprint(f\"Total signals: {audit['total_reveals']}\")\nprint(f\"Verification rate: {audit['verification_rate']}%\")\nprint(f\"Hit rate: {audit['hit_rate']}%\")\nprint(f\"Wins: {audit['wins']}, Losses: {audit['losses']}, Expired: {audit['expired']}\")\nprint(f\"Claim chains: {audit['chain_count']}\")\n\n# Decision logic\nif (audit[\"verification_rate\"] >= 95.0\n        and audit[\"total_reveals\"] >= 50\n        and audit[\"hit_rate\"] >= 55.0\n        and audit[\"trust_score\"] >= 70):\n    print(\"Provider passes audit. Safe to subscribe.\")\nelse:\n    print(\"Provider does not meet criteria. Do not subscribe.\")\n```\n\n### What Verification Catches\n\nThe SignalVerifier detects four categories of fraud:\n\n1. **Backdated signals.** If the commitment timestamp postdates the price move, `check_timestamp_proof` returns `timing_valid: false`. The provider created the signal after the move happened.\n\n2. **Altered signals.** If the revealed signal does not match the committed hash, `check_timestamp_proof` returns `hashes_match: false`. The provider changed the signal between commitment and reveal.\n\n3. **Missing commitments.** If a revealed signal has no corresponding commitment, `check_timestamp_proof` returns `no_commitment_found`. The provider skipped the commit phase entirely -- possibly because they only commit signals they expect to win.\n\n4. **Forged signatures.** If the signature does not verify against the provider's registered public key, `verify_signal` returns `verified: false`. Someone other than the registered provider created or tampered with the signal.\n\n---\n\n## Chapter 4: Performance Computation\n\n### Why Self-Reported Metrics Are Worthless\n\nA signal provider reports 78% accuracy. What does that mean? 78% of signals hit take profit? 78% of signals were profitable at any point during their lifetime? 78% of signals that the provider chose to report? Without a rigorous, standardized computation methodology applied to verified data, the number is meaningless. The PerformanceTracker class computes metrics exclusively from signals that passed the commit-reveal verification process. Self-reported numbers are excluded entirely.\n\n### The PerformanceTracker Class\n\n```python\nimport time\nfrom dataclasses import dataclass, field\nfrom typing import Optional\n\n\n@dataclass\nclass SignalOutcome:\n    \"\"\"A verified signal outcome.\"\"\"\n    signal_id: str\n    provider_id: str\n    asset: str\n    direction: str\n    entry_price: float\n    stop_loss: float\n    take_profit: float\n    exit_price: float\n    outcome: str  # \"hit_tp\", \"hit_sl\", \"expired\"\n    signal_timestamp: int\n    exit_timestamp: int\n    verified: bool = False\n\n\nclass PerformanceTracker:\n    \"\"\"Computes performance metrics from verified signal outcomes.\"\"\"\n\n    def __init__(self):\n        self._outcomes: list[SignalOutcome] = []\n\n    def record_outcome(self, outcome: SignalOutcome) -> None:\n        \"\"\"Record a verified signal outcome.\"\"\"\n        if not outcome.verified:\n            raise ValueError(\n                f\"Signal {outcome.signal_id} is not verified. \"\n                \"Only verified signals can be recorded.\"\n            )\n        self._outcomes.append(outcome)\n\n    def _filter_by_window(self, window_seconds: Optional[int] = None\n                          ) -> list[SignalOutcome]:\n        \"\"\"Filter outcomes to those within the given time window.\"\"\"\n        if window_seconds is None:\n            return list(self._outcomes)\n        cutoff = int(time.time()) - window_seconds\n        return [o for o in self._outcomes if o.exit_timestamp >= cutoff]\n\n    def compute_stats(self, window_seconds: Optional[int] = None) -> dict:\n        \"\"\"Compute performance statistics.\n\n        Args:\n            window_seconds: If provided, only consider outcomes within\n                this many seconds of now. None means all time.\n\n        Returns:\n            Dict with hit_rate, avg_return, risk_reward_ratio,\n            max_consecutive_losses, total_signals, wins, losses.\n        \"\"\"\n        outcomes = self._filter_by_window(window_seconds)\n\n        if not outcomes:\n            return {\n                \"hit_rate\": 0.0,\n                \"avg_return\": 0.0,\n                \"risk_reward_ratio\": 0.0,\n                \"max_consecutive_losses\": 0,\n                \"total_signals\": 0,\n                \"wins\": 0,\n                \"losses\": 0,\n            }\n\n        wins = 0\n        losses = 0\n        returns = []\n        consecutive_losses = 0\n        max_consecutive_losses = 0\n        risk_sum = 0.0\n        reward_sum = 0.0\n\n        for o in outcomes:\n            # Compute return percentage\n            if o.direction == \"long\":\n                pct_return = (o.exit_price - o.entry_price) \u002F o.entry_price * 100\n                risk = abs(o.entry_price - o.stop_loss)\n                reward = abs(o.take_profit - o.entry_price)\n            else:  # short\n                pct_return = (o.entry_price - o.exit_price) \u002F o.entry_price * 100\n                risk = abs(o.stop_loss - o.entry_price)\n                reward = abs(o.entry_price - o.take_profit)\n\n            returns.append(pct_return)\n\n            if risk > 0:\n                risk_sum += risk\n                reward_sum += reward\n\n            if o.outcome == \"hit_tp\":\n                wins += 1\n                consecutive_losses = 0\n            elif o.outcome == \"hit_sl\":\n                losses += 1\n                consecutive_losses += 1\n                max_consecutive_losses = max(\n                    max_consecutive_losses, consecutive_losses\n                )\n            else:  # expired\n                consecutive_losses = 0\n\n        total = wins + losses\n        hit_rate = (wins \u002F total * 100) if total > 0 else 0.0\n        avg_return = sum(returns) \u002F len(returns) if returns else 0.0\n        risk_reward = (reward_sum \u002F risk_sum) if risk_sum > 0 else 0.0\n\n        return {\n            \"hit_rate\": round(hit_rate, 2),\n            \"avg_return\": round(avg_return, 4),\n            \"risk_reward_ratio\": round(risk_reward, 2),\n            \"max_consecutive_losses\": max_consecutive_losses,\n            \"total_signals\": len(outcomes),\n            \"wins\": wins,\n            \"losses\": losses,\n        }\n\n    def get_rolling(self) -> dict:\n        \"\"\"Compute rolling window statistics for 7d, 30d, and 90d.\"\"\"\n        return {\n            \"7d\": self.compute_stats(window_seconds=7 * 86400),\n            \"30d\": self.compute_stats(window_seconds=30 * 86400),\n            \"90d\": self.compute_stats(window_seconds=90 * 86400),\n            \"all_time\": self.compute_stats(window_seconds=None),\n        }\n```\n\n### Metrics Definitions\n\n| Metric | Definition | Why It Matters |\n|--------|-----------|----------------|\n| `hit_rate` | Percentage of signals that hit take profit out of all resolved signals (TP + SL) | The most intuitive measure of accuracy. Expired signals are excluded because they neither won nor lost. |\n| `avg_return` | Mean percentage return across all resolved signals, including losses | Captures the magnitude of wins and losses, not just the count. A 60% hit rate with average +0.1% return is worse than 50% with +2.0% average. |\n| `risk_reward_ratio` | Average reward (entry to TP) divided by average risk (entry to SL) | Measures how much the provider risks per unit of potential reward. A ratio above 2.0 means the provider targets gains twice the size of their stop losses. |\n| `max_consecutive_losses` | Longest streak of consecutive losing signals | Critical for risk management. A provider with 65% hit rate but 12 consecutive losses at one point signals high variance that may not suit all subscribers. |\n\n### Accounting for Slippage and Execution Delays\n\nVerified signal accuracy is computed from the signal's stated entry price and the actual outcome. But subscribers executing the signal in real markets face slippage. A signal published at entry price $68,450 may be executed at $68,480 due to order book depth and latency. The PerformanceTracker computes raw metrics from the signal itself. Slippage-adjusted metrics require the subscriber to report their actual execution price.\n\n```python\ndef compute_slippage_adjusted(self, actual_entries: dict[str, float],\n                               window_seconds: Optional[int] = None) -> dict:\n    \"\"\"Compute stats adjusted for actual execution prices.\n\n    Args:\n        actual_entries: Dict mapping signal_id to actual entry price.\n        window_seconds: Time window filter.\n    \"\"\"\n    outcomes = self._filter_by_window(window_seconds)\n    adjusted_returns = []\n\n    for o in outcomes:\n        actual_entry = actual_entries.get(o.signal_id, o.entry_price)\n        if o.direction == \"long\":\n            pct = (o.exit_price - actual_entry) \u002F actual_entry * 100\n        else:\n            pct = (actual_entry - o.exit_price) \u002F actual_entry * 100\n        adjusted_returns.append(pct)\n\n    avg_slippage_adjusted = (\n        sum(adjusted_returns) \u002F len(adjusted_returns)\n        if adjusted_returns else 0.0\n    )\n\n    raw_stats = self.compute_stats(window_seconds)\n    return {\n        **raw_stats,\n        \"avg_return_slippage_adjusted\": round(avg_slippage_adjusted, 4),\n        \"slippage_impact\": round(\n            raw_stats[\"avg_return\"] - avg_slippage_adjusted, 4\n        ),\n    }\n```\n\n### Computing Drawdown From Verified Signals\n\nThe `max_consecutive_losses` metric captures the count of sequential losses, but drawdown in percentage terms requires tracking cumulative loss within a streak. Here is an extension to the PerformanceTracker that computes maximum drawdown as a percentage:\n\n```python\ndef compute_max_drawdown_pct(self, window_seconds: Optional[int] = None\n                              ) -> float:\n    \"\"\"Compute maximum drawdown as cumulative loss percentage\n    during the worst consecutive losing streak.\n\n    Returns the absolute value of the worst drawdown.\n    \"\"\"\n    outcomes = self._filter_by_window(window_seconds)\n    if not outcomes:\n        return 0.0\n\n    max_drawdown = 0.0\n    current_drawdown = 0.0\n\n    for o in outcomes:\n        if o.direction == \"long\":\n            pct = (o.exit_price - o.entry_price) \u002F o.entry_price * 100\n        else:\n            pct = (o.entry_price - o.exit_price) \u002F o.entry_price * 100\n\n        if pct \u003C 0:\n            current_drawdown += abs(pct)\n            max_drawdown = max(max_drawdown, current_drawdown)\n        else:\n            current_drawdown = 0.0\n\n    return round(max_drawdown, 2)\n```\n\nThis metric matters because a provider could have a reasonable hit rate (55%) but size their stop losses so loosely that each loss wipes out three wins. The drawdown percentage captures this behavior in a way that hit rate alone does not.\n\n### Submitting Computed Metrics to GreenHelix\n\nAfter computing performance statistics, submit them as verified metrics so they appear in search results and leaderboards:\n\n```python\ntracker = PerformanceTracker()\n\n# ... record verified outcomes ...\n\nstats = tracker.compute_stats()\nrolling = tracker.get_rolling()\n\n# Submit to GreenHelix\npublisher.submit_performance_snapshot({\n    \"hit_rate\": stats[\"hit_rate\"],\n    \"avg_return\": stats[\"avg_return\"],\n    \"risk_reward_ratio\": stats[\"risk_reward_ratio\"],\n    \"max_consecutive_losses\": stats[\"max_consecutive_losses\"],\n    \"total_signals\": stats[\"total_signals\"],\n    \"rolling_7d_hit_rate\": rolling[\"7d\"][\"hit_rate\"],\n    \"rolling_30d_hit_rate\": rolling[\"30d\"][\"hit_rate\"],\n    \"rolling_90d_hit_rate\": rolling[\"90d\"][\"hit_rate\"],\n})\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"submit_metrics\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"metrics\": {\n        \"hit_rate\": 67.3,\n        \"avg_return\": 1.24,\n        \"risk_reward_ratio\": 2.1,\n        \"max_consecutive_losses\": 4,\n        \"total_signals\": 187,\n        \"rolling_7d_hit_rate\": 71.4,\n        \"rolling_30d_hit_rate\": 68.2,\n        \"rolling_90d_hit_rate\": 67.3\n      }\n    }\n  }'\n```\n\n---\n\n## Chapter 5: Escrow-Linked Subscriptions\n\n### Why Direct Payment Is Broken\n\nTraditional signal subscriptions use direct payment: the subscriber pays $99\u002Fmonth upfront, receives signals for 30 days, and hopes the signals are good. If the signals underperform, the subscriber cancels. The provider has already been paid. There is zero financial alignment between the provider's revenue and the subscriber's outcome. Escrow-linked subscriptions fix this by making payment contingent on verified performance. The subscriber's funds sit in escrow for the evaluation period. If the provider meets the agreed performance criteria, escrow releases automatically. If not, the subscriber can dispute.\n\n### Performance Criteria Design\n\nPerformance criteria must be specific, measurable, and computed from verified data. Vague criteria like \"good performance\" are unenforceable. Here is a well-designed criteria object:\n\n```python\nperformance_criteria = {\n    \"min_hit_rate\": 55.0,          # Minimum hit rate percentage\n    \"min_risk_reward\": 1.5,         # Minimum risk\u002Freward ratio\n    \"max_drawdown\": 15.0,           # Maximum consecutive loss percentage\n    \"min_signal_count\": 15,         # Minimum signals during evaluation period\n    \"evaluation_metric_source\": \"verified_only\",  # Only count verified signals\n}\n```\n\nEach criterion maps to a computable metric:\n\n- **min_hit_rate**: Computed from `PerformanceTracker.compute_stats()[\"hit_rate\"]`\n- **min_risk_reward**: Computed from `PerformanceTracker.compute_stats()[\"risk_reward_ratio\"]`\n- **max_drawdown**: Maximum cumulative loss during any consecutive losing streak\n- **min_signal_count**: Total number of verified signals issued during the evaluation period\n\n### Creating an Escrow-Linked Subscription\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"create_performance_escrow\",\n    \"input\": {\n      \"payer_agent_id\": \"subscriber-bot-001\",\n      \"payee_agent_id\": \"signal-provider-momentum-x\",\n      \"amount\": 99.00,\n      \"currency\": \"USD\",\n      \"performance_criteria\": {\n        \"min_hit_rate\": 55.0,\n        \"min_risk_reward\": 1.5,\n        \"max_drawdown\": 15.0,\n        \"min_signal_count\": 15\n      },\n      \"evaluation_period_days\": 30\n    }\n  }'\n```\n\nWith Python:\n\n```python\ndef create_signal_subscription(client, subscriber_id: str,\n                                provider_id: str, amount: float,\n                                criteria: dict,\n                                evaluation_days: int = 30) -> dict:\n    \"\"\"Create an escrow-linked signal subscription.\n\n    Args:\n        client: GreenHelix API client instance.\n        subscriber_id: The subscribing agent's ID.\n        provider_id: The signal provider's agent ID.\n        amount: Subscription amount in USD.\n        criteria: Performance criteria dict.\n        evaluation_days: Evaluation period in days.\n\n    Returns:\n        Escrow creation result including escrow_id.\n    \"\"\"\n    return client._execute(\"create_performance_escrow\", {\n        \"payer_agent_id\": subscriber_id,\n        \"payee_agent_id\": provider_id,\n        \"amount\": amount,\n        \"currency\": \"USD\",\n        \"performance_criteria\": criteria,\n        \"evaluation_period_days\": evaluation_days,\n    })\n\n\ndef evaluate_subscription(client, verifier: SignalVerifier,\n                           tracker: PerformanceTracker,\n                           escrow_id: str,\n                           provider_id: str,\n                           criteria: dict) -> dict:\n    \"\"\"Evaluate whether a subscription's performance criteria are met.\n\n    Args:\n        client: GreenHelix API client instance.\n        verifier: SignalVerifier for auditing the provider.\n        tracker: PerformanceTracker with recorded outcomes.\n        escrow_id: The escrow to evaluate.\n        provider_id: The signal provider's agent ID.\n        criteria: The performance criteria to check against.\n\n    Returns:\n        Evaluation result with pass\u002Ffail and action taken.\n    \"\"\"\n    # Compute current stats from verified data\n    stats = tracker.compute_stats()\n\n    # Check each criterion\n    checks = {\n        \"hit_rate\": stats[\"hit_rate\"] >= criteria.get(\"min_hit_rate\", 0),\n        \"risk_reward\": (\n            stats[\"risk_reward_ratio\"]\n            >= criteria.get(\"min_risk_reward\", 0)\n        ),\n        \"drawdown\": (\n            stats[\"max_consecutive_losses\"]\n            \u003C= criteria.get(\"max_drawdown\", float(\"inf\"))\n        ),\n        \"signal_count\": (\n            stats[\"total_signals\"]\n            >= criteria.get(\"min_signal_count\", 0)\n        ),\n    }\n\n    all_passed = all(checks.values())\n\n    if all_passed:\n        # Auto-release escrow\n        release_result = client._execute(\"release_escrow\", {\n            \"escrow_id\": escrow_id,\n        })\n        return {\n            \"status\": \"passed\",\n            \"checks\": checks,\n            \"stats\": stats,\n            \"action\": \"escrow_released\",\n            \"release_result\": release_result,\n        }\n    else:\n        # Criteria not met -- subscriber can file dispute\n        failed_checks = {k: v for k, v in checks.items() if not v}\n        return {\n            \"status\": \"failed\",\n            \"checks\": checks,\n            \"failed_checks\": list(failed_checks.keys()),\n            \"stats\": stats,\n            \"action\": \"dispute_recommended\",\n            \"escrow_id\": escrow_id,\n        }\n```\n\n### Usage: Full Subscription Lifecycle\n\n```python\nimport requests\n\nBASE_URL = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"\nAPI_KEY = \"your-api-key\"\n\nheaders = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Content-Type\": \"application\u002Fjson\",\n}\n\nclass SimpleClient:\n    def _execute(self, tool, input_data):\n        resp = requests.post(\n            f\"{BASE_URL}\u002Fv1\",\n            headers=headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        resp.raise_for_status()\n        return resp.json()\n\nclient = SimpleClient()\nverifier = SignalVerifier(api_key=API_KEY)\ntracker = PerformanceTracker()\n\n# Subscriber creates escrow-linked subscription\ncriteria = {\n    \"min_hit_rate\": 55.0,\n    \"min_risk_reward\": 1.5,\n    \"max_drawdown\": 15.0,\n    \"min_signal_count\": 15,\n}\n\nescrow = create_signal_subscription(\n    client=client,\n    subscriber_id=\"subscriber-bot-001\",\n    provider_id=\"signal-provider-momentum-x\",\n    amount=99.00,\n    criteria=criteria,\n    evaluation_days=30,\n)\nescrow_id = escrow[\"escrow_id\"]\nprint(f\"Subscription created. Escrow ID: {escrow_id}\")\n\n# ... 30 days pass, signals are issued and verified ...\n# ... tracker has recorded all verified outcomes ...\n\n# Evaluate at end of period\nresult = evaluate_subscription(\n    client=client,\n    verifier=verifier,\n    tracker=tracker,\n    escrow_id=escrow_id,\n    provider_id=\"signal-provider-momentum-x\",\n    criteria=criteria,\n)\n\nif result[\"status\"] == \"passed\":\n    print(f\"Performance criteria met. Escrow released.\")\n    print(f\"Stats: {result['stats']}\")\nelse:\n    print(f\"Performance criteria NOT met.\")\n    print(f\"Failed checks: {result['failed_checks']}\")\n    print(f\"Recommend filing dispute on escrow {escrow_id}\")\n```\n\n### Setting Conservative Criteria\n\nThe most common mistake subscribers make is setting unrealistically tight criteria. A min_hit_rate of 70% sounds reasonable, but over a 30-day window with 20 signals, normal variance can produce a 55% hit rate even from a genuinely 65% accurate provider. Set criteria at the lower bound of what is acceptable, not the average of what the provider has historically delivered. Leave a margin for variance. A provider with a 67% verified 90-day hit rate should be evaluated against a 55% minimum for a 30-day escrow window.\n\n---\n\n## Chapter 6: Rolling Accuracy Windows\n\n### Why Point-in-Time Evaluation Is Insufficient\n\nEvaluating a signal provider only at the end of a subscription period misses dangerous patterns. A provider could deliver 80% accuracy for the first 25 days and then issue 10 reckless signals in the final 5 days. The period-end evaluation might still show 58% overall accuracy -- barely passing the criterion -- while the subscriber suffered a severe drawdown in the final week. Rolling accuracy windows provide continuous evaluation, catching performance degradation as it happens rather than after the damage is done.\n\n### The RollingAccuracyMonitor Class\n\n```python\nimport time\nfrom typing import Callable, Optional\n\n\nclass RollingAccuracyMonitor:\n    \"\"\"Monitors signal provider accuracy with sliding windows.\n\n    Triggers alerts when performance degrades below thresholds\n    within any rolling window.\n    \"\"\"\n\n    def __init__(self, provider_id: str, tracker: PerformanceTracker,\n                 alert_callback: Optional[Callable[[dict], None]] = None):\n        self.provider_id = provider_id\n        self.tracker = tracker\n        self.alert_callback = alert_callback or self._default_alert\n\n        # Alert thresholds for each window\n        self.thresholds = {\n            \"7d\": {\n                \"min_hit_rate\": 40.0,\n                \"max_consecutive_losses\": 6,\n            },\n            \"30d\": {\n                \"min_hit_rate\": 50.0,\n                \"max_consecutive_losses\": 8,\n            },\n            \"90d\": {\n                \"min_hit_rate\": 55.0,\n                \"max_consecutive_losses\": 10,\n            },\n        }\n\n    def _default_alert(self, alert: dict) -> None:\n        \"\"\"Default alert handler: print to stdout.\"\"\"\n        print(f\"ALERT [{alert['severity']}]: {alert['message']}\")\n\n    def set_thresholds(self, window: str, min_hit_rate: float = None,\n                       max_consecutive_losses: int = None) -> None:\n        \"\"\"Update alert thresholds for a specific window.\"\"\"\n        if window not in self.thresholds:\n            self.thresholds[window] = {}\n        if min_hit_rate is not None:\n            self.thresholds[window][\"min_hit_rate\"] = min_hit_rate\n        if max_consecutive_losses is not None:\n            self.thresholds[window][\"max_consecutive_losses\"] = (\n                max_consecutive_losses\n            )\n\n    def check(self) -> dict:\n        \"\"\"Run a full check across all rolling windows.\n\n        Returns a dict with the status for each window and any\n        triggered alerts.\n        \"\"\"\n        rolling = self.tracker.get_rolling()\n        alerts = []\n        window_status = {}\n\n        for window_name, window_config in self.thresholds.items():\n            stats = rolling.get(window_name, {})\n            if not stats or stats.get(\"total_signals\", 0) == 0:\n                window_status[window_name] = \"insufficient_data\"\n                continue\n\n            violations = []\n\n            # Check hit rate\n            min_hr = window_config.get(\"min_hit_rate\")\n            if min_hr is not None and stats[\"hit_rate\"] \u003C min_hr:\n                violations.append({\n                    \"metric\": \"hit_rate\",\n                    \"threshold\": min_hr,\n                    \"actual\": stats[\"hit_rate\"],\n                })\n\n            # Check consecutive losses\n            max_cl = window_config.get(\"max_consecutive_losses\")\n            if (max_cl is not None\n                    and stats[\"max_consecutive_losses\"] > max_cl):\n                violations.append({\n                    \"metric\": \"max_consecutive_losses\",\n                    \"threshold\": max_cl,\n                    \"actual\": stats[\"max_consecutive_losses\"],\n                })\n\n            if violations:\n                severity = \"critical\" if window_name == \"7d\" else \"warning\"\n                alert = {\n                    \"provider_id\": self.provider_id,\n                    \"window\": window_name,\n                    \"severity\": severity,\n                    \"violations\": violations,\n                    \"stats\": stats,\n                    \"timestamp\": int(time.time()),\n                    \"message\": (\n                        f\"Provider {self.provider_id} violated \"\n                        f\"{len(violations)} threshold(s) in \"\n                        f\"{window_name} window: \"\n                        + \", \".join(\n                            f\"{v['metric']}={v['actual']} \"\n                            f\"(threshold: {v['threshold']})\"\n                            for v in violations\n                        )\n                    ),\n                }\n                alerts.append(alert)\n                self.alert_callback(alert)\n                window_status[window_name] = \"degraded\"\n            else:\n                window_status[window_name] = \"healthy\"\n\n        return {\n            \"provider_id\": self.provider_id,\n            \"checked_at\": int(time.time()),\n            \"window_status\": window_status,\n            \"alerts\": alerts,\n            \"rolling_stats\": rolling,\n        }\n```\n\n### Subscriber Notification via Webhooks\n\nWhen the rolling monitor detects degradation, notify subscribers automatically using GreenHelix webhooks:\n\n```python\ndef setup_webhook_alerts(client, subscriber_id: str,\n                          provider_id: str,\n                          webhook_url: str) -> dict:\n    \"\"\"Register a webhook to receive performance alerts.\n\n    The webhook fires when the rolling accuracy monitor detects\n    threshold violations for the given provider.\n    \"\"\"\n    return client._execute(\"register_webhook\", {\n        \"agent_id\": subscriber_id,\n        \"event_type\": \"performance_alert\",\n        \"filter\": {\"provider_id\": provider_id},\n        \"url\": webhook_url,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"register_webhook\",\n    \"input\": {\n      \"agent_id\": \"subscriber-bot-001\",\n      \"event_type\": \"performance_alert\",\n      \"filter\": {\"provider_id\": \"signal-provider-momentum-x\"},\n      \"url\": \"https:\u002F\u002Fmy-bot.example.com\u002Fwebhooks\u002Fperformance-alert\"\n    }\n  }'\n```\n\n### Running the Monitor on a Schedule\n\n```python\nimport time\n\nmonitor = RollingAccuracyMonitor(\n    provider_id=\"signal-provider-momentum-x\",\n    tracker=tracker,\n    alert_callback=lambda alert: send_to_slack(alert),\n)\n\n# Customize thresholds\nmonitor.set_thresholds(\"7d\", min_hit_rate=45.0, max_consecutive_losses=5)\nmonitor.set_thresholds(\"30d\", min_hit_rate=52.0)\n\n# Run every hour\nwhile True:\n    result = monitor.check()\n    print(f\"Status: {result['window_status']}\")\n    if result[\"alerts\"]:\n        print(f\"  {len(result['alerts'])} alert(s) fired\")\n    time.sleep(3600)\n```\n\n### Integrating the Monitor With Escrow Evaluation\n\nThe rolling accuracy monitor can trigger early dispute filing rather than waiting for the evaluation period to end. If the 7-day window enters critical status and the 30-day window is also degraded, the subscriber has strong evidence that the provider will not meet the escrow criteria by period end. Filing early preserves the evidence trail and prevents the provider from issuing a burst of favorable signals at the last minute to pull the average up.\n\n```python\ndef check_and_maybe_dispute(monitor: RollingAccuracyMonitor,\n                             client, escrow_id: str,\n                             criteria: dict,\n                             tracker: PerformanceTracker,\n                             verifier: SignalVerifier,\n                             provider_id: str) -> Optional[dict]:\n    \"\"\"Run rolling check and file dispute if situation is irrecoverable.\"\"\"\n    result = monitor.check()\n\n    # Both 7d and 30d degraded = likely irrecoverable\n    ws = result[\"window_status\"]\n    if ws.get(\"7d\") == \"degraded\" and ws.get(\"30d\") == \"degraded\":\n        stats = tracker.compute_stats()\n        # Check if mathematically possible to recover\n        remaining_signals_needed = criteria.get(\"min_signal_count\", 0) - stats[\"total_signals\"]\n        if remaining_signals_needed \u003C 0:\n            remaining_signals_needed = 0\n\n        current_losses = stats[\"losses\"]\n        current_wins = stats[\"wins\"]\n        needed_wins = 0\n        target_hr = criteria.get(\"min_hit_rate\", 0)\n\n        # Would need X consecutive wins to reach target\n        total = current_wins + current_losses\n        if total > 0:\n            needed_total_wins = int(target_hr \u002F 100 * (total + remaining_signals_needed))\n            needed_wins = max(0, needed_total_wins - current_wins)\n\n        if needed_wins > remaining_signals_needed:\n            # Mathematically impossible to recover\n            evidence = build_evidence_package(\n                verifier, tracker, provider_id, escrow_id, criteria\n            )\n            return file_dispute(client, escrow_id, evidence)\n\n    return None\n```\n\n### Early Warning Patterns\n\nThe rolling monitor catches three patterns that period-end evaluation misses:\n\n1. **Sudden degradation.** The 7-day window hits critical threshold while 30-day and 90-day windows are still healthy. This means the provider's recent performance has collapsed even though historical performance was good. The subscriber can prepare to dispute or exit before the full evaluation period ends.\n\n2. **Gradual decline.** The 90-day window is healthy, the 30-day window shows warning, and the 7-day window is critical. Performance is trending down across all timeframes. This pattern often precedes a provider shutting down or pivoting to a different strategy.\n\n3. **Volatility spikes.** The `max_consecutive_losses` threshold fires while hit rate is still acceptable. The provider's win rate is fine on average, but they are experiencing unusual streaks of losses. This can indicate regime change in the underlying market or a breakdown in the provider's signal generation process.\n\n---\n\n## Chapter 7: Dispute Resolution\n\n### When Disputes Happen\n\nA dispute occurs when the evaluation period ends and the provider's verified performance does not meet the escrow criteria. The subscriber's funds remain in escrow. Three outcomes are possible: full refund to the subscriber, partial release to the provider (if some criteria were met), or dismissal (if the subscriber's claim is invalid). The dispute process uses the same cryptographic evidence chain that underpins the entire verification network, making disputes data-driven rather than he-said-she-said.\n\n### Building an Evidence Package\n\nWhen filing a dispute, the subscriber must present evidence. Because all signals went through the commit-reveal process, the evidence is already on-chain and verifiable. The evidence package pulls everything together.\n\n```python\ndef build_evidence_package(verifier: SignalVerifier,\n                            tracker: PerformanceTracker,\n                            provider_id: str,\n                            escrow_id: str,\n                            criteria: dict) -> dict:\n    \"\"\"Build a complete evidence package for a dispute.\n\n    Includes:\n    - Provider audit results\n    - Performance stats vs criteria\n    - Specific failed criteria with evidence\n    - Claim chain references for independent verification\n    \"\"\"\n    audit = verifier.audit_provider(provider_id)\n    stats = tracker.compute_stats()\n    rolling = tracker.get_rolling()\n\n    # Identify specific failures\n    failures = []\n\n    if stats[\"hit_rate\"] \u003C criteria.get(\"min_hit_rate\", 0):\n        failures.append({\n            \"criterion\": \"min_hit_rate\",\n            \"required\": criteria[\"min_hit_rate\"],\n            \"actual\": stats[\"hit_rate\"],\n            \"evidence\": (\n                f\"Verified hit rate of {stats['hit_rate']}% across \"\n                f\"{stats['total_signals']} signals is below the \"\n                f\"required {criteria['min_hit_rate']}%.\"\n            ),\n        })\n\n    if stats[\"risk_reward_ratio\"] \u003C criteria.get(\"min_risk_reward\", 0):\n        failures.append({\n            \"criterion\": \"min_risk_reward\",\n            \"required\": criteria[\"min_risk_reward\"],\n            \"actual\": stats[\"risk_reward_ratio\"],\n            \"evidence\": (\n                f\"Risk\u002Freward ratio of {stats['risk_reward_ratio']} \"\n                f\"is below the required {criteria['min_risk_reward']}.\"\n            ),\n        })\n\n    if stats[\"total_signals\"] \u003C criteria.get(\"min_signal_count\", 0):\n        failures.append({\n            \"criterion\": \"min_signal_count\",\n            \"required\": criteria[\"min_signal_count\"],\n            \"actual\": stats[\"total_signals\"],\n            \"evidence\": (\n                f\"Only {stats['total_signals']} verified signals issued \"\n                f\"during the evaluation period. Minimum required: \"\n                f\"{criteria['min_signal_count']}.\"\n            ),\n        })\n\n    return {\n        \"escrow_id\": escrow_id,\n        \"provider_id\": provider_id,\n        \"audit\": audit,\n        \"performance_stats\": stats,\n        \"rolling_stats\": rolling,\n        \"criteria\": criteria,\n        \"failures\": failures,\n        \"verification_rate\": audit[\"verification_rate\"],\n        \"claim_chain_count\": audit[\"chain_count\"],\n    }\n```\n\n### Filing a Dispute\n\n```python\ndef file_dispute(client, escrow_id: str, evidence: dict) -> dict:\n    \"\"\"File a dispute with an evidence package.\n\n    The evidence is serialized and submitted alongside the dispute\n    so the resolution process has access to verifiable data.\n    \"\"\"\n    reason = (\n        f\"Performance criteria not met. \"\n        f\"{len(evidence['failures'])} criterion\u002Fcriteria failed: \"\n        + \"; \".join(\n            f\"{f['criterion']}: required {f['required']}, \"\n            f\"actual {f['actual']}\"\n            for f in evidence[\"failures\"]\n        )\n    )\n\n    return client._execute(\"open_dispute\", {\n        \"escrow_id\": escrow_id,\n        \"reason\": reason,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"open_dispute\",\n    \"input\": {\n      \"escrow_id\": \"esc_abc123\",\n      \"reason\": \"Performance criteria not met. 2 criteria failed: min_hit_rate: required 55.0, actual 48.2; min_signal_count: required 15, actual 11.\"\n    }\n  }'\n```\n\n### Automated Dispute Filing\n\nThe evaluation function from Chapter 5 already identifies when criteria are not met. Combine it with the evidence builder and dispute filer for fully automated dispute resolution:\n\n```python\ndef auto_evaluate_and_dispute(client, verifier, tracker,\n                               escrow_id: str, provider_id: str,\n                               criteria: dict) -> dict:\n    \"\"\"Evaluate subscription and automatically file dispute if needed.\"\"\"\n    result = evaluate_subscription(\n        client=client,\n        verifier=verifier,\n        tracker=tracker,\n        escrow_id=escrow_id,\n        provider_id=provider_id,\n        criteria=criteria,\n    )\n\n    if result[\"status\"] == \"passed\":\n        return {\"action\": \"escrow_released\", \"result\": result}\n\n    # Build evidence and file dispute\n    evidence = build_evidence_package(\n        verifier=verifier,\n        tracker=tracker,\n        provider_id=provider_id,\n        escrow_id=escrow_id,\n        criteria=criteria,\n    )\n\n    dispute_result = file_dispute(\n        client=client,\n        escrow_id=escrow_id,\n        evidence=evidence,\n    )\n\n    return {\n        \"action\": \"dispute_filed\",\n        \"evidence\": evidence,\n        \"dispute_result\": dispute_result,\n    }\n```\n\n### Resolution Outcomes\n\nDisputes resolve into one of three outcomes:\n\n**Full refund.** The evidence clearly shows the provider failed to meet the criteria. All escrowed funds return to the subscriber. This is the most common outcome when the evidence is backed by verified claim chains -- the data is unambiguous.\n\n**Partial release.** The provider met some but not all criteria, or met them partially. For example, the provider delivered a 53% hit rate against a 55% minimum, but the risk\u002Freward ratio exceeded the target significantly. A partial release acknowledges that the provider delivered meaningful value even if the strict criteria were not met. The split is typically computed proportionally to the criteria that were met.\n\n**Dismissal.** The subscriber's claim is invalid. This happens when the evidence does not support the dispute -- for example, the subscriber computed metrics from unverified signals, or the criteria were ambiguously defined, or the provider's verified data actually meets the criteria. Escrowed funds release to the provider. Dismissals also occur when the subscriber fails to account for the difference between raw signal accuracy and execution accuracy. If the provider's verified signals met the criteria but the subscriber's actual trades did not (due to slippage, late execution, or partial fills), the dispute is against the subscriber's execution, not the provider's signals.\n\n```python\n# Provider responds to a dispute\ndef respond_to_dispute(client, dispute_id: str,\n                        provider_evidence: dict) -> dict:\n    \"\"\"Provider responds to a dispute with counter-evidence.\"\"\"\n    return client._execute(\"resolve_dispute\", {\n        \"dispute_id\": dispute_id,\n        \"resolution\": \"counter_evidence\",\n        \"evidence\": provider_evidence,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"resolve_dispute\",\n    \"input\": {\n      \"dispute_id\": \"dsp_xyz789\",\n      \"resolution\": \"full_refund\"\n    }\n  }'\n```\n\n### Why This Works Better Than Traditional Disputes\n\nTraditional signal subscription disputes are subjective. \"The signals were bad\" is not verifiable. \"I lost money\" does not prove the provider was at fault -- the subscriber might have executed poorly. Cryptographic verification removes subjectivity entirely. The evidence package contains: the exact signals issued (with Ed25519 signatures and timestamp proofs), the exact outcomes (verified against market data), the exact performance statistics (computed from verified data), and the exact criteria that were agreed upon at escrow creation. There is nothing to argue about. The data either meets the criteria or it does not.\n\nThis eliminates the two most common problems with traditional dispute resolution in signal services. First, the \"he said, she said\" problem disappears because both parties agreed to the criteria at escrow creation and the metrics are computed from signed, immutable data. Second, the \"selective evidence\" problem disappears because the Merkle claim chain includes all signals, not just the ones either party wants to highlight. A provider cannot present only their winning signals, and a subscriber cannot present only the losses. The chain is complete or it is invalid.\n\n---\n\n## Chapter 8: Leaderboards and Discovery\n\n### Building Signal Provider Leaderboards\n\nThe GreenHelix leaderboard ranks signal providers by composite reputation score, which is computed from verified metrics, claim chain depth, and consistency over time. Unlike self-reported leaderboards where providers game rankings by cherry-picking metrics, the GreenHelix leaderboard is computed exclusively from cryptographically verified data.\n\n```python\ndef get_signal_leaderboard(client) -> list[dict]:\n    \"\"\"Fetch the signal provider leaderboard.\n\n    Returns providers ranked by composite reputation score.\n    Automatically filters out test\u002Faudit\u002Fstress agent IDs.\n    \"\"\"\n    result = client._execute(\"get_agent_leaderboard\", {})\n    return result.get(\"agents\", [])\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_leaderboard\",\n    \"input\": {}\n  }'\n```\n\n### Searching by Performance Metrics\n\nSubscribers can discover providers by searching for specific performance thresholds. This is where submitting standardized metrics (Chapter 4) pays off -- providers who submit complete metrics appear in more searches.\n\n```python\ndef discover_providers(client, min_hit_rate: float = 55.0,\n                        min_signals: int = 50,\n                        max_drawdown: float = 15.0) -> list[dict]:\n    \"\"\"Discover signal providers meeting minimum criteria.\n\n    Searches by multiple metrics and intersects results.\n    \"\"\"\n    # Search by hit rate\n    hit_rate_results = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"hit_rate\",\n        \"min_value\": min_hit_rate,\n        \"max_value\": 100.0,\n    })\n\n    # Search by signal count\n    signal_count_results = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"total_signals\",\n        \"min_value\": min_signals,\n    })\n\n    # Intersect results\n    hit_rate_ids = {\n        a[\"agent_id\"] for a in hit_rate_results.get(\"agents\", [])\n    }\n    signal_count_ids = {\n        a[\"agent_id\"] for a in signal_count_results.get(\"agents\", [])\n    }\n\n    qualifying_ids = hit_rate_ids & signal_count_ids\n\n    # Get full details for qualifying providers\n    providers = []\n    for agent_id in qualifying_ids:\n        reputation = client._execute(\"get_agent_reputation\", {\n            \"agent_id\": agent_id,\n        })\n        claims = client._execute(\"get_verified_claims\", {\n            \"agent_id\": agent_id,\n        })\n        providers.append({\n            \"agent_id\": agent_id,\n            \"trust_score\": reputation.get(\"score\"),\n            \"claims\": claims,\n        })\n\n    # Sort by trust score descending\n    providers.sort(key=lambda p: p.get(\"trust_score\", 0), reverse=True)\n    return providers\n```\n\nWith curl:\n\n```bash\n# Search for providers with hit rate >= 60%\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"hit_rate\",\n      \"min_value\": 60.0,\n      \"max_value\": 100.0\n    }\n  }'\n\n# Search for providers with >= 100 verified signals\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"total_signals\",\n      \"min_value\": 100\n    }\n  }'\n```\n\n### Anti-Gaming Measures\n\nThree measures prevent providers from gaming the leaderboard:\n\n**Minimum signal count.** Providers with fewer than 30 verified signals are excluded from the leaderboard and from search results. This prevents a provider from issuing 3 lucky signals and claiming 100% accuracy. Thirty signals is the minimum sample size for statistical significance at a 95% confidence level with a 10% margin of error.\n\n**Minimum history.** Providers must have at least 30 days of continuous verified activity (claim chains built at least weekly) to appear in search results. This prevents account churn -- creating new identities to discard bad track records. Building a 30-day verified history has a real cost in time and commitment. A provider who blows up their track record cannot simply create a new agent ID and start fresh with zero history. They must invest another 30 days of consistent, verified signal publishing before they become visible to subscribers again. This asymmetry -- destroying reputation is instant, rebuilding it takes weeks -- creates the correct incentive for providers to manage risk carefully.\n\n**Leaderboard ID filtering.** GreenHelix automatically filters agent IDs prefixed with `test-`, `perf-`, `audit-`, or `stress-` from the leaderboard. This prevents test accounts from polluting rankings. Production signal providers should use descriptive, permanent agent IDs.\n\n```python\ndef validate_provider_for_listing(client, verifier: SignalVerifier,\n                                   provider_id: str) -> dict:\n    \"\"\"Check if a provider meets minimum listing requirements.\"\"\"\n    audit = verifier.audit_provider(provider_id)\n\n    checks = {\n        \"min_signals\": audit[\"total_reveals\"] >= 30,\n        \"min_verification_rate\": audit[\"verification_rate\"] >= 90.0,\n        \"min_chain_count\": audit[\"chain_count\"] >= 4,\n        \"has_trust_score\": audit[\"trust_score\"] is not None,\n        \"not_test_account\": not any(\n            provider_id.startswith(prefix)\n            for prefix in (\"test-\", \"perf-\", \"audit-\", \"stress-\")\n        ),\n    }\n\n    return {\n        \"provider_id\": provider_id,\n        \"eligible\": all(checks.values()),\n        \"checks\": checks,\n        \"audit\": audit,\n    }\n```\n\n### Embedding Verified Performance in Listings\n\nWhen a provider lists their signal service on a marketplace, their GreenHelix verification data serves as the credential. The listing includes the agent ID, latest claim chain root hash, and a link to the verification endpoint. Any potential subscriber can independently verify every claim.\n\n```python\ndef build_listing_data(client, publisher: SignalPublisher,\n                        tracker: PerformanceTracker) -> dict:\n    \"\"\"Build a marketplace listing with verified performance data.\"\"\"\n    reputation = client._execute(\"get_agent_reputation\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    chains = client._execute(\"get_claim_chains\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    claims = client._execute(\"get_verified_claims\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    stats = tracker.compute_stats()\n    rolling = tracker.get_rolling()\n\n    latest_chain = None\n    if chains.get(\"chains\"):\n        latest_chain = chains[\"chains\"][-1]\n\n    return {\n        \"provider_id\": publisher.agent_id,\n        \"trust_score\": reputation.get(\"score\"),\n        \"verified_performance\": {\n            \"hit_rate\": stats[\"hit_rate\"],\n            \"avg_return\": stats[\"avg_return\"],\n            \"risk_reward_ratio\": stats[\"risk_reward_ratio\"],\n            \"total_signals\": stats[\"total_signals\"],\n            \"rolling_7d_hit_rate\": rolling[\"7d\"][\"hit_rate\"],\n            \"rolling_30d_hit_rate\": rolling[\"30d\"][\"hit_rate\"],\n            \"rolling_90d_hit_rate\": rolling[\"90d\"][\"hit_rate\"],\n        },\n        \"claim_chain_root\": (\n            latest_chain[\"root_hash\"] if latest_chain else None\n        ),\n        \"claim_chain_depth\": len(chains.get(\"chains\", [])),\n        \"verification_endpoint\": (\n            f\"https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1\"\n        ),\n        \"verification_instructions\": (\n            f\"POST to the verification endpoint with tool \"\n            f\"'get_verified_claims' and input \"\n            f'{{\"agent_id\": \"{publisher.agent_id}\"}} '\n            f\"to independently verify all performance claims.\"\n        ),\n    }\n```\n\nWith curl, a potential subscriber verifies a listing:\n\n```bash\n# Step 1: Check the provider's trust score\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_reputation\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 2: Verify their claim chains\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_claim_chains\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 3: Get all verified claims\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_verified_claims\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 4: Search for this provider's metrics directly\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"hit_rate\",\n      \"min_value\": 0,\n      \"max_value\": 100\n    }\n  }'\n```\n\n### The Complete Discovery Workflow\n\nA subscriber evaluating signal providers should follow this five-step process:\n\n1. **Search by primary metric.** Use `search_agents_by_metrics` to find providers exceeding a minimum hit rate or risk\u002Freward ratio. This narrows the candidate pool from hundreds to a manageable shortlist.\n\n2. **Filter by sample size.** From the search results, discard any provider with fewer than 50 verified signals. Small sample sizes produce unreliable statistics. A provider with 8 signals and 87.5% accuracy has not proven anything.\n\n3. **Audit each candidate.** Run `audit_provider()` against each remaining candidate. Check the verification rate (should be 95%+), chain count (should be 4+), and trust score (should be 70+).\n\n4. **Check rolling trends.** Use `get_metric_averages` to compare 7-day, 30-day, and 90-day rolling performance. A provider whose 7-day metrics are significantly worse than their 90-day metrics is in decline. A provider whose 7-day metrics are improving relative to 90-day metrics is on an upswing.\n\n5. **Subscribe with escrow.** Once a provider passes all checks, create an escrow-linked subscription with conservative criteria. Set the hit rate threshold 5-10 percentage points below the provider's verified 90-day average to account for normal variance.\n\n```python\ndef full_discovery_pipeline(client, verifier, min_hit_rate=55.0,\n                             min_signals=50, min_trust_score=70):\n    \"\"\"End-to-end provider discovery and ranking.\"\"\"\n    # Step 1: Search\n    candidates = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"hit_rate\",\n        \"min_value\": min_hit_rate,\n        \"max_value\": 100.0,\n    })\n\n    qualified = []\n    for agent in candidates.get(\"agents\", []):\n        agent_id = agent[\"agent_id\"]\n\n        # Step 2: Filter by sample size\n        if agent.get(\"value\", 0) \u003C min_signals:\n            continue\n\n        # Step 3: Audit\n        audit = verifier.audit_provider(agent_id)\n        if audit[\"verification_rate\"] \u003C 90.0:\n            continue\n        if audit.get(\"trust_score\", 0) \u003C min_trust_score:\n            continue\n\n        qualified.append({\n            \"agent_id\": agent_id,\n            \"hit_rate\": audit[\"hit_rate\"],\n            \"total_signals\": audit[\"total_reveals\"],\n            \"trust_score\": audit[\"trust_score\"],\n            \"verification_rate\": audit[\"verification_rate\"],\n        })\n\n    # Sort by trust score\n    qualified.sort(key=lambda p: p[\"trust_score\"], reverse=True)\n    return qualified\n```\n\nThe listing data, combined with independent verification, creates a trust flywheel: better verified performance attracts more subscribers, more subscribers generate more revenue, more revenue funds better signal generation, better signals produce better verified performance. Providers who cannot survive this feedback loop are exactly the providers who should not be selling signals.\n\n---\n\n## What's Next\n\nThis guide covered the complete signal verification lifecycle: cryptographic commitment, independent verification, performance computation, escrow-linked payment, rolling monitoring, dispute resolution, and leaderboard discovery. Three companion guides extend this into adjacent domains:\n\n- **Verified Trading Bot Reputation** -- how to build an unforgeable PnL proof for your trading bot using the same Ed25519 and Merkle chain infrastructure covered here, applied to automated trading rather than discrete signals.\n- **Strategy Marketplace Playbook** -- how to list verified trading strategies as paid services with escrow-protected subscriptions, pricing tiers, and marketplace discovery.\n- **Agent Dispute Resolution & Chargeback Defense** -- deep dive into the dispute resolution framework, including card network chargeback defense for agent-initiated transactions.\n\nFull API reference and additional examples are available in the GreenHelix documentation at https:\u002F\u002Fapi.greenhelix.net\u002Fdocs.\n\n---\n\n*Price: $99 | Format: Digital Guide | Updates: Lifetime access to revisions*\n\n","# Signal Verification Network: Cryptographic Proof for Trading Signals\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> - `AGENT_SIGNING_KEY`: Cryptographic signing key for agent identity (Ed25519 key pair for request signing)\n\n\nSignal providers charge $39-400 per month with zero accountability. No proof that signals were issued before price moves. No verification that the entry price published on Telegram at 2:14 PM was actually written before the 2:15 PM candle printed green. Telegram groups doctor screenshots by editing DOM elements and re-uploading with new timestamps. Discord bots synthesize equity curves from cherry-picked trades. Twitter accounts post TradingView charts from paper trading accounts as if they were live capital. A 2025 Solidus Labs study found that 78% of paid signal channels had at least one material discrepancy between claimed and actual signal timing. The $2.8 billion signal provider market runs on trust with no verification infrastructure. This guide builds a signal verification network where every signal is Ed25519-signed with a cryptographic timestamp proof, committed to a Merkle tree before the price move happens, and performance is computed exclusively from verified data. Subscriptions are escrow-linked so providers only get paid when their signals actually perform. Every pattern runs on the GreenHelix A2A Commerce Gateway API. Every code example is production-ready. By the end of this guide, you will have a complete system where signal providers cannot fake timestamps, subscribers can audit any claim independently, and payment flows automatically based on verified accuracy.\n1. [The Signal Trust Crisis](#chapter-1-the-signal-trust-crisis)\n2. [The SignalPublisher Class](#chapter-2-the-signalpublisher-class)\n\n## What You'll Learn\n- Chapter 1: The Signal Trust Crisis\n- Chapter 2: The SignalPublisher Class\n- Chapter 3: The SignalVerifier Class\n- Chapter 4: Performance Computation\n- Chapter 5: Escrow-Linked Subscriptions\n- Chapter 6: Rolling Accuracy Windows\n- Chapter 7: Dispute Resolution\n- Chapter 8: Leaderboards and Discovery\n- What's Next\n\n## Full Guide\n\n# Signal Verification Network: Cryptographic Proof for Trading Signals\n\nSignal providers charge $39-400 per month with zero accountability. No proof that signals were issued before price moves. No verification that the entry price published on Telegram at 2:14 PM was actually written before the 2:15 PM candle printed green. Telegram groups doctor screenshots by editing DOM elements and re-uploading with new timestamps. Discord bots synthesize equity curves from cherry-picked trades. Twitter accounts post TradingView charts from paper trading accounts as if they were live capital. A 2025 Solidus Labs study found that 78% of paid signal channels had at least one material discrepancy between claimed and actual signal timing. The $2.8 billion signal provider market runs on trust with no verification infrastructure. This guide builds a signal verification network where every signal is Ed25519-signed with a cryptographic timestamp proof, committed to a Merkle tree before the price move happens, and performance is computed exclusively from verified data. Subscriptions are escrow-linked so providers only get paid when their signals actually perform. Every pattern runs on the GreenHelix A2A Commerce Gateway API. Every code example is production-ready. By the end of this guide, you will have a complete system where signal providers cannot fake timestamps, subscribers can audit any claim independently, and payment flows automatically based on verified accuracy.\n\n---\n\n## Table of Contents\n\n1. [The Signal Trust Crisis](#chapter-1-the-signal-trust-crisis)\n2. [The SignalPublisher Class](#chapter-2-the-signalpublisher-class)\n3. [The SignalVerifier Class](#chapter-3-the-signalverifier-class)\n4. [Performance Computation](#chapter-4-performance-computation)\n5. [Escrow-Linked Subscriptions](#chapter-5-escrow-linked-subscriptions)\n6. [Rolling Accuracy Windows](#chapter-6-rolling-accuracy-windows)\n7. [Dispute Resolution](#chapter-7-dispute-resolution)\n8. [Leaderboards and Discovery](#chapter-8-leaderboards-and-discovery)\n\n---\n\n## Chapter 1: The Signal Trust Crisis\n\n### Why Signal Providers Are Unaccountable\n\nThe fundamental problem with trading signals is the absence of a verifiable timeline. A signal provider posts \"BUY ETH at $3,200\" in a Telegram channel. Thirty minutes later, ETH is at $3,280. The provider screenshots the message showing a 2.5% gain. But when was the message actually written? Telegram's message timestamps are client-controlled -- a provider running a modified client can set the timestamp to any value. Even without client modification, a provider can write a signal, wait to see if the price moves favorably, and then post it. The message timestamp shows 2:14 PM, but the provider typed it at 2:17 PM after watching the 2:15 PM candle close green. Nobody can tell the difference.\n\nThis is not a theoretical attack. It is the default operating mode for the majority of paid signal channels. The incentive structure guarantees it. A provider with 500 subscribers at $99\u002Fmonth earns $49,500\u002Fmonth. The marginal cost of posting a signal is zero. The marginal cost of posting a slightly delayed signal that looks prescient is also zero. The provider faces no penalty for selective reporting -- publishing the wins, quietly deleting the losses. Telegram's edit and delete functions leave no public audit trail.\n\nThe same problem scales across every signal distribution medium. Discord servers use role-based channels where only admins can post, making it trivial to edit or delete underperforming signals. Email newsletters can be backdated. Websites can be modified after the fact. Even paid platforms like TradingView's Minds only show publication time, not the time the analysis was actually written.\n\n### Market Size: $2.8B and Growing\n\nThe signal provider market reached $2.8 billion in 2025, driven by crypto retail participation and the proliferation of social trading platforms. Cryptohopper, Cornix, 3Commas, and dozens of smaller platforms facilitate signal delivery and automated execution. But none of them solve the verification problem. They deliver signals faster. They automate execution. They do not prove the signal existed before the price move.\n\nThis creates a market for lemons. Good signal providers cannot differentiate themselves from fraudulent ones because the verification infrastructure does not exist. Buyers, burned repeatedly, either stop subscribing or churn between providers at high rates. The average subscriber lifetime across major signal platforms is 2.3 months, according to Cryptohopper's 2025 transparency report. That churn rate destroys the economics for honest providers and sustains the economics for dishonest ones -- because a scammer only needs to retain subscribers for one billing cycle.\n\n### The Solution: Cryptographic Signal Commitment\n\nThe core insight is borrowed from academic cryptography and blockchain consensus: you can prove you knew something at time T without revealing what you knew until time T+1. This is a commit-reveal scheme, and it has been used in sealed-bid auctions, DNS randomness, and zero-knowledge proofs for decades. Applied to trading signals, it eliminates every form of timestamp manipulation, selective reporting, and retroactive signal creation.\n\nThe solution is a commit-reveal scheme built on Ed25519 signatures and Merkle claim chains. The workflow has three phases:\n\n**Phase 1 -- Commit.** Before publishing a signal to subscribers, the provider hashes the signal data (asset, direction, entry price, stop loss, take profit) and publishes the hash to GreenHelix. This creates a timestamped, tamper-evident commitment. The actual signal content is not revealed -- only its hash. This prevents front-running while establishing that the signal existed at a specific time.\n\n**Phase 2 -- Reveal.** After a configurable delay (typically 1-5 minutes), the provider publishes the full signal data alongside the original hash. Anyone can verify that the revealed signal matches the committed hash. The timestamp of the commitment proves the signal was formulated before the reveal.\n\n**Phase 3 -- Verify.** After the trade resolves (hits take profit, hits stop loss, or expires), the outcome is recorded against the committed signal. Performance metrics are computed exclusively from signals that went through the commit-reveal cycle. Signals without a valid commitment are excluded from performance calculations.\n\n### GreenHelix Tools Used\n\nThis guide uses the following GreenHelix A2A Commerce Gateway tools:\n\n| Tool | Purpose |\n|------|---------|\n| `register_agent` | Register signal provider identity with Ed25519 public key |\n| `verify_agent` | Prove control of private key |\n| `publish_event` | Publish signal commitments and reveals to the event bus |\n| `build_claim_chain` | Build Merkle tree from signal history |\n| `get_claim_chains` | Retrieve claim chains for verification |\n| `get_verified_claims` | Get verified signal claims |\n| `submit_metrics` | Submit aggregate performance metrics |\n| `search_agents_by_metrics` | Discover providers by performance |\n| `create_performance_escrow` | Create escrow-linked subscriptions |\n| `release_escrow` | Release escrow when criteria met |\n| `open_dispute` | File disputes when performance criteria fail |\n| `resolve_dispute` | Resolve disputes with evidence |\n| `register_webhook` | Subscribe to signal events and performance alerts |\n| `get_agent_reputation` | Get trust score |\n| `get_agent_leaderboard` | Get provider rankings |\n\n---\n\n## Chapter 2: The SignalPublisher Class\n\n### Architecture\n\nThe SignalPublisher class handles the provider side of the verification network. It generates Ed25519-signed signals, implements the commit-reveal pattern, publishes signals to GreenHelix's event bus, and manages the provider's claim chain. Every signal passes through three stages: sign, commit, reveal.\n\n### Dependencies\n\n```bash\npip install cryptography requests\n```\n\n### The Complete SignalPublisher Class\n\n```python\nimport base64\nimport hashlib\nimport json\nimport time\nimport uuid\nfrom typing import Optional\n\nimport requests\nfrom cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey\nfrom cryptography.hazmat.primitives import serialization\n\n\nclass SignalPublisher:\n    \"\"\"Publishes cryptographically signed trading signals with commit-reveal.\"\"\"\n\n    def __init__(self, agent_id: str, api_key: str, private_key_b64: str,\n                 base_url: str = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"):\n        self.agent_id = agent_id\n        self.api_key = api_key\n        self.base_url = base_url\n        self.headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application\u002Fjson\",\n        }\n\n        # Load Ed25519 private key\n        key_bytes = base64.b64decode(private_key_b64)\n        self.private_key = Ed25519PrivateKey.from_private_bytes(key_bytes)\n        self.public_key = self.private_key.public_key()\n\n        # In-memory store for pending commits (production: use a database)\n        self._pending_commits: dict[str, dict] = {}\n\n    def _execute(self, tool: str, input_data: dict) -> dict:\n        \"\"\"Execute a tool on the GreenHelix gateway.\"\"\"\n        response = requests.post(\n            f\"{self.base_url}\u002Fv1\",\n            headers=self.headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        response.raise_for_status()\n        return response.json()\n\n    def _sign(self, data: str) -> str:\n        \"\"\"Sign a string with Ed25519, return base64 signature.\"\"\"\n        signature = self.private_key.sign(data.encode(\"utf-8\"))\n        return base64.b64encode(signature).decode()\n\n    def _public_key_b64(self) -> str:\n        \"\"\"Return base64-encoded public key.\"\"\"\n        pub_bytes = self.public_key.public_bytes(\n            encoding=serialization.Encoding.Raw,\n            format=serialization.PublicFormat.Raw,\n        )\n        return base64.b64encode(pub_bytes).decode()\n\n    def register(self, name: str) -> dict:\n        \"\"\"Register this signal provider on GreenHelix.\"\"\"\n        return self._execute(\"register_agent\", {\n            \"agent_id\": self.agent_id,\n            \"public_key\": self._public_key_b64(),\n            \"name\": name,\n        })\n\n    def create_signal(self, asset: str, direction: str, entry_price: float,\n                      stop_loss: float, take_profit: float,\n                      timeframe: str = \"4h\",\n                      notes: str = \"\") -> dict:\n        \"\"\"Create a signed signal object.\n\n        Returns the full signal dict including signature and signal_id.\n        Does NOT publish -- call commit_signal() then reveal_signal().\n        \"\"\"\n        signal_id = str(uuid.uuid4())\n        timestamp = int(time.time())\n\n        signal = {\n            \"signal_id\": signal_id,\n            \"provider_id\": self.agent_id,\n            \"asset\": asset,\n            \"direction\": direction,\n            \"entry_price\": entry_price,\n            \"stop_loss\": stop_loss,\n            \"take_profit\": take_profit,\n            \"timeframe\": timeframe,\n            \"notes\": notes,\n            \"timestamp\": timestamp,\n        }\n\n        # Create canonical JSON for signing\n        canonical = json.dumps(signal, sort_keys=True)\n        signature = self._sign(canonical)\n        signal[\"signature\"] = signature\n\n        return signal\n\n    def commit_signal(self, signal: dict) -> dict:\n        \"\"\"Phase 1: Publish a hash commitment of the signal.\n\n        The signal content is NOT revealed. Only the SHA-256 hash is published.\n        This proves the signal existed at the commitment timestamp.\n        \"\"\"\n        # Create the hash commitment\n        canonical = json.dumps(\n            {k: v for k, v in signal.items() if k != \"signature\"},\n            sort_keys=True,\n        )\n        commitment_hash = hashlib.sha256(canonical.encode(\"utf-8\")).hexdigest()\n\n        # Sign the commitment\n        commitment_payload = json.dumps({\n            \"signal_id\": signal[\"signal_id\"],\n            \"commitment_hash\": commitment_hash,\n            \"provider_id\": self.agent_id,\n            \"timestamp\": int(time.time()),\n        }, sort_keys=True)\n        commitment_signature = self._sign(commitment_payload)\n\n        # Publish commitment to the event bus\n        result = self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_commitment\",\n            \"payload\": {\n                \"signal_id\": signal[\"signal_id\"],\n                \"commitment_hash\": commitment_hash,\n                \"signature\": commitment_signature,\n            },\n        })\n\n        # Store pending commit for later reveal\n        self._pending_commits[signal[\"signal_id\"]] = {\n            \"signal\": signal,\n            \"commitment_hash\": commitment_hash,\n            \"committed_at\": int(time.time()),\n        }\n\n        return {\n            \"signal_id\": signal[\"signal_id\"],\n            \"commitment_hash\": commitment_hash,\n            \"committed_at\": int(time.time()),\n            \"event_result\": result,\n        }\n\n    def reveal_signal(self, signal_id: str) -> dict:\n        \"\"\"Phase 2: Reveal the full signal after the commitment is recorded.\n\n        The reveal publishes the complete signal data so subscribers and\n        verifiers can confirm it matches the previously committed hash.\n        \"\"\"\n        if signal_id not in self._pending_commits:\n            raise ValueError(f\"No pending commit for signal {signal_id}\")\n\n        pending = self._pending_commits[signal_id]\n        signal = pending[\"signal\"]\n\n        # Publish the full signal\n        result = self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_reveal\",\n            \"payload\": {\n                \"signal_id\": signal[\"signal_id\"],\n                \"asset\": signal[\"asset\"],\n                \"direction\": signal[\"direction\"],\n                \"entry_price\": signal[\"entry_price\"],\n                \"stop_loss\": signal[\"stop_loss\"],\n                \"take_profit\": signal[\"take_profit\"],\n                \"timeframe\": signal[\"timeframe\"],\n                \"notes\": signal[\"notes\"],\n                \"timestamp\": signal[\"timestamp\"],\n                \"signature\": signal[\"signature\"],\n                \"commitment_hash\": pending[\"commitment_hash\"],\n            },\n        })\n\n        # Remove from pending\n        del self._pending_commits[signal_id]\n\n        return {\n            \"signal_id\": signal_id,\n            \"revealed_at\": int(time.time()),\n            \"event_result\": result,\n        }\n\n    def publish_signal(self, asset: str, direction: str, entry_price: float,\n                       stop_loss: float, take_profit: float,\n                       timeframe: str = \"4h\", notes: str = \"\",\n                       reveal_delay_seconds: int = 60) -> dict:\n        \"\"\"Convenience method: create, commit, wait, and reveal a signal.\n\n        In production, you would typically separate commit and reveal\n        into different steps with asynchronous scheduling.\n        \"\"\"\n        signal = self.create_signal(\n            asset=asset,\n            direction=direction,\n            entry_price=entry_price,\n            stop_loss=stop_loss,\n            take_profit=take_profit,\n            timeframe=timeframe,\n            notes=notes,\n        )\n\n        commit_result = self.commit_signal(signal)\n\n        # Wait for commitment to propagate\n        time.sleep(reveal_delay_seconds)\n\n        reveal_result = self.reveal_signal(signal[\"signal_id\"])\n\n        return {\n            \"signal\": signal,\n            \"commit\": commit_result,\n            \"reveal\": reveal_result,\n        }\n\n    def record_outcome(self, signal_id: str, outcome: str,\n                       exit_price: float, exit_timestamp: int) -> dict:\n        \"\"\"Record the outcome of a signal (hit_tp, hit_sl, expired).\n\n        This publishes a signed outcome event that links back to the\n        original signal commitment.\n        \"\"\"\n        outcome_data = {\n            \"signal_id\": signal_id,\n            \"provider_id\": self.agent_id,\n            \"outcome\": outcome,\n            \"exit_price\": exit_price,\n            \"exit_timestamp\": exit_timestamp,\n            \"recorded_at\": int(time.time()),\n        }\n\n        canonical = json.dumps(outcome_data, sort_keys=True)\n        signature = self._sign(canonical)\n\n        return self._execute(\"publish_event\", {\n            \"agent_id\": self.agent_id,\n            \"event_type\": \"signal_outcome\",\n            \"payload\": {**outcome_data, \"signature\": signature},\n        })\n\n    def build_claim_chain(self) -> dict:\n        \"\"\"Build a Merkle claim chain from all signal events.\"\"\"\n        return self._execute(\"build_claim_chain\", {\n            \"agent_id\": self.agent_id,\n        })\n\n    def submit_performance_snapshot(self, metrics: dict) -> dict:\n        \"\"\"Submit aggregate performance metrics.\"\"\"\n        return self._execute(\"submit_metrics\", {\n            \"agent_id\": self.agent_id,\n            \"metrics\": metrics,\n        })\n```\n\n### Signal Schema\n\nEvery signal follows a strict schema. This is not optional -- verifiers reject signals that do not conform.\n\n| Field | Type | Description |\n|-------|------|-------------|\n| `signal_id` | string (UUID) | Unique identifier for the signal |\n| `provider_id` | string | Agent ID of the signal provider |\n| `asset` | string | Trading pair, e.g., \"BTC\u002FUSDT\" |\n| `direction` | string | \"long\" or \"short\" |\n| `entry_price` | float | Target entry price |\n| `stop_loss` | float | Stop loss price |\n| `take_profit` | float | Take profit price |\n| `timeframe` | string | Expected trade duration, e.g., \"4h\", \"1d\" |\n| `notes` | string | Optional commentary |\n| `timestamp` | integer | Unix timestamp when signal was created |\n| `signature` | string | Base64-encoded Ed25519 signature |\n\n### The Commit-Reveal Pattern in Detail\n\nThe commit-reveal pattern prevents two attacks. First, it prevents timestamp manipulation. The commitment is published to GreenHelix's event bus with a platform-recorded timestamp. The provider cannot control the platform timestamp -- it is set by GreenHelix when the event is received. Second, it prevents retroactive signal creation. Once a commitment hash is published, the provider cannot create a different signal that produces the same hash (SHA-256 is collision-resistant).\n\nThe reveal step publishes the full signal data and allows anyone to verify that the SHA-256 hash of the revealed signal matches the commitment. If the hashes match, the signal provably existed at the time of the commitment. If they do not match, the signal is invalid.\n\nWith curl, the commit step looks like this:\n\n```bash\n# Commit phase: publish the hash only\nCOMMITMENT_HASH=\"a1b2c3d4e5f6...\"  # SHA-256 of canonical signal JSON\nSIGNATURE_B64=\"base64-encoded-signature\"\n\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"publish_event\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"event_type\": \"signal_commitment\",\n      \"payload\": {\n        \"signal_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"commitment_hash\": \"'\"$COMMITMENT_HASH\"'\",\n        \"signature\": \"'\"$SIGNATURE_B64\"'\"\n      }\n    }\n  }'\n```\n\nAnd the reveal step:\n\n```bash\n# Reveal phase: publish the full signal\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"publish_event\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"event_type\": \"signal_reveal\",\n      \"payload\": {\n        \"signal_id\": \"550e8400-e29b-41d4-a716-446655440000\",\n        \"asset\": \"BTC\u002FUSDT\",\n        \"direction\": \"long\",\n        \"entry_price\": 68450.00,\n        \"stop_loss\": 67200.00,\n        \"take_profit\": 71000.00,\n        \"timeframe\": \"4h\",\n        \"notes\": \"Momentum breakout above 4h resistance\",\n        \"timestamp\": 1712505600,\n        \"signature\": \"'\"$SIGNAL_SIGNATURE_B64\"'\",\n        \"commitment_hash\": \"'\"$COMMITMENT_HASH\"'\"\n      }\n    }\n  }'\n```\n\n### Choosing the Reveal Delay\n\nThe reveal delay is the time between publishing the commitment hash and revealing the full signal. Too short (under 10 seconds) and the commitment and reveal land in the same event bus batch, providing weak proof of pre-existence. Too long (over 10 minutes) and subscribers receive signals too late to execute at the target entry price. The sweet spot for most signal types:\n\n- **Scalping signals (1m-15m timeframe):** 15-30 second delay. Price moves fast, subscribers need the signal quickly. The commitment still creates a verifiable timestamp separation.\n- **Swing signals (1h-4h timeframe):** 60-120 second delay. Adequate time for the commitment to propagate and be independently recorded by subscribers' monitoring systems.\n- **Position signals (1d+ timeframe):** 5-10 minute delay. Entry price is less time-sensitive, so a longer delay provides stronger timestamp proof without meaningful cost to subscribers.\n\nIn all cases, the commitment timestamp is set by GreenHelix when the event is received, not by the provider. The provider cannot manipulate the platform-side timestamp.\n\n### Usage Example\n\n```python\npublisher = SignalPublisher(\n    agent_id=\"signal-provider-momentum-x\",\n    api_key=\"your-api-key\",\n    private_key_b64=\"your-base64-private-key\",\n)\n\n# One-time setup\npublisher.register(\"Momentum-X Crypto Signals\")\n\n# Publish a signal with commit-reveal\nresult = publisher.publish_signal(\n    asset=\"BTC\u002FUSDT\",\n    direction=\"long\",\n    entry_price=68450.00,\n    stop_loss=67200.00,\n    take_profit=71000.00,\n    timeframe=\"4h\",\n    notes=\"Momentum breakout above 4h resistance\",\n    reveal_delay_seconds=60,\n)\n\nsignal_id = result[\"signal\"][\"signal_id\"]\nprint(f\"Signal published: {signal_id}\")\nprint(f\"Commitment hash: {result['commit']['commitment_hash']}\")\n\n# Later, when the trade resolves\npublisher.record_outcome(\n    signal_id=signal_id,\n    outcome=\"hit_tp\",\n    exit_price=71000.00,\n    exit_timestamp=int(time.time()),\n)\n\n# Build Merkle chain weekly\npublisher.build_claim_chain()\n```\n\n### Handling Multiple Signals Per Day\n\nHigh-frequency signal providers may issue 10-20 signals per day. Each signal goes through commit-reveal independently. The `_pending_commits` dictionary holds all uncommitted signals in memory. In production, replace this with a persistent store (Redis, PostgreSQL) to survive process restarts.\n\nFor providers issuing many signals, batch the Merkle chain build. Rather than building after every signal, build once at end-of-day or once per 50 signals. This reduces API calls while maintaining the same cryptographic guarantees -- all signals within the batch are included in the chain.\n\n```python\nimport time\n\n# Track signal count since last chain build\nsignals_since_chain = 0\nCHAIN_BUILD_THRESHOLD = 50\n\ndef on_signal_outcome(publisher, signal_id, outcome, exit_price):\n    global signals_since_chain\n\n    publisher.record_outcome(\n        signal_id=signal_id,\n        outcome=outcome,\n        exit_price=exit_price,\n        exit_timestamp=int(time.time()),\n    )\n    signals_since_chain += 1\n\n    if signals_since_chain >= CHAIN_BUILD_THRESHOLD:\n        publisher.build_claim_chain()\n        signals_since_chain = 0\n        print(\"Merkle chain built after 50 signal outcomes.\")\n```\n\n---\n\n## Chapter 3: The SignalVerifier Class\n\n### Why Buyers Need Independent Verification\n\nA signal provider claims 72% accuracy over 90 days. The provider's website shows a beautiful equity curve and a table of winning trades. Without verification, you are trusting the provider to honestly report their own performance -- the same trust model that has failed for every Telegram signal group, every copy trading platform, and every signal marketplace built to date. The SignalVerifier class lets a subscriber independently verify every signal against the cryptographic record on GreenHelix. No trust required.\n\n### The Complete SignalVerifier Class\n\n```python\nimport base64\nimport hashlib\nimport json\nfrom typing import Optional\n\nimport requests\nfrom cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PublicKey\nfrom cryptography.hazmat.primitives import serialization\n\n\nclass SignalVerifier:\n    \"\"\"Verifies trading signals against cryptographic proofs on GreenHelix.\"\"\"\n\n    def __init__(self, api_key: str,\n                 base_url: str = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"):\n        self.api_key = api_key\n        self.base_url = base_url\n        self.headers = {\n            \"Authorization\": f\"Bearer {api_key}\",\n            \"Content-Type\": \"application\u002Fjson\",\n        }\n        # Cache of provider public keys\n        self._public_keys: dict[str, Ed25519PublicKey] = {}\n\n    def _execute(self, tool: str, input_data: dict) -> dict:\n        \"\"\"Execute a tool on the GreenHelix gateway.\"\"\"\n        response = requests.post(\n            f\"{self.base_url}\u002Fv1\",\n            headers=self.headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        response.raise_for_status()\n        return response.json()\n\n    def _get_public_key(self, provider_id: str) -> Ed25519PublicKey:\n        \"\"\"Fetch and cache a provider's Ed25519 public key.\"\"\"\n        if provider_id not in self._public_keys:\n            result = self._execute(\"get_agent_identity\", {\n                \"agent_id\": provider_id,\n            })\n            pub_bytes = base64.b64decode(result[\"public_key\"])\n            self._public_keys[provider_id] = Ed25519PublicKey.from_public_bytes(\n                pub_bytes\n            )\n        return self._public_keys[provider_id]\n\n    def verify_signal(self, signal: dict) -> dict:\n        \"\"\"Verify a signal's Ed25519 signature against the provider's key.\n\n        Returns a dict with verification status and details.\n        \"\"\"\n        provider_id = signal[\"provider_id\"]\n        signature_b64 = signal.get(\"signature\")\n\n        if not signature_b64:\n            return {\"verified\": False, \"reason\": \"no_signature\"}\n\n        # Reconstruct canonical JSON (exclude signature from signed data)\n        signal_data = {k: v for k, v in signal.items() if k != \"signature\"}\n        canonical = json.dumps(signal_data, sort_keys=True)\n\n        try:\n            public_key = self._get_public_key(provider_id)\n            signature_bytes = base64.b64decode(signature_b64)\n            public_key.verify(signature_bytes, canonical.encode(\"utf-8\"))\n            return {\n                \"verified\": True,\n                \"provider_id\": provider_id,\n                \"signal_id\": signal.get(\"signal_id\"),\n            }\n        except Exception as e:\n            return {\n                \"verified\": False,\n                \"reason\": \"invalid_signature\",\n                \"error\": str(e),\n            }\n\n    def check_timestamp_proof(self, signal_id: str,\n                              provider_id: str) -> dict:\n        \"\"\"Verify that a signal commitment was recorded before the reveal.\n\n        Checks the GreenHelix event bus for the commitment and reveal events,\n        and verifies that:\n        1. A commitment event exists with a valid hash.\n        2. The reveal event's content matches the commitment hash.\n        3. The commitment timestamp precedes the reveal timestamp.\n        \"\"\"\n        # Fetch the provider's claim chains\n        chains = self._execute(\"get_claim_chains\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Fetch verified claims for this provider\n        claims = self._execute(\"get_verified_claims\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Look for commitment and reveal events\n        commitment_event = None\n        reveal_event = None\n\n        for claim in claims.get(\"claims\", []):\n            payload = claim.get(\"payload\", {})\n            if (payload.get(\"signal_id\") == signal_id\n                    and claim.get(\"event_type\") == \"signal_commitment\"):\n                commitment_event = claim\n            elif (payload.get(\"signal_id\") == signal_id\n                    and claim.get(\"event_type\") == \"signal_reveal\"):\n                reveal_event = claim\n\n        if not commitment_event:\n            return {\n                \"valid\": False,\n                \"reason\": \"no_commitment_found\",\n                \"signal_id\": signal_id,\n            }\n\n        if not reveal_event:\n            return {\n                \"valid\": False,\n                \"reason\": \"no_reveal_found\",\n                \"signal_id\": signal_id,\n            }\n\n        # Verify commitment hash matches reveal content\n        reveal_payload = reveal_event.get(\"payload\", {})\n        signal_data = {\n            \"signal_id\": reveal_payload.get(\"signal_id\"),\n            \"provider_id\": provider_id,\n            \"asset\": reveal_payload.get(\"asset\"),\n            \"direction\": reveal_payload.get(\"direction\"),\n            \"entry_price\": reveal_payload.get(\"entry_price\"),\n            \"stop_loss\": reveal_payload.get(\"stop_loss\"),\n            \"take_profit\": reveal_payload.get(\"take_profit\"),\n            \"timeframe\": reveal_payload.get(\"timeframe\"),\n            \"notes\": reveal_payload.get(\"notes\", \"\"),\n            \"timestamp\": reveal_payload.get(\"timestamp\"),\n        }\n        canonical = json.dumps(signal_data, sort_keys=True)\n        computed_hash = hashlib.sha256(canonical.encode(\"utf-8\")).hexdigest()\n\n        commitment_hash = commitment_event[\"payload\"].get(\"commitment_hash\")\n        hashes_match = computed_hash == commitment_hash\n\n        # Verify timing: commitment before reveal\n        commit_time = commitment_event.get(\"recorded_at\", 0)\n        reveal_time = reveal_event.get(\"recorded_at\", 0)\n        timing_valid = commit_time \u003C reveal_time\n\n        return {\n            \"valid\": hashes_match and timing_valid,\n            \"signal_id\": signal_id,\n            \"hashes_match\": hashes_match,\n            \"commitment_hash\": commitment_hash,\n            \"computed_hash\": computed_hash,\n            \"commitment_time\": commit_time,\n            \"reveal_time\": reveal_time,\n            \"timing_valid\": timing_valid,\n        }\n\n    def audit_provider(self, provider_id: str) -> dict:\n        \"\"\"Run a full audit of a signal provider.\n\n        Checks claim chain integrity, signal count, verification rate,\n        and performance metrics.\n        \"\"\"\n        # Get claim chains\n        chains = self._execute(\"get_claim_chains\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Get verified claims\n        claims = self._execute(\"get_verified_claims\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Get reputation\n        reputation = self._execute(\"get_agent_reputation\", {\n            \"agent_id\": provider_id,\n        })\n\n        # Count signal types\n        commitments = []\n        reveals = []\n        outcomes = []\n\n        for claim in claims.get(\"claims\", []):\n            event_type = claim.get(\"event_type\", \"\")\n            if event_type == \"signal_commitment\":\n                commitments.append(claim)\n            elif event_type == \"signal_reveal\":\n                reveals.append(claim)\n            elif event_type == \"signal_outcome\":\n                outcomes.append(claim)\n\n        # Calculate verification rate\n        total_signals = len(reveals)\n        verified_signals = 0\n        for reveal in reveals:\n            signal_id = reveal.get(\"payload\", {}).get(\"signal_id\")\n            proof = self.check_timestamp_proof(signal_id, provider_id)\n            if proof[\"valid\"]:\n                verified_signals += 1\n\n        verification_rate = (\n            verified_signals \u002F total_signals if total_signals > 0 else 0.0\n        )\n\n        # Calculate outcome stats\n        wins = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"hit_tp\"\n        )\n        losses = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"hit_sl\"\n        )\n        expired = sum(\n            1 for o in outcomes\n            if o.get(\"payload\", {}).get(\"outcome\") == \"expired\"\n        )\n\n        return {\n            \"provider_id\": provider_id,\n            \"trust_score\": reputation.get(\"score\"),\n            \"chain_count\": len(chains.get(\"chains\", [])),\n            \"total_commitments\": len(commitments),\n            \"total_reveals\": total_signals,\n            \"total_outcomes\": len(outcomes),\n            \"verified_signals\": verified_signals,\n            \"verification_rate\": round(verification_rate * 100, 1),\n            \"wins\": wins,\n            \"losses\": losses,\n            \"expired\": expired,\n            \"hit_rate\": round(\n                wins \u002F (wins + losses) * 100, 1\n            ) if (wins + losses) > 0 else 0.0,\n        }\n```\n\n### Verifying a Single Signal\n\nWith curl, you can manually verify a signal by fetching the provider's public key and checking the commitment:\n\n```bash\n# Step 1: Get the provider's public key\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_identity\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 2: Get their verified claims\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_verified_claims\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 3: Get their claim chains to verify Merkle integrity\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_claim_chains\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n```\n\n### Running a Full Provider Audit\n\n```python\nverifier = SignalVerifier(api_key=\"your-api-key\")\n\n# Audit a provider before subscribing\naudit = verifier.audit_provider(\"signal-provider-momentum-x\")\nprint(f\"Provider: {audit['provider_id']}\")\nprint(f\"Trust score: {audit['trust_score']}\")\nprint(f\"Total signals: {audit['total_reveals']}\")\nprint(f\"Verification rate: {audit['verification_rate']}%\")\nprint(f\"Hit rate: {audit['hit_rate']}%\")\nprint(f\"Wins: {audit['wins']}, Losses: {audit['losses']}, Expired: {audit['expired']}\")\nprint(f\"Claim chains: {audit['chain_count']}\")\n\n# Decision logic\nif (audit[\"verification_rate\"] >= 95.0\n        and audit[\"total_reveals\"] >= 50\n        and audit[\"hit_rate\"] >= 55.0\n        and audit[\"trust_score\"] >= 70):\n    print(\"Provider passes audit. Safe to subscribe.\")\nelse:\n    print(\"Provider does not meet criteria. Do not subscribe.\")\n```\n\n### What Verification Catches\n\nThe SignalVerifier detects four categories of fraud:\n\n1. **Backdated signals.** If the commitment timestamp postdates the price move, `check_timestamp_proof` returns `timing_valid: false`. The provider created the signal after the move happened.\n\n2. **Altered signals.** If the revealed signal does not match the committed hash, `check_timestamp_proof` returns `hashes_match: false`. The provider changed the signal between commitment and reveal.\n\n3. **Missing commitments.** If a revealed signal has no corresponding commitment, `check_timestamp_proof` returns `no_commitment_found`. The provider skipped the commit phase entirely -- possibly because they only commit signals they expect to win.\n\n4. **Forged signatures.** If the signature does not verify against the provider's registered public key, `verify_signal` returns `verified: false`. Someone other than the registered provider created or tampered with the signal.\n\n---\n\n## Chapter 4: Performance Computation\n\n### Why Self-Reported Metrics Are Worthless\n\nA signal provider reports 78% accuracy. What does that mean? 78% of signals hit take profit? 78% of signals were profitable at any point during their lifetime? 78% of signals that the provider chose to report? Without a rigorous, standardized computation methodology applied to verified data, the number is meaningless. The PerformanceTracker class computes metrics exclusively from signals that passed the commit-reveal verification process. Self-reported numbers are excluded entirely.\n\n### The PerformanceTracker Class\n\n```python\nimport time\nfrom dataclasses import dataclass, field\nfrom typing import Optional\n\n\n@dataclass\nclass SignalOutcome:\n    \"\"\"A verified signal outcome.\"\"\"\n    signal_id: str\n    provider_id: str\n    asset: str\n    direction: str\n    entry_price: float\n    stop_loss: float\n    take_profit: float\n    exit_price: float\n    outcome: str  # \"hit_tp\", \"hit_sl\", \"expired\"\n    signal_timestamp: int\n    exit_timestamp: int\n    verified: bool = False\n\n\nclass PerformanceTracker:\n    \"\"\"Computes performance metrics from verified signal outcomes.\"\"\"\n\n    def __init__(self):\n        self._outcomes: list[SignalOutcome] = []\n\n    def record_outcome(self, outcome: SignalOutcome) -> None:\n        \"\"\"Record a verified signal outcome.\"\"\"\n        if not outcome.verified:\n            raise ValueError(\n                f\"Signal {outcome.signal_id} is not verified. \"\n                \"Only verified signals can be recorded.\"\n            )\n        self._outcomes.append(outcome)\n\n    def _filter_by_window(self, window_seconds: Optional[int] = None\n                          ) -> list[SignalOutcome]:\n        \"\"\"Filter outcomes to those within the given time window.\"\"\"\n        if window_seconds is None:\n            return list(self._outcomes)\n        cutoff = int(time.time()) - window_seconds\n        return [o for o in self._outcomes if o.exit_timestamp >= cutoff]\n\n    def compute_stats(self, window_seconds: Optional[int] = None) -> dict:\n        \"\"\"Compute performance statistics.\n\n        Args:\n            window_seconds: If provided, only consider outcomes within\n                this many seconds of now. None means all time.\n\n        Returns:\n            Dict with hit_rate, avg_return, risk_reward_ratio,\n            max_consecutive_losses, total_signals, wins, losses.\n        \"\"\"\n        outcomes = self._filter_by_window(window_seconds)\n\n        if not outcomes:\n            return {\n                \"hit_rate\": 0.0,\n                \"avg_return\": 0.0,\n                \"risk_reward_ratio\": 0.0,\n                \"max_consecutive_losses\": 0,\n                \"total_signals\": 0,\n                \"wins\": 0,\n                \"losses\": 0,\n            }\n\n        wins = 0\n        losses = 0\n        returns = []\n        consecutive_losses = 0\n        max_consecutive_losses = 0\n        risk_sum = 0.0\n        reward_sum = 0.0\n\n        for o in outcomes:\n            # Compute return percentage\n            if o.direction == \"long\":\n                pct_return = (o.exit_price - o.entry_price) \u002F o.entry_price * 100\n                risk = abs(o.entry_price - o.stop_loss)\n                reward = abs(o.take_profit - o.entry_price)\n            else:  # short\n                pct_return = (o.entry_price - o.exit_price) \u002F o.entry_price * 100\n                risk = abs(o.stop_loss - o.entry_price)\n                reward = abs(o.entry_price - o.take_profit)\n\n            returns.append(pct_return)\n\n            if risk > 0:\n                risk_sum += risk\n                reward_sum += reward\n\n            if o.outcome == \"hit_tp\":\n                wins += 1\n                consecutive_losses = 0\n            elif o.outcome == \"hit_sl\":\n                losses += 1\n                consecutive_losses += 1\n                max_consecutive_losses = max(\n                    max_consecutive_losses, consecutive_losses\n                )\n            else:  # expired\n                consecutive_losses = 0\n\n        total = wins + losses\n        hit_rate = (wins \u002F total * 100) if total > 0 else 0.0\n        avg_return = sum(returns) \u002F len(returns) if returns else 0.0\n        risk_reward = (reward_sum \u002F risk_sum) if risk_sum > 0 else 0.0\n\n        return {\n            \"hit_rate\": round(hit_rate, 2),\n            \"avg_return\": round(avg_return, 4),\n            \"risk_reward_ratio\": round(risk_reward, 2),\n            \"max_consecutive_losses\": max_consecutive_losses,\n            \"total_signals\": len(outcomes),\n            \"wins\": wins,\n            \"losses\": losses,\n        }\n\n    def get_rolling(self) -> dict:\n        \"\"\"Compute rolling window statistics for 7d, 30d, and 90d.\"\"\"\n        return {\n            \"7d\": self.compute_stats(window_seconds=7 * 86400),\n            \"30d\": self.compute_stats(window_seconds=30 * 86400),\n            \"90d\": self.compute_stats(window_seconds=90 * 86400),\n            \"all_time\": self.compute_stats(window_seconds=None),\n        }\n```\n\n### Metrics Definitions\n\n| Metric | Definition | Why It Matters |\n|--------|-----------|----------------|\n| `hit_rate` | Percentage of signals that hit take profit out of all resolved signals (TP + SL) | The most intuitive measure of accuracy. Expired signals are excluded because they neither won nor lost. |\n| `avg_return` | Mean percentage return across all resolved signals, including losses | Captures the magnitude of wins and losses, not just the count. A 60% hit rate with average +0.1% return is worse than 50% with +2.0% average. |\n| `risk_reward_ratio` | Average reward (entry to TP) divided by average risk (entry to SL) | Measures how much the provider risks per unit of potential reward. A ratio above 2.0 means the provider targets gains twice the size of their stop losses. |\n| `max_consecutive_losses` | Longest streak of consecutive losing signals | Critical for risk management. A provider with 65% hit rate but 12 consecutive losses at one point signals high variance that may not suit all subscribers. |\n\n### Accounting for Slippage and Execution Delays\n\nVerified signal accuracy is computed from the signal's stated entry price and the actual outcome. But subscribers executing the signal in real markets face slippage. A signal published at entry price $68,450 may be executed at $68,480 due to order book depth and latency. The PerformanceTracker computes raw metrics from the signal itself. Slippage-adjusted metrics require the subscriber to report their actual execution price.\n\n```python\ndef compute_slippage_adjusted(self, actual_entries: dict[str, float],\n                               window_seconds: Optional[int] = None) -> dict:\n    \"\"\"Compute stats adjusted for actual execution prices.\n\n    Args:\n        actual_entries: Dict mapping signal_id to actual entry price.\n        window_seconds: Time window filter.\n    \"\"\"\n    outcomes = self._filter_by_window(window_seconds)\n    adjusted_returns = []\n\n    for o in outcomes:\n        actual_entry = actual_entries.get(o.signal_id, o.entry_price)\n        if o.direction == \"long\":\n            pct = (o.exit_price - actual_entry) \u002F actual_entry * 100\n        else:\n            pct = (actual_entry - o.exit_price) \u002F actual_entry * 100\n        adjusted_returns.append(pct)\n\n    avg_slippage_adjusted = (\n        sum(adjusted_returns) \u002F len(adjusted_returns)\n        if adjusted_returns else 0.0\n    )\n\n    raw_stats = self.compute_stats(window_seconds)\n    return {\n        **raw_stats,\n        \"avg_return_slippage_adjusted\": round(avg_slippage_adjusted, 4),\n        \"slippage_impact\": round(\n            raw_stats[\"avg_return\"] - avg_slippage_adjusted, 4\n        ),\n    }\n```\n\n### Computing Drawdown From Verified Signals\n\nThe `max_consecutive_losses` metric captures the count of sequential losses, but drawdown in percentage terms requires tracking cumulative loss within a streak. Here is an extension to the PerformanceTracker that computes maximum drawdown as a percentage:\n\n```python\ndef compute_max_drawdown_pct(self, window_seconds: Optional[int] = None\n                              ) -> float:\n    \"\"\"Compute maximum drawdown as cumulative loss percentage\n    during the worst consecutive losing streak.\n\n    Returns the absolute value of the worst drawdown.\n    \"\"\"\n    outcomes = self._filter_by_window(window_seconds)\n    if not outcomes:\n        return 0.0\n\n    max_drawdown = 0.0\n    current_drawdown = 0.0\n\n    for o in outcomes:\n        if o.direction == \"long\":\n            pct = (o.exit_price - o.entry_price) \u002F o.entry_price * 100\n        else:\n            pct = (o.entry_price - o.exit_price) \u002F o.entry_price * 100\n\n        if pct \u003C 0:\n            current_drawdown += abs(pct)\n            max_drawdown = max(max_drawdown, current_drawdown)\n        else:\n            current_drawdown = 0.0\n\n    return round(max_drawdown, 2)\n```\n\nThis metric matters because a provider could have a reasonable hit rate (55%) but size their stop losses so loosely that each loss wipes out three wins. The drawdown percentage captures this behavior in a way that hit rate alone does not.\n\n### Submitting Computed Metrics to GreenHelix\n\nAfter computing performance statistics, submit them as verified metrics so they appear in search results and leaderboards:\n\n```python\ntracker = PerformanceTracker()\n\n# ... record verified outcomes ...\n\nstats = tracker.compute_stats()\nrolling = tracker.get_rolling()\n\n# Submit to GreenHelix\npublisher.submit_performance_snapshot({\n    \"hit_rate\": stats[\"hit_rate\"],\n    \"avg_return\": stats[\"avg_return\"],\n    \"risk_reward_ratio\": stats[\"risk_reward_ratio\"],\n    \"max_consecutive_losses\": stats[\"max_consecutive_losses\"],\n    \"total_signals\": stats[\"total_signals\"],\n    \"rolling_7d_hit_rate\": rolling[\"7d\"][\"hit_rate\"],\n    \"rolling_30d_hit_rate\": rolling[\"30d\"][\"hit_rate\"],\n    \"rolling_90d_hit_rate\": rolling[\"90d\"][\"hit_rate\"],\n})\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"submit_metrics\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\",\n      \"metrics\": {\n        \"hit_rate\": 67.3,\n        \"avg_return\": 1.24,\n        \"risk_reward_ratio\": 2.1,\n        \"max_consecutive_losses\": 4,\n        \"total_signals\": 187,\n        \"rolling_7d_hit_rate\": 71.4,\n        \"rolling_30d_hit_rate\": 68.2,\n        \"rolling_90d_hit_rate\": 67.3\n      }\n    }\n  }'\n```\n\n---\n\n## Chapter 5: Escrow-Linked Subscriptions\n\n### Why Direct Payment Is Broken\n\nTraditional signal subscriptions use direct payment: the subscriber pays $99\u002Fmonth upfront, receives signals for 30 days, and hopes the signals are good. If the signals underperform, the subscriber cancels. The provider has already been paid. There is zero financial alignment between the provider's revenue and the subscriber's outcome. Escrow-linked subscriptions fix this by making payment contingent on verified performance. The subscriber's funds sit in escrow for the evaluation period. If the provider meets the agreed performance criteria, escrow releases automatically. If not, the subscriber can dispute.\n\n### Performance Criteria Design\n\nPerformance criteria must be specific, measurable, and computed from verified data. Vague criteria like \"good performance\" are unenforceable. Here is a well-designed criteria object:\n\n```python\nperformance_criteria = {\n    \"min_hit_rate\": 55.0,          # Minimum hit rate percentage\n    \"min_risk_reward\": 1.5,         # Minimum risk\u002Freward ratio\n    \"max_drawdown\": 15.0,           # Maximum consecutive loss percentage\n    \"min_signal_count\": 15,         # Minimum signals during evaluation period\n    \"evaluation_metric_source\": \"verified_only\",  # Only count verified signals\n}\n```\n\nEach criterion maps to a computable metric:\n\n- **min_hit_rate**: Computed from `PerformanceTracker.compute_stats()[\"hit_rate\"]`\n- **min_risk_reward**: Computed from `PerformanceTracker.compute_stats()[\"risk_reward_ratio\"]`\n- **max_drawdown**: Maximum cumulative loss during any consecutive losing streak\n- **min_signal_count**: Total number of verified signals issued during the evaluation period\n\n### Creating an Escrow-Linked Subscription\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"create_performance_escrow\",\n    \"input\": {\n      \"payer_agent_id\": \"subscriber-bot-001\",\n      \"payee_agent_id\": \"signal-provider-momentum-x\",\n      \"amount\": 99.00,\n      \"currency\": \"USD\",\n      \"performance_criteria\": {\n        \"min_hit_rate\": 55.0,\n        \"min_risk_reward\": 1.5,\n        \"max_drawdown\": 15.0,\n        \"min_signal_count\": 15\n      },\n      \"evaluation_period_days\": 30\n    }\n  }'\n```\n\nWith Python:\n\n```python\ndef create_signal_subscription(client, subscriber_id: str,\n                                provider_id: str, amount: float,\n                                criteria: dict,\n                                evaluation_days: int = 30) -> dict:\n    \"\"\"Create an escrow-linked signal subscription.\n\n    Args:\n        client: GreenHelix API client instance.\n        subscriber_id: The subscribing agent's ID.\n        provider_id: The signal provider's agent ID.\n        amount: Subscription amount in USD.\n        criteria: Performance criteria dict.\n        evaluation_days: Evaluation period in days.\n\n    Returns:\n        Escrow creation result including escrow_id.\n    \"\"\"\n    return client._execute(\"create_performance_escrow\", {\n        \"payer_agent_id\": subscriber_id,\n        \"payee_agent_id\": provider_id,\n        \"amount\": amount,\n        \"currency\": \"USD\",\n        \"performance_criteria\": criteria,\n        \"evaluation_period_days\": evaluation_days,\n    })\n\n\ndef evaluate_subscription(client, verifier: SignalVerifier,\n                           tracker: PerformanceTracker,\n                           escrow_id: str,\n                           provider_id: str,\n                           criteria: dict) -> dict:\n    \"\"\"Evaluate whether a subscription's performance criteria are met.\n\n    Args:\n        client: GreenHelix API client instance.\n        verifier: SignalVerifier for auditing the provider.\n        tracker: PerformanceTracker with recorded outcomes.\n        escrow_id: The escrow to evaluate.\n        provider_id: The signal provider's agent ID.\n        criteria: The performance criteria to check against.\n\n    Returns:\n        Evaluation result with pass\u002Ffail and action taken.\n    \"\"\"\n    # Compute current stats from verified data\n    stats = tracker.compute_stats()\n\n    # Check each criterion\n    checks = {\n        \"hit_rate\": stats[\"hit_rate\"] >= criteria.get(\"min_hit_rate\", 0),\n        \"risk_reward\": (\n            stats[\"risk_reward_ratio\"]\n            >= criteria.get(\"min_risk_reward\", 0)\n        ),\n        \"drawdown\": (\n            stats[\"max_consecutive_losses\"]\n            \u003C= criteria.get(\"max_drawdown\", float(\"inf\"))\n        ),\n        \"signal_count\": (\n            stats[\"total_signals\"]\n            >= criteria.get(\"min_signal_count\", 0)\n        ),\n    }\n\n    all_passed = all(checks.values())\n\n    if all_passed:\n        # Auto-release escrow\n        release_result = client._execute(\"release_escrow\", {\n            \"escrow_id\": escrow_id,\n        })\n        return {\n            \"status\": \"passed\",\n            \"checks\": checks,\n            \"stats\": stats,\n            \"action\": \"escrow_released\",\n            \"release_result\": release_result,\n        }\n    else:\n        # Criteria not met -- subscriber can file dispute\n        failed_checks = {k: v for k, v in checks.items() if not v}\n        return {\n            \"status\": \"failed\",\n            \"checks\": checks,\n            \"failed_checks\": list(failed_checks.keys()),\n            \"stats\": stats,\n            \"action\": \"dispute_recommended\",\n            \"escrow_id\": escrow_id,\n        }\n```\n\n### Usage: Full Subscription Lifecycle\n\n```python\nimport requests\n\nBASE_URL = \"https:\u002F\u002Fapi.greenhelix.net\u002Fv1\"\nAPI_KEY = \"your-api-key\"\n\nheaders = {\n    \"Authorization\": f\"Bearer {API_KEY}\",\n    \"Content-Type\": \"application\u002Fjson\",\n}\n\nclass SimpleClient:\n    def _execute(self, tool, input_data):\n        resp = requests.post(\n            f\"{BASE_URL}\u002Fv1\",\n            headers=headers,\n            json={\"tool\": tool, \"input\": input_data},\n        )\n        resp.raise_for_status()\n        return resp.json()\n\nclient = SimpleClient()\nverifier = SignalVerifier(api_key=API_KEY)\ntracker = PerformanceTracker()\n\n# Subscriber creates escrow-linked subscription\ncriteria = {\n    \"min_hit_rate\": 55.0,\n    \"min_risk_reward\": 1.5,\n    \"max_drawdown\": 15.0,\n    \"min_signal_count\": 15,\n}\n\nescrow = create_signal_subscription(\n    client=client,\n    subscriber_id=\"subscriber-bot-001\",\n    provider_id=\"signal-provider-momentum-x\",\n    amount=99.00,\n    criteria=criteria,\n    evaluation_days=30,\n)\nescrow_id = escrow[\"escrow_id\"]\nprint(f\"Subscription created. Escrow ID: {escrow_id}\")\n\n# ... 30 days pass, signals are issued and verified ...\n# ... tracker has recorded all verified outcomes ...\n\n# Evaluate at end of period\nresult = evaluate_subscription(\n    client=client,\n    verifier=verifier,\n    tracker=tracker,\n    escrow_id=escrow_id,\n    provider_id=\"signal-provider-momentum-x\",\n    criteria=criteria,\n)\n\nif result[\"status\"] == \"passed\":\n    print(f\"Performance criteria met. Escrow released.\")\n    print(f\"Stats: {result['stats']}\")\nelse:\n    print(f\"Performance criteria NOT met.\")\n    print(f\"Failed checks: {result['failed_checks']}\")\n    print(f\"Recommend filing dispute on escrow {escrow_id}\")\n```\n\n### Setting Conservative Criteria\n\nThe most common mistake subscribers make is setting unrealistically tight criteria. A min_hit_rate of 70% sounds reasonable, but over a 30-day window with 20 signals, normal variance can produce a 55% hit rate even from a genuinely 65% accurate provider. Set criteria at the lower bound of what is acceptable, not the average of what the provider has historically delivered. Leave a margin for variance. A provider with a 67% verified 90-day hit rate should be evaluated against a 55% minimum for a 30-day escrow window.\n\n---\n\n## Chapter 6: Rolling Accuracy Windows\n\n### Why Point-in-Time Evaluation Is Insufficient\n\nEvaluating a signal provider only at the end of a subscription period misses dangerous patterns. A provider could deliver 80% accuracy for the first 25 days and then issue 10 reckless signals in the final 5 days. The period-end evaluation might still show 58% overall accuracy -- barely passing the criterion -- while the subscriber suffered a severe drawdown in the final week. Rolling accuracy windows provide continuous evaluation, catching performance degradation as it happens rather than after the damage is done.\n\n### The RollingAccuracyMonitor Class\n\n```python\nimport time\nfrom typing import Callable, Optional\n\n\nclass RollingAccuracyMonitor:\n    \"\"\"Monitors signal provider accuracy with sliding windows.\n\n    Triggers alerts when performance degrades below thresholds\n    within any rolling window.\n    \"\"\"\n\n    def __init__(self, provider_id: str, tracker: PerformanceTracker,\n                 alert_callback: Optional[Callable[[dict], None]] = None):\n        self.provider_id = provider_id\n        self.tracker = tracker\n        self.alert_callback = alert_callback or self._default_alert\n\n        # Alert thresholds for each window\n        self.thresholds = {\n            \"7d\": {\n                \"min_hit_rate\": 40.0,\n                \"max_consecutive_losses\": 6,\n            },\n            \"30d\": {\n                \"min_hit_rate\": 50.0,\n                \"max_consecutive_losses\": 8,\n            },\n            \"90d\": {\n                \"min_hit_rate\": 55.0,\n                \"max_consecutive_losses\": 10,\n            },\n        }\n\n    def _default_alert(self, alert: dict) -> None:\n        \"\"\"Default alert handler: print to stdout.\"\"\"\n        print(f\"ALERT [{alert['severity']}]: {alert['message']}\")\n\n    def set_thresholds(self, window: str, min_hit_rate: float = None,\n                       max_consecutive_losses: int = None) -> None:\n        \"\"\"Update alert thresholds for a specific window.\"\"\"\n        if window not in self.thresholds:\n            self.thresholds[window] = {}\n        if min_hit_rate is not None:\n            self.thresholds[window][\"min_hit_rate\"] = min_hit_rate\n        if max_consecutive_losses is not None:\n            self.thresholds[window][\"max_consecutive_losses\"] = (\n                max_consecutive_losses\n            )\n\n    def check(self) -> dict:\n        \"\"\"Run a full check across all rolling windows.\n\n        Returns a dict with the status for each window and any\n        triggered alerts.\n        \"\"\"\n        rolling = self.tracker.get_rolling()\n        alerts = []\n        window_status = {}\n\n        for window_name, window_config in self.thresholds.items():\n            stats = rolling.get(window_name, {})\n            if not stats or stats.get(\"total_signals\", 0) == 0:\n                window_status[window_name] = \"insufficient_data\"\n                continue\n\n            violations = []\n\n            # Check hit rate\n            min_hr = window_config.get(\"min_hit_rate\")\n            if min_hr is not None and stats[\"hit_rate\"] \u003C min_hr:\n                violations.append({\n                    \"metric\": \"hit_rate\",\n                    \"threshold\": min_hr,\n                    \"actual\": stats[\"hit_rate\"],\n                })\n\n            # Check consecutive losses\n            max_cl = window_config.get(\"max_consecutive_losses\")\n            if (max_cl is not None\n                    and stats[\"max_consecutive_losses\"] > max_cl):\n                violations.append({\n                    \"metric\": \"max_consecutive_losses\",\n                    \"threshold\": max_cl,\n                    \"actual\": stats[\"max_consecutive_losses\"],\n                })\n\n            if violations:\n                severity = \"critical\" if window_name == \"7d\" else \"warning\"\n                alert = {\n                    \"provider_id\": self.provider_id,\n                    \"window\": window_name,\n                    \"severity\": severity,\n                    \"violations\": violations,\n                    \"stats\": stats,\n                    \"timestamp\": int(time.time()),\n                    \"message\": (\n                        f\"Provider {self.provider_id} violated \"\n                        f\"{len(violations)} threshold(s) in \"\n                        f\"{window_name} window: \"\n                        + \", \".join(\n                            f\"{v['metric']}={v['actual']} \"\n                            f\"(threshold: {v['threshold']})\"\n                            for v in violations\n                        )\n                    ),\n                }\n                alerts.append(alert)\n                self.alert_callback(alert)\n                window_status[window_name] = \"degraded\"\n            else:\n                window_status[window_name] = \"healthy\"\n\n        return {\n            \"provider_id\": self.provider_id,\n            \"checked_at\": int(time.time()),\n            \"window_status\": window_status,\n            \"alerts\": alerts,\n            \"rolling_stats\": rolling,\n        }\n```\n\n### Subscriber Notification via Webhooks\n\nWhen the rolling monitor detects degradation, notify subscribers automatically using GreenHelix webhooks:\n\n```python\ndef setup_webhook_alerts(client, subscriber_id: str,\n                          provider_id: str,\n                          webhook_url: str) -> dict:\n    \"\"\"Register a webhook to receive performance alerts.\n\n    The webhook fires when the rolling accuracy monitor detects\n    threshold violations for the given provider.\n    \"\"\"\n    return client._execute(\"register_webhook\", {\n        \"agent_id\": subscriber_id,\n        \"event_type\": \"performance_alert\",\n        \"filter\": {\"provider_id\": provider_id},\n        \"url\": webhook_url,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"register_webhook\",\n    \"input\": {\n      \"agent_id\": \"subscriber-bot-001\",\n      \"event_type\": \"performance_alert\",\n      \"filter\": {\"provider_id\": \"signal-provider-momentum-x\"},\n      \"url\": \"https:\u002F\u002Fmy-bot.example.com\u002Fwebhooks\u002Fperformance-alert\"\n    }\n  }'\n```\n\n### Running the Monitor on a Schedule\n\n```python\nimport time\n\nmonitor = RollingAccuracyMonitor(\n    provider_id=\"signal-provider-momentum-x\",\n    tracker=tracker,\n    alert_callback=lambda alert: send_to_slack(alert),\n)\n\n# Customize thresholds\nmonitor.set_thresholds(\"7d\", min_hit_rate=45.0, max_consecutive_losses=5)\nmonitor.set_thresholds(\"30d\", min_hit_rate=52.0)\n\n# Run every hour\nwhile True:\n    result = monitor.check()\n    print(f\"Status: {result['window_status']}\")\n    if result[\"alerts\"]:\n        print(f\"  {len(result['alerts'])} alert(s) fired\")\n    time.sleep(3600)\n```\n\n### Integrating the Monitor With Escrow Evaluation\n\nThe rolling accuracy monitor can trigger early dispute filing rather than waiting for the evaluation period to end. If the 7-day window enters critical status and the 30-day window is also degraded, the subscriber has strong evidence that the provider will not meet the escrow criteria by period end. Filing early preserves the evidence trail and prevents the provider from issuing a burst of favorable signals at the last minute to pull the average up.\n\n```python\ndef check_and_maybe_dispute(monitor: RollingAccuracyMonitor,\n                             client, escrow_id: str,\n                             criteria: dict,\n                             tracker: PerformanceTracker,\n                             verifier: SignalVerifier,\n                             provider_id: str) -> Optional[dict]:\n    \"\"\"Run rolling check and file dispute if situation is irrecoverable.\"\"\"\n    result = monitor.check()\n\n    # Both 7d and 30d degraded = likely irrecoverable\n    ws = result[\"window_status\"]\n    if ws.get(\"7d\") == \"degraded\" and ws.get(\"30d\") == \"degraded\":\n        stats = tracker.compute_stats()\n        # Check if mathematically possible to recover\n        remaining_signals_needed = criteria.get(\"min_signal_count\", 0) - stats[\"total_signals\"]\n        if remaining_signals_needed \u003C 0:\n            remaining_signals_needed = 0\n\n        current_losses = stats[\"losses\"]\n        current_wins = stats[\"wins\"]\n        needed_wins = 0\n        target_hr = criteria.get(\"min_hit_rate\", 0)\n\n        # Would need X consecutive wins to reach target\n        total = current_wins + current_losses\n        if total > 0:\n            needed_total_wins = int(target_hr \u002F 100 * (total + remaining_signals_needed))\n            needed_wins = max(0, needed_total_wins - current_wins)\n\n        if needed_wins > remaining_signals_needed:\n            # Mathematically impossible to recover\n            evidence = build_evidence_package(\n                verifier, tracker, provider_id, escrow_id, criteria\n            )\n            return file_dispute(client, escrow_id, evidence)\n\n    return None\n```\n\n### Early Warning Patterns\n\nThe rolling monitor catches three patterns that period-end evaluation misses:\n\n1. **Sudden degradation.** The 7-day window hits critical threshold while 30-day and 90-day windows are still healthy. This means the provider's recent performance has collapsed even though historical performance was good. The subscriber can prepare to dispute or exit before the full evaluation period ends.\n\n2. **Gradual decline.** The 90-day window is healthy, the 30-day window shows warning, and the 7-day window is critical. Performance is trending down across all timeframes. This pattern often precedes a provider shutting down or pivoting to a different strategy.\n\n3. **Volatility spikes.** The `max_consecutive_losses` threshold fires while hit rate is still acceptable. The provider's win rate is fine on average, but they are experiencing unusual streaks of losses. This can indicate regime change in the underlying market or a breakdown in the provider's signal generation process.\n\n---\n\n## Chapter 7: Dispute Resolution\n\n### When Disputes Happen\n\nA dispute occurs when the evaluation period ends and the provider's verified performance does not meet the escrow criteria. The subscriber's funds remain in escrow. Three outcomes are possible: full refund to the subscriber, partial release to the provider (if some criteria were met), or dismissal (if the subscriber's claim is invalid). The dispute process uses the same cryptographic evidence chain that underpins the entire verification network, making disputes data-driven rather than he-said-she-said.\n\n### Building an Evidence Package\n\nWhen filing a dispute, the subscriber must present evidence. Because all signals went through the commit-reveal process, the evidence is already on-chain and verifiable. The evidence package pulls everything together.\n\n```python\ndef build_evidence_package(verifier: SignalVerifier,\n                            tracker: PerformanceTracker,\n                            provider_id: str,\n                            escrow_id: str,\n                            criteria: dict) -> dict:\n    \"\"\"Build a complete evidence package for a dispute.\n\n    Includes:\n    - Provider audit results\n    - Performance stats vs criteria\n    - Specific failed criteria with evidence\n    - Claim chain references for independent verification\n    \"\"\"\n    audit = verifier.audit_provider(provider_id)\n    stats = tracker.compute_stats()\n    rolling = tracker.get_rolling()\n\n    # Identify specific failures\n    failures = []\n\n    if stats[\"hit_rate\"] \u003C criteria.get(\"min_hit_rate\", 0):\n        failures.append({\n            \"criterion\": \"min_hit_rate\",\n            \"required\": criteria[\"min_hit_rate\"],\n            \"actual\": stats[\"hit_rate\"],\n            \"evidence\": (\n                f\"Verified hit rate of {stats['hit_rate']}% across \"\n                f\"{stats['total_signals']} signals is below the \"\n                f\"required {criteria['min_hit_rate']}%.\"\n            ),\n        })\n\n    if stats[\"risk_reward_ratio\"] \u003C criteria.get(\"min_risk_reward\", 0):\n        failures.append({\n            \"criterion\": \"min_risk_reward\",\n            \"required\": criteria[\"min_risk_reward\"],\n            \"actual\": stats[\"risk_reward_ratio\"],\n            \"evidence\": (\n                f\"Risk\u002Freward ratio of {stats['risk_reward_ratio']} \"\n                f\"is below the required {criteria['min_risk_reward']}.\"\n            ),\n        })\n\n    if stats[\"total_signals\"] \u003C criteria.get(\"min_signal_count\", 0):\n        failures.append({\n            \"criterion\": \"min_signal_count\",\n            \"required\": criteria[\"min_signal_count\"],\n            \"actual\": stats[\"total_signals\"],\n            \"evidence\": (\n                f\"Only {stats['total_signals']} verified signals issued \"\n                f\"during the evaluation period. Minimum required: \"\n                f\"{criteria['min_signal_count']}.\"\n            ),\n        })\n\n    return {\n        \"escrow_id\": escrow_id,\n        \"provider_id\": provider_id,\n        \"audit\": audit,\n        \"performance_stats\": stats,\n        \"rolling_stats\": rolling,\n        \"criteria\": criteria,\n        \"failures\": failures,\n        \"verification_rate\": audit[\"verification_rate\"],\n        \"claim_chain_count\": audit[\"chain_count\"],\n    }\n```\n\n### Filing a Dispute\n\n```python\ndef file_dispute(client, escrow_id: str, evidence: dict) -> dict:\n    \"\"\"File a dispute with an evidence package.\n\n    The evidence is serialized and submitted alongside the dispute\n    so the resolution process has access to verifiable data.\n    \"\"\"\n    reason = (\n        f\"Performance criteria not met. \"\n        f\"{len(evidence['failures'])} criterion\u002Fcriteria failed: \"\n        + \"; \".join(\n            f\"{f['criterion']}: required {f['required']}, \"\n            f\"actual {f['actual']}\"\n            for f in evidence[\"failures\"]\n        )\n    )\n\n    return client._execute(\"open_dispute\", {\n        \"escrow_id\": escrow_id,\n        \"reason\": reason,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"open_dispute\",\n    \"input\": {\n      \"escrow_id\": \"esc_abc123\",\n      \"reason\": \"Performance criteria not met. 2 criteria failed: min_hit_rate: required 55.0, actual 48.2; min_signal_count: required 15, actual 11.\"\n    }\n  }'\n```\n\n### Automated Dispute Filing\n\nThe evaluation function from Chapter 5 already identifies when criteria are not met. Combine it with the evidence builder and dispute filer for fully automated dispute resolution:\n\n```python\ndef auto_evaluate_and_dispute(client, verifier, tracker,\n                               escrow_id: str, provider_id: str,\n                               criteria: dict) -> dict:\n    \"\"\"Evaluate subscription and automatically file dispute if needed.\"\"\"\n    result = evaluate_subscription(\n        client=client,\n        verifier=verifier,\n        tracker=tracker,\n        escrow_id=escrow_id,\n        provider_id=provider_id,\n        criteria=criteria,\n    )\n\n    if result[\"status\"] == \"passed\":\n        return {\"action\": \"escrow_released\", \"result\": result}\n\n    # Build evidence and file dispute\n    evidence = build_evidence_package(\n        verifier=verifier,\n        tracker=tracker,\n        provider_id=provider_id,\n        escrow_id=escrow_id,\n        criteria=criteria,\n    )\n\n    dispute_result = file_dispute(\n        client=client,\n        escrow_id=escrow_id,\n        evidence=evidence,\n    )\n\n    return {\n        \"action\": \"dispute_filed\",\n        \"evidence\": evidence,\n        \"dispute_result\": dispute_result,\n    }\n```\n\n### Resolution Outcomes\n\nDisputes resolve into one of three outcomes:\n\n**Full refund.** The evidence clearly shows the provider failed to meet the criteria. All escrowed funds return to the subscriber. This is the most common outcome when the evidence is backed by verified claim chains -- the data is unambiguous.\n\n**Partial release.** The provider met some but not all criteria, or met them partially. For example, the provider delivered a 53% hit rate against a 55% minimum, but the risk\u002Freward ratio exceeded the target significantly. A partial release acknowledges that the provider delivered meaningful value even if the strict criteria were not met. The split is typically computed proportionally to the criteria that were met.\n\n**Dismissal.** The subscriber's claim is invalid. This happens when the evidence does not support the dispute -- for example, the subscriber computed metrics from unverified signals, or the criteria were ambiguously defined, or the provider's verified data actually meets the criteria. Escrowed funds release to the provider. Dismissals also occur when the subscriber fails to account for the difference between raw signal accuracy and execution accuracy. If the provider's verified signals met the criteria but the subscriber's actual trades did not (due to slippage, late execution, or partial fills), the dispute is against the subscriber's execution, not the provider's signals.\n\n```python\n# Provider responds to a dispute\ndef respond_to_dispute(client, dispute_id: str,\n                        provider_evidence: dict) -> dict:\n    \"\"\"Provider responds to a dispute with counter-evidence.\"\"\"\n    return client._execute(\"resolve_dispute\", {\n        \"dispute_id\": dispute_id,\n        \"resolution\": \"counter_evidence\",\n        \"evidence\": provider_evidence,\n    })\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"resolve_dispute\",\n    \"input\": {\n      \"dispute_id\": \"dsp_xyz789\",\n      \"resolution\": \"full_refund\"\n    }\n  }'\n```\n\n### Why This Works Better Than Traditional Disputes\n\nTraditional signal subscription disputes are subjective. \"The signals were bad\" is not verifiable. \"I lost money\" does not prove the provider was at fault -- the subscriber might have executed poorly. Cryptographic verification removes subjectivity entirely. The evidence package contains: the exact signals issued (with Ed25519 signatures and timestamp proofs), the exact outcomes (verified against market data), the exact performance statistics (computed from verified data), and the exact criteria that were agreed upon at escrow creation. There is nothing to argue about. The data either meets the criteria or it does not.\n\nThis eliminates the two most common problems with traditional dispute resolution in signal services. First, the \"he said, she said\" problem disappears because both parties agreed to the criteria at escrow creation and the metrics are computed from signed, immutable data. Second, the \"selective evidence\" problem disappears because the Merkle claim chain includes all signals, not just the ones either party wants to highlight. A provider cannot present only their winning signals, and a subscriber cannot present only the losses. The chain is complete or it is invalid.\n\n---\n\n## Chapter 8: Leaderboards and Discovery\n\n### Building Signal Provider Leaderboards\n\nThe GreenHelix leaderboard ranks signal providers by composite reputation score, which is computed from verified metrics, claim chain depth, and consistency over time. Unlike self-reported leaderboards where providers game rankings by cherry-picking metrics, the GreenHelix leaderboard is computed exclusively from cryptographically verified data.\n\n```python\ndef get_signal_leaderboard(client) -> list[dict]:\n    \"\"\"Fetch the signal provider leaderboard.\n\n    Returns providers ranked by composite reputation score.\n    Automatically filters out test\u002Faudit\u002Fstress agent IDs.\n    \"\"\"\n    result = client._execute(\"get_agent_leaderboard\", {})\n    return result.get(\"agents\", [])\n```\n\nWith curl:\n\n```bash\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_leaderboard\",\n    \"input\": {}\n  }'\n```\n\n### Searching by Performance Metrics\n\nSubscribers can discover providers by searching for specific performance thresholds. This is where submitting standardized metrics (Chapter 4) pays off -- providers who submit complete metrics appear in more searches.\n\n```python\ndef discover_providers(client, min_hit_rate: float = 55.0,\n                        min_signals: int = 50,\n                        max_drawdown: float = 15.0) -> list[dict]:\n    \"\"\"Discover signal providers meeting minimum criteria.\n\n    Searches by multiple metrics and intersects results.\n    \"\"\"\n    # Search by hit rate\n    hit_rate_results = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"hit_rate\",\n        \"min_value\": min_hit_rate,\n        \"max_value\": 100.0,\n    })\n\n    # Search by signal count\n    signal_count_results = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"total_signals\",\n        \"min_value\": min_signals,\n    })\n\n    # Intersect results\n    hit_rate_ids = {\n        a[\"agent_id\"] for a in hit_rate_results.get(\"agents\", [])\n    }\n    signal_count_ids = {\n        a[\"agent_id\"] for a in signal_count_results.get(\"agents\", [])\n    }\n\n    qualifying_ids = hit_rate_ids & signal_count_ids\n\n    # Get full details for qualifying providers\n    providers = []\n    for agent_id in qualifying_ids:\n        reputation = client._execute(\"get_agent_reputation\", {\n            \"agent_id\": agent_id,\n        })\n        claims = client._execute(\"get_verified_claims\", {\n            \"agent_id\": agent_id,\n        })\n        providers.append({\n            \"agent_id\": agent_id,\n            \"trust_score\": reputation.get(\"score\"),\n            \"claims\": claims,\n        })\n\n    # Sort by trust score descending\n    providers.sort(key=lambda p: p.get(\"trust_score\", 0), reverse=True)\n    return providers\n```\n\nWith curl:\n\n```bash\n# Search for providers with hit rate >= 60%\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"hit_rate\",\n      \"min_value\": 60.0,\n      \"max_value\": 100.0\n    }\n  }'\n\n# Search for providers with >= 100 verified signals\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"total_signals\",\n      \"min_value\": 100\n    }\n  }'\n```\n\n### Anti-Gaming Measures\n\nThree measures prevent providers from gaming the leaderboard:\n\n**Minimum signal count.** Providers with fewer than 30 verified signals are excluded from the leaderboard and from search results. This prevents a provider from issuing 3 lucky signals and claiming 100% accuracy. Thirty signals is the minimum sample size for statistical significance at a 95% confidence level with a 10% margin of error.\n\n**Minimum history.** Providers must have at least 30 days of continuous verified activity (claim chains built at least weekly) to appear in search results. This prevents account churn -- creating new identities to discard bad track records. Building a 30-day verified history has a real cost in time and commitment. A provider who blows up their track record cannot simply create a new agent ID and start fresh with zero history. They must invest another 30 days of consistent, verified signal publishing before they become visible to subscribers again. This asymmetry -- destroying reputation is instant, rebuilding it takes weeks -- creates the correct incentive for providers to manage risk carefully.\n\n**Leaderboard ID filtering.** GreenHelix automatically filters agent IDs prefixed with `test-`, `perf-`, `audit-`, or `stress-` from the leaderboard. This prevents test accounts from polluting rankings. Production signal providers should use descriptive, permanent agent IDs.\n\n```python\ndef validate_provider_for_listing(client, verifier: SignalVerifier,\n                                   provider_id: str) -> dict:\n    \"\"\"Check if a provider meets minimum listing requirements.\"\"\"\n    audit = verifier.audit_provider(provider_id)\n\n    checks = {\n        \"min_signals\": audit[\"total_reveals\"] >= 30,\n        \"min_verification_rate\": audit[\"verification_rate\"] >= 90.0,\n        \"min_chain_count\": audit[\"chain_count\"] >= 4,\n        \"has_trust_score\": audit[\"trust_score\"] is not None,\n        \"not_test_account\": not any(\n            provider_id.startswith(prefix)\n            for prefix in (\"test-\", \"perf-\", \"audit-\", \"stress-\")\n        ),\n    }\n\n    return {\n        \"provider_id\": provider_id,\n        \"eligible\": all(checks.values()),\n        \"checks\": checks,\n        \"audit\": audit,\n    }\n```\n\n### Embedding Verified Performance in Listings\n\nWhen a provider lists their signal service on a marketplace, their GreenHelix verification data serves as the credential. The listing includes the agent ID, latest claim chain root hash, and a link to the verification endpoint. Any potential subscriber can independently verify every claim.\n\n```python\ndef build_listing_data(client, publisher: SignalPublisher,\n                        tracker: PerformanceTracker) -> dict:\n    \"\"\"Build a marketplace listing with verified performance data.\"\"\"\n    reputation = client._execute(\"get_agent_reputation\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    chains = client._execute(\"get_claim_chains\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    claims = client._execute(\"get_verified_claims\", {\n        \"agent_id\": publisher.agent_id,\n    })\n    stats = tracker.compute_stats()\n    rolling = tracker.get_rolling()\n\n    latest_chain = None\n    if chains.get(\"chains\"):\n        latest_chain = chains[\"chains\"][-1]\n\n    return {\n        \"provider_id\": publisher.agent_id,\n        \"trust_score\": reputation.get(\"score\"),\n        \"verified_performance\": {\n            \"hit_rate\": stats[\"hit_rate\"],\n            \"avg_return\": stats[\"avg_return\"],\n            \"risk_reward_ratio\": stats[\"risk_reward_ratio\"],\n            \"total_signals\": stats[\"total_signals\"],\n            \"rolling_7d_hit_rate\": rolling[\"7d\"][\"hit_rate\"],\n            \"rolling_30d_hit_rate\": rolling[\"30d\"][\"hit_rate\"],\n            \"rolling_90d_hit_rate\": rolling[\"90d\"][\"hit_rate\"],\n        },\n        \"claim_chain_root\": (\n            latest_chain[\"root_hash\"] if latest_chain else None\n        ),\n        \"claim_chain_depth\": len(chains.get(\"chains\", [])),\n        \"verification_endpoint\": (\n            f\"https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1\"\n        ),\n        \"verification_instructions\": (\n            f\"POST to the verification endpoint with tool \"\n            f\"'get_verified_claims' and input \"\n            f'{{\"agent_id\": \"{publisher.agent_id}\"}} '\n            f\"to independently verify all performance claims.\"\n        ),\n    }\n```\n\nWith curl, a potential subscriber verifies a listing:\n\n```bash\n# Step 1: Check the provider's trust score\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_agent_reputation\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 2: Verify their claim chains\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_claim_chains\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 3: Get all verified claims\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"get_verified_claims\",\n    \"input\": {\n      \"agent_id\": \"signal-provider-momentum-x\"\n    }\n  }'\n\n# Step 4: Search for this provider's metrics directly\ncurl -s -X POST https:\u002F\u002Fsandbox.greenhelix.net\u002Fv1 \\\n  -H \"Authorization: Bearer $API_KEY\" \\\n  -H \"Content-Type: application\u002Fjson\" \\\n  -d '{\n    \"tool\": \"search_agents_by_metrics\",\n    \"input\": {\n      \"metric_name\": \"hit_rate\",\n      \"min_value\": 0,\n      \"max_value\": 100\n    }\n  }'\n```\n\n### The Complete Discovery Workflow\n\nA subscriber evaluating signal providers should follow this five-step process:\n\n1. **Search by primary metric.** Use `search_agents_by_metrics` to find providers exceeding a minimum hit rate or risk\u002Freward ratio. This narrows the candidate pool from hundreds to a manageable shortlist.\n\n2. **Filter by sample size.** From the search results, discard any provider with fewer than 50 verified signals. Small sample sizes produce unreliable statistics. A provider with 8 signals and 87.5% accuracy has not proven anything.\n\n3. **Audit each candidate.** Run `audit_provider()` against each remaining candidate. Check the verification rate (should be 95%+), chain count (should be 4+), and trust score (should be 70+).\n\n4. **Check rolling trends.** Use `get_metric_averages` to compare 7-day, 30-day, and 90-day rolling performance. A provider whose 7-day metrics are significantly worse than their 90-day metrics is in decline. A provider whose 7-day metrics are improving relative to 90-day metrics is on an upswing.\n\n5. **Subscribe with escrow.** Once a provider passes all checks, create an escrow-linked subscription with conservative criteria. Set the hit rate threshold 5-10 percentage points below the provider's verified 90-day average to account for normal variance.\n\n```python\ndef full_discovery_pipeline(client, verifier, min_hit_rate=55.0,\n                             min_signals=50, min_trust_score=70):\n    \"\"\"End-to-end provider discovery and ranking.\"\"\"\n    # Step 1: Search\n    candidates = client._execute(\"search_agents_by_metrics\", {\n        \"metric_name\": \"hit_rate\",\n        \"min_value\": min_hit_rate,\n        \"max_value\": 100.0,\n    })\n\n    qualified = []\n    for agent in candidates.get(\"agents\", []):\n        agent_id = agent[\"agent_id\"]\n\n        # Step 2: Filter by sample size\n        if agent.get(\"value\", 0) \u003C min_signals:\n            continue\n\n        # Step 3: Audit\n        audit = verifier.audit_provider(agent_id)\n        if audit[\"verification_rate\"] \u003C 90.0:\n            continue\n        if audit.get(\"trust_score\", 0) \u003C min_trust_score:\n            continue\n\n        qualified.append({\n            \"agent_id\": agent_id,\n            \"hit_rate\": audit[\"hit_rate\"],\n            \"total_signals\": audit[\"total_reveals\"],\n            \"trust_score\": audit[\"trust_score\"],\n            \"verification_rate\": audit[\"verification_rate\"],\n        })\n\n    # Sort by trust score\n    qualified.sort(key=lambda p: p[\"trust_score\"], reverse=True)\n    return qualified\n```\n\nThe listing data, combined with independent verification, creates a trust flywheel: better verified performance attracts more subscribers, more subscribers generate more revenue, more revenue funds better signal generation, better signals produce better verified performance. Providers who cannot survive this feedback loop are exactly the providers who should not be selling signals.\n\n---\n\n## What's Next\n\nThis guide covered the complete signal verification lifecycle: cryptographic commitment, independent verification, performance computation, escrow-linked payment, rolling monitoring, dispute resolution, and leaderboard discovery. Three companion guides extend this into adjacent domains:\n\n- **Verified Trading Bot Reputation** -- how to build an unforgeable PnL proof for your trading bot using the same Ed25519 and Merkle chain infrastructure covered here, applied to automated trading rather than discrete signals.\n- **Strategy Marketplace Playbook** -- how to list verified trading strategies as paid services with escrow-protected subscriptions, pricing tiers, and marketplace discovery.\n- **Agent Dispute Resolution & Chargeback Defense** -- deep dive into the dispute resolution framework, including card network chargeback defense for agent-initiated transactions.\n\nFull API reference and additional examples are available in the GreenHelix documentation at https:\u002F\u002Fapi.greenhelix.net\u002Fdocs.\n\n---\n\n*Price: $99 | Format: Digital Guide | Updates: Lifetime access to revisions*\n\n",{"name":5,"tags":24,"type":29,"author":33,"install":34,"license":15,"version":35,"metadata":36,"price_usd":41,"executable":20,"credentials":42,"description":7,"content_type":43,"compatibility":44},[25,26,27,28,29,30,31,32],"trading-signals","verification","cryptographic-proof","escrow","guide","greenhelix","openclaw","ai-agent","felix-agent","none","1.3.1",{"openclaw":37},{"requires":38,"primaryEnv":40},{"env":39},[40],"AGENT_SIGNING_KEY",0,[40],"markdown",[31],"master","4aa004da461d820f4ea5499e58eb8d196cf99016","community\u002Fclawhub\u002Fg\u002Fgreenhelix-signal-verification-network","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":54,"prompt":64,"zipAvailable":65},[55,58,61],{"tool":56,"command":57},"npx","npx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-signal-verification-network",{"tool":59,"command":60},"bunx","bunx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-signal-verification-network",{"tool":62,"command":63},"pnpm","pnpm dlx skills add Lord1Egypt\u002Fawesome-skill-forge --skill greenhelix-signal-verification-network","安装技能，技能地址：https:\u002F\u002Fgithub.com\u002FLord1Egypt\u002Fawesome-skill-forge\u002Fblob\u002Fmaster\u002Fcommunity\u002Fclawhub\u002Fg\u002Fgreenhelix-signal-verification-network\u002FSKILL.md",true,[],[68,75,82,89,96,103],{"skillNo":69,"name":70,"nameZh":6,"description":71,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":72,"categories":73,"keywords":74,"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":76,"name":77,"nameZh":6,"description":78,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":79,"categories":80,"keywords":81,"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":83,"name":84,"nameZh":6,"description":85,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":86,"categories":87,"keywords":88,"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":90,"name":91,"nameZh":6,"description":92,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":93,"categories":94,"keywords":95,"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":97,"name":98,"nameZh":6,"description":99,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":100,"categories":101,"keywords":102,"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":104,"name":105,"nameZh":6,"description":106,"descriptionZh":6,"repositoryFullName":8,"ownerLogin":9,"ownerAvatarUrl":10,"ownerAccountNo":11,"ownerDisplayName":12,"repositoryNo":13,"starsCount":14,"licenseSpdxId":15,"licenseFileUrl":6,"sourceHtmlUrl":107,"categories":108,"keywords":109,"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",[],[]]