Skip to content

Conversation

@HealthyBuilder
Copy link

What's Added

Core Library - SVM Support

New modules:

  • exact_svm.py - Solana transaction creation, signing, and payment header generation
  • svm/rpc.py - Solana RPC client wrapper
  • svm/transaction.py - Transaction encoding/decoding utilities
  • svm/wallet.py - Wallet and keypair management

Enhanced existing modules:

  • clients/base.py - SVM keypair support with proper type detection
  • fastapi/middleware.py - Solana payment middleware
  • flask/middleware.py - Solana payment middleware
  • chains.py, networks.py, types.py - Solana network configurations

Examples

  • Client example (examples/python/clients/solana/) - httpx-based payment client with proxy bypass
  • Server example (examples/python/servers/solana/) - FastAPI server with payment middleware
  • No-facilitator mode (main_no_facilitator.py) - Direct Solana settlement without facilitator

Testing

  • Unit tests (tests/test_svm.py) - Core SVM functionality
  • E2E tests (tests/test_svm_e2e.py) - Full payment flow with live blockchain
  • Test runner (run_e2e_test.sh) - Automated E2E test execution

Payment Flow:

  1. Client requests protected endpoint → 402 response
  2. Client creates signed payment transaction
  3. Server validates and submits to Solana
  4. Returns content with settlement proof

Networks Supported:

  • solana-devnet (testing)
  • solana-mainnet-beta (production)
$ cd python/x402 && ./run_e2e_test.sh

@cb-heimdall
Copy link

cb-heimdall commented Nov 6, 2025

🟡 Heimdall Review Status

Requirement Status More Info
Reviews 🟡 0/1
Denominator calculation
Show calculation
1 if user is bot 0
1 if user is external 0
2 if repo is sensitive 0
From .codeflow.yml 1
Additional review requirements
Show calculation
Max 0
0
From CODEOWNERS 0
Global minimum 0
Max 1
1
1 if commit is unverified 0
Sum 1

@vercel
Copy link

vercel bot commented Nov 6, 2025

@HealthyBuilder is attempting to deploy a commit to the Coinbase Team on Vercel.

A member of the Team first needs to authorize it.

@HealthyBuilder
Copy link
Author

gmgm, any feeback on this?

@Olshansk
Copy link
Contributor

Olshansk commented Dec 1, 2025

@CarsonRoscoe @erikreppel-cb Do you know someone who could review and take a look at this?

As a user of this repo for grove.city, I found myself needing this functionality and lucky enough to find @HealthyBuilder's PR (rather than doing it myself).

I'm sure everyone in the community would benefit!

Given that coinbase's facilitator supports solana, this PR makes a ton of sense!

@Olshansk
Copy link
Contributor

Olshansk commented Dec 3, 2025

@HealthyBuilder Here's a small update from the official x402 telegram channel.

Screenshot 2025-12-03 at 9 29 00 AM

@Olshansk
Copy link
Contributor

@HealthyBuilder Would be able to update this PR once python support for v2 is complete?

Here's a screenshot from the official x402 telegram chat:

Screenshot 2025-12-13 at 10 05 22 AM

@phdargen
Copy link
Contributor

Hi @HealthyBuilder, we really appreciate your initiative to bring solana support to the python sdk! That's certainly a big gap and something many users are waiting for.

Now that v2 is released for typescript and go, the legacy packages are effectively frozen and a top priority is to fast-follow with a python v2 SDK release. We have a new development branch up with the core building blocks but there is still a lot missing, including the Solana mechanism. Please have a look at this PR: #841 and let us know if you are interested in working on this and update your code to v2. Your contribution would be much appreciated!

Closing this now, please target the feat/python-v2-sdk branch if you open a new PR

Here are some resources to get started with v2:

@phdargen phdargen closed this Dec 24, 2025
@Olshansk
Copy link
Contributor

Olshansk commented Jan 5, 2026

@phdargen Do you have a general idea/timeline for #841.

No urgent rush, but I just want to plan out the migration accordingly.

@phdargen phdargen mentioned this pull request Jan 5, 2026
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

5 participants