python: add Lightning reference implementation under bip122/exact#1873
Open
Bortlesboat wants to merge 3 commits intocoinbase:mainfrom
Open
python: add Lightning reference implementation under bip122/exact#1873Bortlesboat wants to merge 3 commits intocoinbase:mainfrom
Bortlesboat wants to merge 3 commits intocoinbase:mainfrom
Conversation
🟡 Heimdall Review Status
|
|
@Bortlesboat is attempting to deploy a commit to the Coinbase Team on Vercel. A member of the Team first needs to authorize it. |
Verify bip122/exact mechanism is wire-compatible with Alby's live Lightning facilitator at x402.albylabs.com. Tests confirm schema parsing, CAIP-2 network match, and x402Version alignment.
Contributor
Author
|
Added compatibility tests against Alby's live Lightning facilitator (
39 total tests passing (32 unit + 7 facilitator compat). |
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
Adds a Python Lightning reference implementation under
python/x402/mechanisms/bip122/exact/.This keeps the PR scoped to mechanism behavior:
extra.paymentMethod = "lightning"LightningPayer/LightningReceiveradapter protocols for client and receiver integrationspayment_hashfromsettle()as the settlement identifierMoneyinput and converts to msats internally, with explicit helper functions for sats <-> msatspayment_hashbolt11x402ClientSync,x402ResourceServerSync, andx402FacilitatorSyncThis intentionally does not add operator-facing audit or receipt fields like
authorized_byto the Lightning settlement response. That is broader x402 workflow metadata and should be handled separately from the Lightning mechanism API.Closes #1857.
Tests
cd python/x402 && ./.venv/Scripts/python.exe -m ruff format mechanisms/bip122 tests/unit/mechanisms/bip122cd python && ./x402/.venv/Scripts/python.exe -m ruff check x402/mechanisms/bip122 x402/tests/unit/mechanisms/bip122cd python && ./x402/.venv/Scripts/python.exe -m pytest x402/tests/unit/mechanisms/bip122 -qcd python && ./x402/.venv/Scripts/python.exe -m pytest x402/tests/unit/mechanisms -qcd python && ./x402/.venv/Scripts/python.exe -m pytest x402/tests/unit -qcd python && ./x402/.venv/Scripts/python.exe -m pytest x402/tests -qChecklist