x402-conformance 1.2.1__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- x402_conformance-1.2.1/LICENSE +202 -0
- x402_conformance-1.2.1/NOTICE +7 -0
- x402_conformance-1.2.1/PKG-INFO +288 -0
- x402_conformance-1.2.1/README.md +272 -0
- x402_conformance-1.2.1/pyproject.toml +41 -0
- x402_conformance-1.2.1/setup.cfg +4 -0
- x402_conformance-1.2.1/src/x402_conformance.egg-info/PKG-INFO +288 -0
- x402_conformance-1.2.1/src/x402_conformance.egg-info/SOURCES.txt +29 -0
- x402_conformance-1.2.1/src/x402_conformance.egg-info/dependency_links.txt +1 -0
- x402_conformance-1.2.1/src/x402_conformance.egg-info/entry_points.txt +2 -0
- x402_conformance-1.2.1/src/x402_conformance.egg-info/top_level.txt +1 -0
- x402_conformance-1.2.1/src/x402conf/__init__.py +5 -0
- x402_conformance-1.2.1/src/x402conf/__main__.py +5 -0
- x402_conformance-1.2.1/src/x402conf/cli.py +205 -0
- x402_conformance-1.2.1/src/x402conf/devnet/__init__.py +1 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/common.mjs +63 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/facilitator.mjs +69 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/package-lock.json +2299 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/package.json +16 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/payer.mjs +12 -0
- x402_conformance-1.2.1/src/x402conf/devnet/node/setup.mjs +52 -0
- x402_conformance-1.2.1/src/x402conf/devnet/runner.py +332 -0
- x402_conformance-1.2.1/src/x402conf/fixtures/devnet.json +18 -0
- x402_conformance-1.2.1/src/x402conf/harness.py +283 -0
- x402_conformance-1.2.1/src/x402conf/mock.py +164 -0
- x402_conformance-1.2.1/src/x402conf/py.typed +0 -0
- x402_conformance-1.2.1/src/x402conf/spec.py +40 -0
- x402_conformance-1.2.1/src/x402conf/types.py +20 -0
- x402_conformance-1.2.1/tests/test_devnet.py +153 -0
- x402_conformance-1.2.1/tests/test_live.py +93 -0
- x402_conformance-1.2.1/tests/test_offline.py +163 -0
|
@@ -0,0 +1,202 @@
|
|
|
1
|
+
|
|
2
|
+
Apache License
|
|
3
|
+
Version 2.0, January 2004
|
|
4
|
+
http://www.apache.org/licenses/
|
|
5
|
+
|
|
6
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
7
|
+
|
|
8
|
+
1. Definitions.
|
|
9
|
+
|
|
10
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
11
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
12
|
+
|
|
13
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
14
|
+
the copyright owner that is granting the License.
|
|
15
|
+
|
|
16
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
17
|
+
other entities that control, are controlled by, or are under common
|
|
18
|
+
control with that entity. For the purposes of this definition,
|
|
19
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
20
|
+
direction or management of such entity, whether by contract or
|
|
21
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
22
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
23
|
+
|
|
24
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
25
|
+
exercising permissions granted by this License.
|
|
26
|
+
|
|
27
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
28
|
+
including but not limited to software source code, documentation
|
|
29
|
+
source, and configuration files.
|
|
30
|
+
|
|
31
|
+
"Object" form shall mean any form resulting from mechanical
|
|
32
|
+
transformation or translation of a Source form, including but
|
|
33
|
+
not limited to compiled object code, generated documentation,
|
|
34
|
+
and conversions to other media types.
|
|
35
|
+
|
|
36
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
37
|
+
Object form, made available under the License, as indicated by a
|
|
38
|
+
copyright notice that is included in or attached to the work
|
|
39
|
+
(an example is provided in the Appendix below).
|
|
40
|
+
|
|
41
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
42
|
+
form, that is based on (or derived from) the Work and for which the
|
|
43
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
44
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
45
|
+
of this License, Derivative Works shall not include works that remain
|
|
46
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
47
|
+
the Work and Derivative Works thereof.
|
|
48
|
+
|
|
49
|
+
"Contribution" shall mean any work of authorship, including
|
|
50
|
+
the original version of the Work and any modifications or additions
|
|
51
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
52
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
53
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
54
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
55
|
+
means any form of electronic, verbal, or written communication sent
|
|
56
|
+
to the Licensor or its representatives, including but not limited to
|
|
57
|
+
communication on electronic mailing lists, source code control systems,
|
|
58
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
59
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
60
|
+
excluding communication that is conspicuously marked or otherwise
|
|
61
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
62
|
+
|
|
63
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
64
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
65
|
+
subsequently incorporated within the Work.
|
|
66
|
+
|
|
67
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
68
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
69
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
70
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
71
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
72
|
+
Work and such Derivative Works in Source or Object form.
|
|
73
|
+
|
|
74
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
75
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
76
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
77
|
+
(except as stated in this section) patent license to make, have made,
|
|
78
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
79
|
+
where such license applies only to those patent claims licensable
|
|
80
|
+
by such Contributor that are necessarily infringed by their
|
|
81
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
82
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
83
|
+
institute patent litigation against any entity (including a
|
|
84
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
85
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
86
|
+
or contributory patent infringement, then any patent licenses
|
|
87
|
+
granted to You under this License for that Work shall terminate
|
|
88
|
+
as of the date such litigation is filed.
|
|
89
|
+
|
|
90
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
91
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
92
|
+
modifications, and in Source or Object form, provided that You
|
|
93
|
+
meet the following conditions:
|
|
94
|
+
|
|
95
|
+
(a) You must give any other recipients of the Work or
|
|
96
|
+
Derivative Works a copy of this License; and
|
|
97
|
+
|
|
98
|
+
(b) You must cause any modified files to carry prominent notices
|
|
99
|
+
stating that You changed the files; and
|
|
100
|
+
|
|
101
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
102
|
+
that You distribute, all copyright, patent, trademark, and
|
|
103
|
+
attribution notices from the Source form of the Work,
|
|
104
|
+
excluding those notices that do not pertain to any part of
|
|
105
|
+
the Derivative Works; and
|
|
106
|
+
|
|
107
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
108
|
+
distribution, then any Derivative Works that You distribute must
|
|
109
|
+
include a readable copy of the attribution notices contained
|
|
110
|
+
within such NOTICE file, excluding those notices that do not
|
|
111
|
+
pertain to any part of the Derivative Works, in at least one
|
|
112
|
+
of the following places: within a NOTICE text file distributed
|
|
113
|
+
as part of the Derivative Works; within the Source form or
|
|
114
|
+
documentation, if provided along with the Derivative Works; or,
|
|
115
|
+
within a display generated by the Derivative Works, if and
|
|
116
|
+
wherever such third-party notices normally appear. The contents
|
|
117
|
+
of the NOTICE file are for informational purposes only and
|
|
118
|
+
do not modify the License. You may add Your own attribution
|
|
119
|
+
notices within Derivative Works that You distribute, alongside
|
|
120
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
121
|
+
that such additional attribution notices cannot be construed
|
|
122
|
+
as modifying the License.
|
|
123
|
+
|
|
124
|
+
You may add Your own copyright statement to Your modifications and
|
|
125
|
+
may provide additional or different license terms and conditions
|
|
126
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
127
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
128
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
129
|
+
the conditions stated in this License.
|
|
130
|
+
|
|
131
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
132
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
133
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
134
|
+
this License, without any additional terms or conditions.
|
|
135
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
136
|
+
the terms of any separate license agreement you may have executed
|
|
137
|
+
with Licensor regarding such Contributions.
|
|
138
|
+
|
|
139
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
140
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
141
|
+
except as required for reasonable and customary use in describing the
|
|
142
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
143
|
+
|
|
144
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
145
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
146
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
147
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
148
|
+
implied, including, without limitation, any warranties or conditions
|
|
149
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
150
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
151
|
+
appropriateness of using or redistributing the Work and assume any
|
|
152
|
+
risks associated with Your exercise of permissions under this License.
|
|
153
|
+
|
|
154
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
155
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
156
|
+
unless required by applicable law (such as deliberate and grossly
|
|
157
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
158
|
+
liable to You for damages, including any direct, indirect, special,
|
|
159
|
+
incidental, or consequential damages of any character arising as a
|
|
160
|
+
result of this License or out of the use or inability to use the
|
|
161
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
162
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
163
|
+
other commercial damages or losses), even if such Contributor
|
|
164
|
+
has been advised of the possibility of such damages.
|
|
165
|
+
|
|
166
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
167
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
168
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
169
|
+
or other liability obligations and/or rights consistent with this
|
|
170
|
+
License. However, in accepting such obligations, You may act only
|
|
171
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
172
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
173
|
+
defend, and hold each Contributor harmless for any liability
|
|
174
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
175
|
+
of your accepting any such warranty or additional liability.
|
|
176
|
+
|
|
177
|
+
END OF TERMS AND CONDITIONS
|
|
178
|
+
|
|
179
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
180
|
+
|
|
181
|
+
To apply the Apache License to your work, attach the following
|
|
182
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
183
|
+
replaced with your own identifying information. (Don't include
|
|
184
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
185
|
+
comment syntax for the file format. We also recommend that a
|
|
186
|
+
file or class name and description of purpose be included on the
|
|
187
|
+
same "printed page" as the copyright notice for easier
|
|
188
|
+
identification within third-party archives.
|
|
189
|
+
|
|
190
|
+
Copyright [yyyy] [name of copyright owner]
|
|
191
|
+
|
|
192
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
193
|
+
you may not use this file except in compliance with the License.
|
|
194
|
+
You may obtain a copy of the License at
|
|
195
|
+
|
|
196
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
197
|
+
|
|
198
|
+
Unless required by applicable law or agreed to in writing, software
|
|
199
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
200
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
201
|
+
See the License for the specific language governing permissions and
|
|
202
|
+
limitations under the License.
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
x402-conformance
|
|
2
|
+
Copyright 2026 Ryan Gillespie / Optitransfer
|
|
3
|
+
|
|
4
|
+
Licensed under the Apache License, Version 2.0 (see LICENSE).
|
|
5
|
+
|
|
6
|
+
This project tests implementations of the x402 protocol (https://github.com/coinbase/x402). It contains no code
|
|
7
|
+
from that project; check identifiers and error codes are quoted from its public specification for reference.
|
|
@@ -0,0 +1,288 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: x402-conformance
|
|
3
|
+
Version: 1.2.1
|
|
4
|
+
Summary: Experimental conformance and safety checks for x402 V2 facilitators and resource servers, Solana first
|
|
5
|
+
Author: Ryan Gillespie / Optitransfer
|
|
6
|
+
License: Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/atsp-protocol/x402-conformance
|
|
8
|
+
Project-URL: Documentation, https://github.com/atsp-protocol/x402-conformance/blob/main/docs/SPEC.md
|
|
9
|
+
Project-URL: Changelog, https://github.com/atsp-protocol/x402-conformance/blob/main/CHANGELOG.md
|
|
10
|
+
Project-URL: Issues, https://github.com/atsp-protocol/x402-conformance/issues
|
|
11
|
+
Requires-Python: >=3.10
|
|
12
|
+
Description-Content-Type: text/markdown
|
|
13
|
+
License-File: LICENSE
|
|
14
|
+
License-File: NOTICE
|
|
15
|
+
Dynamic: license-file
|
|
16
|
+
|
|
17
|
+
# x402 Conformance
|
|
18
|
+
|
|
19
|
+
**Prove your x402 payments can't double-credit, credit too early or credit on a broken answer, in one CI step.**
|
|
20
|
+
|
|
21
|
+
[](https://github.com/atsp-protocol/x402-conformance/actions/workflows/ci.yml)
|
|
22
|
+
[](https://github.com/atsp-protocol/x402-conformance/releases/latest)
|
|
23
|
+
[](https://github.com/marketplace/actions/x402-conformance)
|
|
24
|
+
[](LICENSE)
|
|
25
|
+
[](https://github.com/atsp-protocol/x402-conformance)
|
|
26
|
+
|
|
27
|
+
An open set of conformance and safety checks for [x402](https://github.com/coinbase/x402) V2 facilitators and
|
|
28
|
+
resource servers, starting with Solana. It checks the properties a seller's money depends on. It never signs, pays or
|
|
29
|
+
touches mainnet. It complements x402 and its facilitators and doesn't replace them.
|
|
30
|
+
|
|
31
|
+
**Experimental.** Passing a check is evidence about one property. It doesn't certify conformance to x402.
|
|
32
|
+
— Ryan Gillespie, Optitransfer
|
|
33
|
+
|
|
34
|
+
Project page with the checks and the latest results: https://atsp-protocol.github.io/x402-conformance/
|
|
35
|
+
|
|
36
|
+
## Install
|
|
37
|
+
|
|
38
|
+
| how | command | needs |
|
|
39
|
+
|---|---|---|
|
|
40
|
+
| GitHub Action | `uses: atsp-protocol/x402-conformance@v1` (see [below](#github-action)) | nothing |
|
|
41
|
+
| Python CLI, one-off | `pipx run --spec "git+https://github.com/atsp-protocol/x402-conformance@v1" x402conf offline` | [pipx](https://pipx.pypa.io) or [uv](https://docs.astral.sh/uv/) |
|
|
42
|
+
| Python CLI, installed | `pip install "git+https://github.com/atsp-protocol/x402-conformance@v1"` | Python 3.10+, no dependencies |
|
|
43
|
+
| TypeScript runner | `git clone` this repo, then `cd ts && npm ci && npm run build` | Node 20+ |
|
|
44
|
+
|
|
45
|
+
The packages aren't on PyPI (`x402-conformance`) or npm (`x402-conformance-svm`) yet, so `pip install x402-conformance`
|
|
46
|
+
and `npx x402conf-svm` don't work today. Install from the release tag as shown. `@v1` follows the latest 1.x release;
|
|
47
|
+
pin `@v1.2.0` if you want a fixed version.
|
|
48
|
+
|
|
49
|
+
## Quickstart
|
|
50
|
+
|
|
51
|
+
```
|
|
52
|
+
pipx run --spec "git+https://github.com/atsp-protocol/x402-conformance@v1" x402conf offline
|
|
53
|
+
uvx --from "git+https://github.com/atsp-protocol/x402-conformance@v1" x402conf live https://x402.org/facilitator
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
The first runs the F1-F9 safety suite against the built-in reference and fault-injected facilitator doubles. The
|
|
57
|
+
second reads `GET /supported` from a facilitator and runs S1-S4. Both print JSON.
|
|
58
|
+
|
|
59
|
+
## GitHub Action
|
|
60
|
+
|
|
61
|
+
Save this as `.github/workflows/x402-conformance.yml`. It runs as is:
|
|
62
|
+
|
|
63
|
+
```yaml
|
|
64
|
+
name: x402 conformance
|
|
65
|
+
on: [push, pull_request]
|
|
66
|
+
jobs:
|
|
67
|
+
x402:
|
|
68
|
+
runs-on: ubuntu-latest
|
|
69
|
+
steps:
|
|
70
|
+
- uses: actions/checkout@v4
|
|
71
|
+
- uses: atsp-protocol/x402-conformance@v1
|
|
72
|
+
with:
|
|
73
|
+
facilitators: https://x402.org/facilitator # swap in your facilitator; GET /supported only
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
With no inputs it runs only the F1-F9 safety suite. `facilitators` adds the live `GET /supported` checks. To test
|
|
77
|
+
your own resource server, point the Action at your paid route and give it the command that starts the server:
|
|
78
|
+
|
|
79
|
+
```yaml
|
|
80
|
+
- uses: atsp-protocol/x402-conformance@v1
|
|
81
|
+
with:
|
|
82
|
+
resource-url: http://127.0.0.1:4020/paid
|
|
83
|
+
start: node server.js # your server must use X402_FACILITATOR_URL as its facilitator
|
|
84
|
+
```
|
|
85
|
+
|
|
86
|
+
| input | default | what it does |
|
|
87
|
+
|---|---|---|
|
|
88
|
+
| `facilitators` | empty | Space-separated facilitator base URLs, checked with `GET /supported` only (S1-S4) |
|
|
89
|
+
| `resource-url` | empty | Your paid route; the Action puts a facilitator double in front of it and runs R0-R9 |
|
|
90
|
+
| `start` | empty | Command that starts your server; it receives `X402_FACILITATOR_URL` |
|
|
91
|
+
| `port` | `4402` | Loopback port for the facilitator double |
|
|
92
|
+
| `offline` | `true` | Run the F1-F9 suite against the reference and fault-injected doubles |
|
|
93
|
+
| `results-dir` | `x402-conformance` | Where `live.json`, `resource-server.json` and `offline.json` are written |
|
|
94
|
+
| `fail-on-error` | `true` | Fail the job when any error-severity check fails |
|
|
95
|
+
|
|
96
|
+
| output | value |
|
|
97
|
+
|---|---|
|
|
98
|
+
| `result` | `pass` when every requested check passed, otherwise `fail` |
|
|
99
|
+
| `results-dir` | the directory holding the results JSON |
|
|
100
|
+
| `sarif` | `<results-dir>/x402-conformance.sarif`, SARIF 2.1.0 of the failed checks |
|
|
101
|
+
| `junit` | `<results-dir>/junit.xml`, one test case per check |
|
|
102
|
+
|
|
103
|
+
**Example job summary** (abridged):
|
|
104
|
+
|
|
105
|
+
```
|
|
106
|
+
## x402 Conformance: pass
|
|
107
|
+
| target | check | result |
|
|
108
|
+
| https://x402.org/facilitator | S1 SupportedResponse shape: kinds[], extensions[], signers{} | pass |
|
|
109
|
+
| https://x402.org/facilitator | S4 Solana exact kinds advertise a valid extra.feePayer ... | pass |
|
|
110
|
+
| reference double | F3 the same payload settled twice succeeds at most once ... | pass |
|
|
111
|
+
| reference double | F9 a 503, non-JSON or truncated /settle answer is never ... | pass |
|
|
112
|
+
| fault-injected doubles | every fault caught by at least one check | pass |
|
|
113
|
+
```
|
|
114
|
+
|
|
115
|
+
**Failures in code scanning.** Every failed check can show up in your repo's Security tab, with a link to what
|
|
116
|
+
failed and how to fix it. Add `permissions: { security-events: write, contents: read }` to the job, `id: x402` and
|
|
117
|
+
`fail-on-error: false` to the step above, then:
|
|
118
|
+
|
|
119
|
+
```yaml
|
|
120
|
+
- uses: github/codeql-action/upload-sarif@v3
|
|
121
|
+
if: always()
|
|
122
|
+
with:
|
|
123
|
+
sarif_file: ${{ steps.x402.outputs.sarif }}
|
|
124
|
+
category: x402-conformance
|
|
125
|
+
- run: test "${{ steps.x402.outputs.result }}" = pass
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
The `junit` output works with any JUnit test-report viewer.
|
|
129
|
+
|
|
130
|
+
## CLI
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
x402conf live https://x402.org/facilitator # S1-S4, GET /supported only
|
|
134
|
+
x402conf offline # F1-F9 against the reference and fault-injected doubles
|
|
135
|
+
x402conf report --dir DIR --sarif out.sarif --junit junit.xml
|
|
136
|
+
x402conf devnet --faults --keys DIR # F1-F6 over real /verify and /settle on Solana devnet
|
|
137
|
+
```
|
|
138
|
+
|
|
139
|
+
`live` and `offline` print JSON with one entry per check (`check`, `pass`, `severity`, `detail`). Save them as
|
|
140
|
+
`live.json` and `offline.json` in one directory and `report` converts them to SARIF and JUnit, printing a one-line
|
|
141
|
+
summary such as `{"checks": 14, "failed": 0, "failed_ids": []}`. `devnet` runs against a self-hosted reference
|
|
142
|
+
facilitator on loopback with throwaway keys from `--keys`, and refuses any other facilitator unless you pass
|
|
143
|
+
`--operator-permission` with the operator's written permission. It needs Node 20+ and a funded devnet fee payer;
|
|
144
|
+
[evidence/devnet](evidence/devnet) shows a full run.
|
|
145
|
+
|
|
146
|
+
**Exit codes.**
|
|
147
|
+
|
|
148
|
+
| command | 0 | non-zero |
|
|
149
|
+
|---|---|---|
|
|
150
|
+
| `x402conf offline` | the reference double passes every check and every fault-injected double is caught | `1` otherwise |
|
|
151
|
+
| `x402conf live` | always, even when a check fails or the facilitator can't be reached | read the `pass` fields, or use the Action, which does |
|
|
152
|
+
| `x402conf report` | the reports were written | `2` when the directory holds no results JSON |
|
|
153
|
+
| `x402conf devnet` | the facilitator under test passes every check, and with `--faults` every fault-injected build is caught | `1` otherwise (the current reference exits `1` on F4, see [Results](#results)) |
|
|
154
|
+
| `x402conf-svm probe` (TypeScript) | R0-R9 all pass | `1` when a check fails, `2` on an error |
|
|
155
|
+
|
|
156
|
+
Usage errors exit `2`.
|
|
157
|
+
|
|
158
|
+
**TypeScript runner** for resource servers on `@x402/core` and `@x402/svm`, from a clone of this repo:
|
|
159
|
+
|
|
160
|
+
```
|
|
161
|
+
cd ts && npm ci && npm run build
|
|
162
|
+
node dist/src/cli.js probe --resource http://127.0.0.1:4020/paid --start "node your-server.js" --out results.json
|
|
163
|
+
```
|
|
164
|
+
|
|
165
|
+
[ts/README.md](ts/README.md) explains what the double does for each of R0-R9.
|
|
166
|
+
|
|
167
|
+
## What it catches
|
|
168
|
+
|
|
169
|
+
**Live, read-only (`GET /supported`):**
|
|
170
|
+
- **S1** the response is missing `kinds`, `extensions` or `signers`
|
|
171
|
+
- **S2** a V2 network isn't written as a CAIP-2 ID
|
|
172
|
+
- **S3** a Solana kind uses an old V1 name such as `solana-devnet` instead of the published ID
|
|
173
|
+
- **S4** a Solana `exact` kind has no valid fee payer, or one that isn't a listed signer
|
|
174
|
+
|
|
175
|
+
**Safety, against doubles, on devnet and in your resource server:**
|
|
176
|
+
- **F1** a malformed payment is accepted instead of rejected
|
|
177
|
+
- **F2** an underpayment or dust amount is accepted
|
|
178
|
+
- **F3** the same payment is settled, or served, twice
|
|
179
|
+
- **F4** a used memo or nonce is replayed in a new transaction
|
|
180
|
+
- **F5** a payment counts as settled before it's confirmed, or `settlement_pending` comes without a transaction
|
|
181
|
+
- **F6** a facilitator timeout or garbage answer turns into a credit
|
|
182
|
+
- **F7** a pending payment retried with the same body never reaches its final result, or is credited more than once
|
|
183
|
+
- **F8** a payment that failed on chain stays "pending" instead of failing
|
|
184
|
+
- **F9** a 503, an HTML page or a truncated `/settle` answer is credited, or the payment can't be retried afterwards
|
|
185
|
+
|
|
186
|
+
**Resource servers (R0-R9).** The TypeScript runner puts a facilitator double in front of your server and requests your
|
|
187
|
+
paid route under each of the faults above. Your server must answer an unpaid request with a 402 and must not serve
|
|
188
|
+
content on a timeout, a broken `/settle` answer, `settlement_pending`, a failure or a duplicate.
|
|
189
|
+
|
|
190
|
+
[docs/SPEC.md](docs/SPEC.md) quotes the spec text behind every check, and [docs/FIXES.md](docs/FIXES.md) explains, for
|
|
191
|
+
every check, what failed, why it matters and how to fix it.
|
|
192
|
+
|
|
193
|
+
## Results
|
|
194
|
+
|
|
195
|
+
### Live, 2026-10-20, `GET /supported` only
|
|
196
|
+
|
|
197
|
+
| facilitator | HTTP | S1 | S2 | S3 | S4 | Solana kinds advertised |
|
|
198
|
+
|---|---|---|---|---|---|---|
|
|
199
|
+
| x402.dexter.cash | 200 | pass | pass | pass | pass | exact (mainnet, devnet), tab, bridge |
|
|
200
|
+
| facilitator.payai.network | 200 | pass | pass | pass | pass | exact and batch-settlement (mainnet, devnet) |
|
|
201
|
+
| x402.org/facilitator | 200 | pass | pass | pass | pass | exact (devnet) |
|
|
202
|
+
|
|
203
|
+
Raw bodies, `run.json` and `SHA256SUMS` are in [evidence/2026-10-20](evidence/2026-10-20).
|
|
204
|
+
|
|
205
|
+
### Devnet, 2026-10-20, F1-F6 over real `/verify` and `/settle`
|
|
206
|
+
|
|
207
|
+
I ran F1 to F6 on Solana devnet against my self-hosted reference facilitator (`@x402/core` and `@x402/svm` 2.28.0),
|
|
208
|
+
then against fault-injected builds of it.
|
|
209
|
+
|
|
210
|
+
| facilitator | F1 | F2 | F3 | F4 | F5 | F6 |
|
|
211
|
+
|---|---|---|---|---|---|---|
|
|
212
|
+
| self-hosted reference, `@x402/svm` 2.28.0 | pass | pass | pass | **fail** | pass | pass |
|
|
213
|
+
|
|
214
|
+
F4 fails because the reference facilitator deduplicates by transaction but not by memo, so two different
|
|
215
|
+
transactions with the same memo both settled. The payer paid twice, so the seller lost nothing, but a resource server
|
|
216
|
+
that ties one purchase to one memo has to enforce that itself. Every fault-injected build was caught by the check
|
|
217
|
+
it targets. Transaction links, the full `run.json` and its hash are in [evidence/devnet](evidence/devnet). Results for
|
|
218
|
+
other facilitators go in the [facilitator matrix](docs/MATRIX.md), and I run them against a third party only with the
|
|
219
|
+
operator's permission.
|
|
220
|
+
|
|
221
|
+
## How this repo is verified
|
|
222
|
+
|
|
223
|
+
Scope and acceptance criteria live in [`proofline.json`](proofline.json), a [Proofline](https://github.com/Optitransfer/proofline)
|
|
224
|
+
contract. It's signed with my owner key: the signature is in `proofline.json.sig` and the public key is pinned in
|
|
225
|
+
[`guard/owner.pub`](guard/owner.pub). On every push to `main` and on every pull request, CI checks that signature and then runs `tools/vv.py`, which checks
|
|
226
|
+
every acceptance criterion and uploads a receipt ([docs/VV.md](docs/VV.md)). Any change to the contract has to be
|
|
227
|
+
re-signed before CI passes again. You can check the signature yourself from a clone:
|
|
228
|
+
|
|
229
|
+
```
|
|
230
|
+
node tools/verify-sig.mjs # no dependencies; exits 0 when the signature matches
|
|
231
|
+
npx -y @optitransfer/proofline@next contract verify-sig # the Proofline CLI (Node 22+), same check
|
|
232
|
+
```
|
|
233
|
+
|
|
234
|
+
The Lean 4 models in [`lean/`](lean) cover the credit rule, nonces, timeouts, `settlement_pending` reconciliation and
|
|
235
|
+
concurrent settles. They use only standard axioms and contain no `sorry`. They model the rule the suite checks, not any
|
|
236
|
+
facilitator's code.
|
|
237
|
+
|
|
238
|
+
## Add the badge
|
|
239
|
+
|
|
240
|
+
If your project runs the suite in CI, add this to your README:
|
|
241
|
+
|
|
242
|
+
```markdown
|
|
243
|
+
[](https://github.com/atsp-protocol/x402-conformance)
|
|
244
|
+
```
|
|
245
|
+
|
|
246
|
+
## Who uses it
|
|
247
|
+
|
|
248
|
+
No public users yet. I only list a user once they've said so publicly. If you run it, open an issue and I'll add you
|
|
249
|
+
here and to [docs/ADOPTION.md](docs/ADOPTION.md).
|
|
250
|
+
|
|
251
|
+
**Free run for your project.** Open an issue with your repo or facilitator URL and I'll run the suite against it,
|
|
252
|
+
post the results, and send a tests-only pull request with the Action and badge. It's free, with no conditions.
|
|
253
|
+
|
|
254
|
+
## Managed services
|
|
255
|
+
|
|
256
|
+
The core is free and stays free. If you'd rather not run it yourself, or you need more than the open suite, I offer:
|
|
257
|
+
- **Hosted continuous monitoring** of your live endpoints, with alerts on regressions
|
|
258
|
+
- **Signed conformance reports** for each release, with a public verify link
|
|
259
|
+
- **Custom checks** for your scheme, chain or extensions
|
|
260
|
+
- **Priority support** with an agreed response time
|
|
261
|
+
|
|
262
|
+
The first three customers get design-partner pricing. Monitoring is a monthly subscription, reports are priced per
|
|
263
|
+
release, and custom checks are fixed-scope work quoted up front. Details are in [docs/MANAGED.md](docs/MANAGED.md). To get
|
|
264
|
+
in touch, open a [Managed services enquiry](https://github.com/atsp-protocol/x402-conformance/issues/new?template=managed-services.yml)
|
|
265
|
+
or email data@optitransfer.ch.
|
|
266
|
+
|
|
267
|
+
## Safety
|
|
268
|
+
|
|
269
|
+
The suite holds no keys of yours and never signs or pays. Live mode is GET-only, and that's tested. The devnet
|
|
270
|
+
runner refuses mainnet and any third-party facilitator without written permission.
|
|
271
|
+
|
|
272
|
+
## Security
|
|
273
|
+
|
|
274
|
+
Please report vulnerabilities through GitHub private vulnerability reporting
|
|
275
|
+
([Security → Report a vulnerability](https://github.com/atsp-protocol/x402-conformance/security/advisories/new)), not in
|
|
276
|
+
a public issue. When the suite finds a failing safety check in someone else's facilitator, I tell the operator
|
|
277
|
+
privately first. The full policy is in [SECURITY.md](SECURITY.md).
|
|
278
|
+
|
|
279
|
+
## Contributing
|
|
280
|
+
|
|
281
|
+
Issues and pull requests are welcome, and new checks especially. Propose one with the check-proposal issue template,
|
|
282
|
+
quoting the x402 spec text it rests on. Every check needs a test that fails against a faulty double and passes against
|
|
283
|
+
the reference. [CONTRIBUTING.md](CONTRIBUTING.md) lists the local checks to run before you push, and everyone taking
|
|
284
|
+
part follows the [Code of Conduct](CODE_OF_CONDUCT.md). Changes are listed in [CHANGELOG.md](CHANGELOG.md).
|
|
285
|
+
|
|
286
|
+
## Licence
|
|
287
|
+
|
|
288
|
+
Apache-2.0. See [LICENSE](LICENSE) and [NOTICE](NOTICE) (Ryan Gillespie / Optitransfer).
|