← All Recipes
Bazantic // Recipe

Verify self-renewing agent access on Hedera

By Edy Cu Tjong

verify-self-renewing-agent-access-on-hedera

Confirms that an agent's unattended on-chain subscription renewal actually executed by cross-referencing the vendor's subscription state with independent Hedera Mirror Node lookups. Validates that the Hedera Schedule Service executed the renewal automatically, not manually, providing cryptographic proof of renewal via consensus timestamp and transaction hash.

Recipe inputs
Complete fields before a run.
The Hedera contract ID (format 0.0.X) that manages the subscription renewals.
The EVM address (0x + 40 hex) of the agent whose subscription renewal should be verified.
The base URL of the Hedera Mirror Node to query for independent renewal verification (e.g., testnet or mainnet).
Whether to perform strict verification (fail if no scheduled renewal found) or lenient verification (warn but allow if vendor claims access).
The full URL to the vendor's /api/retainer/status endpoint, including scheme and host.
The number of seconds that should remain after a successful scheduled renewal. Used to detect if the renewal actually occurred.
Output example
Representative published output.
"Both sources have responded. Here is the complete analysis and verification report.\n\n---\n\n## 🔐 Subscription Verification Report\n\n### Source Data\n\n| Field | Value | Source |\n|---|---|---|\n| `hasAccess` | `true` | Vendor (getStatus) |\n| `secondsRemaining` | `49` | Vendor (getStatus) |\n| `periodsFunded` | `11` | Vendor (getStatus) |\n| `nextRenewalSchedule` | `0x00000000000000000000000000000000009f36c1` | Vendor (getStatus) |\n\n---\n\n### On-Chain Evidence (Mirror Node — 10 most recent transactions)\n\nScanning for entries where `name = CONTRACTCALL` AND `scheduled = true`:\n\n| # | consensus_timestamp | transaction_id | result | scheduled |\n|---|---|---|---|---|\n| ✅ 1 | `1788941286.067088866` | `0.0.7314364-1788941190-974739652` | SUCCESS | **true** |\n| ✅ 2 | `1788940960.066463796` | `0.0.7314364-1788940773-916171156` | SUCCESS | **true** |\n| ✅ 3 | `1788940870.122653208` | `0.0.7314364-1788940773-916171156` | SUCCESS | **true** |\n| ✅ 4 | `1788940485.030975480` | `0.0.7314364-1788940119-561761404` | SUCCESS | **true** |\n| ✅ 5 | `1788940395.000942734` | `0.0.7314364-1788940119-561761404` | SUCCESS | **true** |\n| ✅ 6 | `1788940305.005860208` | `0.0.7314364-1788940119-561761404` | SUCCESS | **true** |\n\n**Scheduled CONTRACTCALLs found: 6 out of 10 transactions**\n\nThe ETHEREUMTRANSACTION entries (`1788941197.948447104`, `1788940991.785133088`, `1788940780.509360794`, `1788940763.847757104`) are person-sent calls and are **excluded** from renewal proof.\n\n**Newest qualifying entry (used for report):**\n- `consensus_timestamp`: `1788941286.067088866`\n- `transaction_id`: `0.0.7314364-1788941190-974739652`\n\n---\n\n## ✅ Final Verification Report\n\n```json\n{\n  \"access_status\": true,\n  \"seconds_remaining\": 49,\n  \"periods_funded\": 11,\n  \"scheduled_renewal_consensus_timestamp\": \"1788941286.067088866\",\n  \"scheduled_renewal_transaction_id\": \"0.0.7314364-1788941190-974739652\",\n  \"scheduled_renewals_found\": 6,\n  \"verification_result\": \"verified\",\n  \"reasoning\": \"The vendor (getStatus) reports hasAccess=true with 49 seconds remaining and 11 periods funded — this is the vendor's self-description and is not independently trustworthy on its own. The Hedera Mirror Node independently returned 10 recent transactions for contract 0.0.10415845, of which 6 carry name=CONTRACTCALL and scheduled=true, a flag set by Hedera consensus nodes and not manipulable by the contract or any caller. The most recent scheduled CONTRACTCALL executed successfully at consensus timestamp 1788941286.067088866 (transaction 0.0.7314364-1788941190-974739652), confirming that the Hedera Schedule Service autonomously renewed this subscription without any human intervention — the vendor's live access claim is therefore fully corroborated by on-chain evidence, and the result is 'verified' under strict mode.\"\n}\n```\n\n---\n\n### 🔍 Key Observations\n\n- **Strict mode satisfied**: A scheduled `CONTRACTCALL` exists and is recent (~41 seconds before the vendor's reported `now` timestamp of `1788941327`), placing it squarely within the current active window.\n- **Self-renewal is functioning robustly**: 6 of the last 10 transactions are autonomous scheduled renewals — this is a healthy, unattended renewal cadence consistent with the 90-second period.\n- **ETHEREUMTRANSACTION entries are top-ups**, not renewals — they fund the contract balance but do not prove autonomous operation.\n- **No discrepancies** between the vendor claim and chain evidence. The subscription is live, funded for 11 more periods, and renewing itself as designed."