Repository navigation
feat(x402): recognize lnbtc lightning network instead of bip122 - #67
Merged
Merged
Conversation
Match the x402 `exact` lightning spec (network lnbtc:...) in discover's rail aliases and in fetch --dry-run's invoice extraction, which now only reads extra.invoice from exact/lnbtc entries - the same ones fetch pays.
Contributor
|
Caution Review failedThe pull request is closed.
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Follow-up to getAlby/js-lightning-tools#337, which switches
fetch402to the x402exactscheme on Bitcoin Lightning (lnbtc) and drops the old Alby x402 format.discover: the CAIP-2 rail alias for lightning is nowlnbtc:000000000019d6689c085ae165831e93instead ofbip122:.... Services listed onbip122:are no longer treated as lightning-native, which matches whatfetchcan pay.fetch --dry-run: only readsextra.invoicefromexact/lnbtcentries in thePayment-Requiredheader. It previously matched any bolt11 string, so it could quote a price for an old-format challenge thatfetchwould refuse to pay.Before merging
@getalby/lightning-toolsto^10.0.0(released with js-lightning-tools#337).Testing
yarn test: 133 passed. 1 unrelated failure:request-invoice-from-lightning-addressusesnwc1779952113427@getalby.com, whose lnurlp endpoint now returns 404.