feat(x402): attach BlockRun builder-code service code to payments#21
Merged
VickyXAI merged 1 commit intoJul 8, 2026
Merged
Conversation
Tag every x402 payment this SDK signs with the ERC-8021 Schema 2 service code s: ["blockrun"] so BlockRun-originated traffic is attributed on-chain. Merged into builder-code.info.s inside create_payment_payload, preserving any app code (a) the server echoes back in its 402. Encoding into settlement calldata is handled by the CDP facilitator; the client only sets the JSON field, so no new dependency is required. Covers the EVM signing path. The Solana path delegates to the external x402 SDK and is tracked separately. Docs: https://docs.cdp.coinbase.com/x402/core-concepts/builder-codes
VickyXAI
pushed a commit
that referenced
this pull request
Jul 8, 2026
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.
What
Tags every x402 payment this SDK signs with the ERC-8021 Schema 2 service code
s: ["blockrun"], so payments originated through BlockRun's Python SDK are attributed to BlockRun on-chain.Reference: CDP Builder Codes
How
with_builder_code_service_code()mergess: ["blockrun"]into the payload'sbuilder-code.info, preserving any app code (a) the server echoes back in its 402 (so seller attribution is never clobbered).create_payment_payload, through which every EVM caller (client,anthropic_client,music,realface, …) already funnels.BLOCKRUN_SERVICE_CODEfor reuse.Why this is all the client needs
The CBOR / ERC-8021 calldata encoding is done by the CDP facilitator at settlement (it reads
builder-code.info.sfrom the payload). The client only sets a JSON field — no new dependency, no CBOR, works unconditionally on every payment.Scope
blockrun_llm/x402.py).x402SDK (solana_client.py→x402_client.create_payment_payload); attributing it needs the x402 SDK's builder-code extension and is a separate follow-up.a) needs a registered code from dashboard.base.org (tracked separately).Test
tests/unit/test_x402.py: service code always attached; server-echoedapreserved.