Skip to content

feat(operator): plain-USDC Direct rail alongside shielded SpendAuth#13

Merged
drewstone merged 2 commits into
mainfrom
feat/direct-rail
Jun 11, 2026
Merged

feat(operator): plain-USDC Direct rail alongside shielded SpendAuth#13
drewstone merged 2 commits into
mainfrom
feat/direct-rail

Conversation

@drewstone

Copy link
Copy Markdown
Contributor

A buyer can now pay per inference call in plain USDC (an ERC-20 transfer to the operator) with no shielded pool — the "normal crypto" pay-as-you-go rail — served by the same decentralized vLLM operator. Additive: the shielded SpendAuth path is untouched.

What

  • ChatCompletionRequest gains payment: Option<PaymentProof>.
  • When a DirectTransfer proof is present and no spend_auth is, the handler verifies the on-chain transfer via the generic payment_provider (active under payment_mode = direct | both), checks vLLM health first, and serves — no preauth ceiling, no nonce store (the Direct rail's persistent replay store guards reuse; the transfer already happened, so settle is a no-op). The billing-required gate is satisfied by either rail.

Dependency

Pinned to tangle-inference-core rev 8b1b2f3 (PR tangle-network/tangle-inference-core#1 — persistent replay store + CompositeProvider), which makes the Direct rail replay-safe. Repoint to branch="master" after that merges.

Tests

server_tests 26/26 green against the pinned core. Also fixes a pre-existing broken test (test_max_spend_per_request_rejection sent snake_case service_id/job_index that no longer match the camelCase SpendAuthPayload, so the body 422'd on deserialize instead of exercising the rejection path).

FYI this branch includes one prerequisite commit it builds on — 983f1d6 (shared-secret auth bypass / trusted_app_call), already in flight. My Direct-rail branch references that refactor, so it should land with or after it. Split if you'd rather.

drewstone added 2 commits June 8, 2026 08:01
- Add VllmConfig.tuner_app_shared_secret field (env: VLLM_OP__VLLM__TUNER_APP_SHARED_SECRET)
- chat_completions handler checks x-tuner-app-secret header before billing
- When secret matches, skips entire SpendAuth/x402 validation flow
- Provides defense-in-depth: private models are unusable even if endpoint URL leaks
A buyer can now pay per inference call in plain USDC (an ERC-20 transfer to the
operator) with no shielded pool — the "normal crypto" pay-as-you-go rail —
served by the same decentralized vLLM operator. Additive: the shielded SpendAuth
path is untouched.

ChatCompletionRequest gains `payment: Option<PaymentProof>`. When a
DirectTransfer proof is present and no spend_auth is, the handler verifies the
on-chain transfer via the generic `payment_provider` (active under
payment_mode = direct | both), checks vLLM health first, and serves — no preauth
ceiling and no nonce store (the Direct rail's persistent replay store guards
reuse; the transfer already happened, so settle is a no-op). The billing-required
gate is satisfied by EITHER rail.

Pinned to tangle-inference-core rev 8b1b2f3 (direct-rail-payment branch) for the
replay-persistence + CompositeProvider hardening that makes the Direct rail
safe; repoint to branch=master after that merges.

Also fixes a pre-existing broken test: test_max_spend_per_request_rejection sent
snake_case spend_auth keys (service_id/job_index) that no longer match the
camelCase SpendAuthPayload wire format, so the body 422'd on deserialize instead
of exercising the rejection path. server_tests now 26/26 green.

@tangletools tangletools left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Auto-approved PR — 6d376375

Blanket team auto-approval is enabled for this reviewer service.
The full PR reviewer audit still runs separately and will publish findings if it detects issues.

tangletools · auto-approval · reason: blanket_auto_approve · 2026-06-11T20:32:47Z

@drewstone drewstone merged commit d01bd39 into main Jun 11, 2026
2 of 5 checks passed
@drewstone drewstone deleted the feat/direct-rail branch June 11, 2026 20:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants