feat(action-provider): add @vdm-nexus action provider — signed inference for agents#1246
Open
2504VDM wants to merge 1 commit into
Open
feat(action-provider): add @vdm-nexus action provider — signed inference for agents#12462504VDM wants to merge 1 commit into
2504VDM wants to merge 1 commit into
Conversation
…nce for agents Adds typescript/agentkit/src/action-providers/vdm-nexus/, exposing three actions for paid LLM inference with cryptographically verifiable receipts via the VDM Nexus rail: - nexus_chat pay-per-call signed inference via x402 on Solana - nexus_verify_receipt five-check SIR v2 verification - nexus_get_deposit_address on-chain destination for off-band top-ups Each paid nexus_chat call settles a USDC payment inline via x402 and returns the OpenAI chat completion alongside a Signed Inference Receipt (SIR v2) anchored to the settlement transaction. The AgentKit-managed Solana wallet IS the agent identity — no separate agent secret env var is needed. Adds one new top-level dependency: @vdm-nexus/x402 ^0.4.0 (MIT, ESM-only, two-package x402 client + receipt verifier).
🟡 Heimdall Review Status
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This PR adds
vdm-nexus, a new action provider attypescript/agentkit/src/action-providers/vdm-nexus/that exposes VDM Nexus — a signed-inference rail — as a tool surface for any AgentKit-built agent. It ships three actions:nexus_chat,nexus_verify_receipt, andnexus_get_deposit_address.What signed inference is. A signed-inference receipt pairs an LLM call with (a) a cryptographic hash of the prompt and response, (b) an Ed25519 signature from the inference operator over the canonical receipt body, and (c) an on-chain USDC settlement transaction proving the call was paid for by a specific agent wallet. Third parties can verify all of this without trusting the caller or the service operator — the operator's published public key plus the on-chain record are the only trust anchors. The wire format is open and documented as SIR v2.
What this action provider does.
nexus_chatperforms the x402 two-roundtrip handshake (probe → sign with the AgentKit-managed Solana wallet → paid retry) against a Nexus/chat/completionsendpoint and returns the OpenAI chat completion plus the SIR v2 receipt plus the settlement record.nexus_verify_receiptruns the five-check verifier against any receipt: prompt-hash recompute, response-hash recompute, operator-signature check, on-chain settlement lookup, and payer-identity match.nexus_get_deposit_addressreturns the destination address for off-band prepaid top-ups (the per-call path doesn't need it — payment settles inline).Why AgentKit users would want it. An AgentKit agent gains a paid LLM endpoint that produces tamper-evident receipts in one wired-in action provider — useful for compliance regimes that demand audit trails of what models returned (EU AI Act Article 12, NIST AI agent standards, OWASP LLM Top 10 logging), and for trustless multi-agent flows where Agent A hands a receipt to Agent B and Agent B verifies it without trusting Agent A. The wallet attached to AgentKit IS the agent identity — no separate `AGENT_SECRET_KEY` env var is needed.
Live mainnet receipts (rendered by the same verifier code path this PR ships):
Project home: https://vdmnexus.com — Developer docs: https://docs.vdmnexus.com
Relationship to the existing `x402` action provider
The upstream `x402` action provider is a general-purpose client for calling any x402-protected API. `vdm-nexus` is a higher-level adapter targeting one specific x402 rail (Nexus) and adding the verifiable-receipt semantics on top — the wire-level handshake is the same, but the receipt verification, model selection, and OpenAI response shape are specific to the Nexus deployment. Use `x402` when you want to call arbitrary paid APIs; use `vdm-nexus` when you specifically want paid LLM inference with cryptographic receipts.
Dependencies
Tests
Includes a Jest suite at `vdmNexusActionProvider.test.ts` covering: schema validation (chat / verify / deposit), `supportsNetwork`, all three action paths with mocked `fetch` + mocked `@x402/*` + mocked `@vdm-nexus/x402`, and the constructor edge case. 20 tests, all passing locally.
Local checks: `pnpm run check`, `pnpm run lint`, `pnpm run format:check`, and `pnpm exec jest src/action-providers/vdm-nexus/` all pass.
A langchain-cdp-smart-wallet-chatbot exercise is the next step — happy to add it in a follow-up if maintainers prefer or wire it now.
Notes for reviewers
🤖 Generated with Claude Code