zerynex-python 0.2.0__py3-none-any.whl

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.
@@ -0,0 +1,287 @@
1
+ Metadata-Version: 2.4
2
+ Name: zerynex-python
3
+ Version: 0.2.0
4
+ Summary: Local Zcash PCZT developer toolkit: privacy policy analysis, synthetic MCP integrations, refund risk checks and infrastructure adapters
5
+ License-Expression: MIT
6
+ Project-URL: Homepage, https://zerynex.vercel.app
7
+ Project-URL: Documentation, https://zerynex.vercel.app/docs
8
+ Project-URL: Repository, https://github.com/Oluwa-Laughter/zerynex
9
+ Project-URL: Issues, https://github.com/Oluwa-Laughter/zerynex/issues
10
+ Keywords: zcash,privacy,pczt,cryptography,developer-tools
11
+ Classifier: Programming Language :: Python :: 3
12
+ Classifier: Programming Language :: Python :: 3 :: Only
13
+ Classifier: Topic :: Software Development :: Libraries :: Python Modules
14
+ Requires-Python: >=3.11
15
+ Description-Content-Type: text/markdown
16
+ License-File: LICENSE
17
+ Provides-Extra: mcp
18
+ Requires-Dist: mcp<3,>=2; extra == "mcp"
19
+ Provides-Extra: dev
20
+ Requires-Dist: pytest>=8; extra == "dev"
21
+ Dynamic: license-file
22
+
23
+ # zerynex-python
24
+
25
+ Python 3.11+ adapter for **local Rust-backed** Zcash PCZT privacy analysis.
26
+ This package is not yet published on PyPI. A source-free wheel has been
27
+ built and tested in a clean Python virtualenv against the real Rust CLI.
28
+ See [release artifact downloads](https://zerynex.vercel.app/docs/releases).
29
+
30
+ ## Installation from this checkout
31
+
32
+ First compile the Rust CLI:
33
+
34
+ cargo build --locked --release
35
+
36
+ Then install the Python SDK from the repo:
37
+
38
+ python -m venv .venv
39
+ .venv/bin/python -m pip install ./packages/python
40
+
41
+ Or with uv:
42
+
43
+ uv pip install ./packages/python
44
+
45
+ Pass the trusted Rust executable explicitly:
46
+
47
+ from pathlib import Path
48
+ from zerynex_py import ZerynexClient, Policy
49
+
50
+ client = ZerynexClient(cli=Path("./target/release/zerynex"))
51
+ result = client.analyze_file(
52
+ "apps/web/public/examples/transparent-v6.bin",
53
+ Policy(deny_transparent=True),
54
+ )
55
+ print(result.agent_summary())
56
+
57
+ The sample should flag a transparent output using the same Rust rules as the
58
+ Next.js Studio, Rust CLI and TypeScript SDK.
59
+
60
+ ## Installable offline RPC contract checker
61
+
62
+ The Python wheel also installs `zerynex-rpc-check`, a standalone **offline**
63
+ OpenRPC compatibility checker. It does not require the Rust executable,
64
+ connect to Zallet, or process PCZT bytes. Only method names and argument
65
+ requirements from explicitly selected local JSON files are compared:
66
+
67
+ ```bash
68
+ zerynex-rpc-check \
69
+ --schema tests/fixtures/rpc/zallet-pczt-lifecycle-synthetic-openrpc.json \
70
+ --contract tests/fixtures/rpc/zallet-pczt-lifecycle-contract.json \
71
+ --deny-new-required --json
72
+ ```
73
+
74
+ The fixture is synthetic, not a capture from an upstream Zallet release.
75
+ Exit codes: `0` pass, `1` invalid input, `2` contract drift.
76
+ For production integrations, pin an actual Zallet release and inspect its
77
+ protected local `rpc.discover` response instead. See `docs/rpc-contracts.md`.
78
+
79
+ ## Installable local PCZT producer-fixture checker
80
+
81
+ The wheel also installs `zerynex-zallet-fixture-check`. Supply a protected
82
+ local manifest and canonical base64 `.b64` PCZT fixtures, plus the trusted
83
+ Rust CLI path:
84
+
85
+ ```bash
86
+ zerynex-zallet-fixture-check \
87
+ --manifest /protected/local/manifest.json --cli /absolute/path/to/zerynex
88
+ ```
89
+
90
+ The command checks file digests and exact policy findings without an RPC or
91
+ network connection. Its producer release label is supplied by the manifest
92
+ author, not authenticated by Zerynex. The clean-wheel consumer test uses
93
+ synthetic PCZTs, so it does not establish live Zallet compatibility. See
94
+ `docs/zallet-pczt-handoff.md` for the manifest and exit codes.
95
+
96
+ ## Agent/MCP extra
97
+
98
+ pip install './packages/python[mcp]'
99
+
100
+ Use the **local-only** MCP server after specifying a dedicated sandbox directory
101
+ containing synthetic fixtures:
102
+
103
+ ZERYNEX_CLI=/absolute/path/to/zerynex
104
+ ZERYNEX_AGENT_ALLOWED_ROOT=/absolute/path/to/synthetic-fixtures
105
+ zerynex-mcp
106
+
107
+ Run a real local stdio MCP diagnostic before connecting an AI assistant:
108
+
109
+ zerynex-mcp-doctor --server /abs/path/to/zerynex-mcp --cli /abs/path/to/zerynex --fixtures /abs/path/to/synthetic-fixtures
110
+
111
+ It discovers twelve tools, checks four Rust-backed synthetic PCZT expectations, and verifies the unified developer preflight, bundled refund scenarios, and an expected RPC regression.
112
+ Exit 0 means all matched, 1 means setup failed, 2 means a test mismatched.
113
+ The public /agents frontend also generates client-specific configuration
114
+ for common MCP hosts; it does not execute the MCP process in-browser.
115
+
116
+ The MCP server exposes strictly read-only policy checks through stdio. It
117
+ accepts only simple fixture filenames inside the configured directory. It
118
+ never reads arbitrary host paths or sends PCZT bytes to the model. The
119
+ underlying Rust process may inspect the bytes locally.
120
+
121
+ ## Security
122
+
123
+ This package has no direct network operations, agent LLM calls, signers or
124
+ custody code. The analyzer output contains only the limited rule IDs and
125
+ field paths enforced by Rust. The user controls which executable is trusted.
126
+
127
+ Future direction: use PyO3/maturin to ship native wheels based on the same
128
+ Rust core, avoiding the CLI dependency. This is not implemented yet.
129
+
130
+ ## Z3 local diagnostics
131
+
132
+ Use zerynex-z3-check to probe only Zebra's documented loopback-bound
133
+ /healthy and /ready endpoints:
134
+
135
+ zerynex-z3-check --host 127.0.0.1 --port 8080
136
+
137
+ See docs/z3-local.md. This checks two readiness signals only, not Zcash
138
+ consensus, Zallet wallet operation or Zaino gRPC.
139
+
140
+ ## Consume a locally held Zallet PCZT without a temporary file
141
+
142
+ For a trusted application with an in-memory base64 PCZT string:
143
+
144
+ from zerynex_py import ZerynexClient, Policy
145
+ result = ZerynexClient(cli="/path/to/zerynex").analyze_base64(
146
+ pczt_base64, Policy(deny_transparent=True)
147
+ )
148
+
149
+ The Python adapter passes the encoded bytes over Rust CLI stdin and only
150
+ returns sanitized report fields. Do not provide confidential intermediates
151
+ to a cloud agent or to CI. See docs/zallet-pczt-handoff.md.
152
+
153
+ ## Compare PCZT role handoffs
154
+
155
+ result = client.compare_files(
156
+ "path/to/before-synthetic.pczt",
157
+ "path/to/after-synthetic.pczt",
158
+ Policy(deny_transparent=True),
159
+ )
160
+ print(result.agent_summary())
161
+
162
+ This produces rule and pool-component differences using the same local
163
+ Rust engine. Not a transaction equivalence or proof validator.
164
+ See docs/pczt-stage-regression.md.
165
+
166
+ ## Real MCP developer workflows
167
+
168
+ Nine read-only tools are available through the official MCP protocol:
169
+ analyze_synthetic_pczt, compare_synthetic_pczt_stages,
170
+ list_synthetic_fixtures, explain_zerynex_rule,
171
+ run_synthetic_smoke_suite, zerynex_policy_schema,
172
+ zerynex_core_capabilities, check_synthetic_zallet_rpc_contract,
173
+ run_zerynex_developer_preflight, and zerynex_rule_catalog.
174
+
175
+ A tested host workflow can list allowed .bin fixtures, analyze a synthetic
176
+ transparent output, explain the corresponding privacy rule, and compare
177
+ clean and flagged fixture stages. The smoke suite checks four fixed
178
+ expected outcomes through real Rust CLI calls, not mocked reports.
179
+ For instructions and security boundaries see docs/agents.md.
180
+
181
+ ## Discover CLI support before integrating
182
+
183
+ The trusted local CLI exposes versioned JSON without reading PCZT contents:
184
+
185
+ ```python
186
+ from zerynex_py import ZerynexClient
187
+
188
+ client = ZerynexClient(cli="/absolute/path/to/zerynex")
189
+ caps = client.capabilities()
190
+ print(caps.version, caps.operations, caps.max_decoded_pczt_bytes)
191
+ ```
192
+
193
+ The wrapper rejects unsupported capability versions and unsafe output. This does not imply any live Zallet wallet or network compatibility. See `docs/cli-capabilities.md`.
194
+
195
+ ## Unified CLI + MCP + agent preflight
196
+
197
+ ```bash
198
+ zerynex-agent-preflight --cli /absolute/path/to/zerynex \
199
+ --fixtures /absolute/path/to/approved-synthetic-fixtures --json
200
+ ```
201
+
202
+ The command works without MCP or network dependencies. It checks the installed
203
+ Rust CLI's capabilities, four real synthetic PCZT invariants and a bundled
204
+ Zallet-style synthetic RPC contract. Exit codes: pass `0`, input/error `1`,
205
+ regression mismatch `2`. The agent MCP tools use the same implementation,
206
+ including a fixed RPC regression scenario menu with **no arbitrary files**.
207
+ See `docs/agents.md` for the trust boundaries.
208
+
209
+ ## Read-only local Zcash node readiness
210
+
211
+ `zerynex-node-check --host 127.0.0.1 --port 8232 --expect-network test`
212
+ reads one local `getblockchaininfo` response and emits only network/sync readiness
213
+ fields. Use `--cookie-file /path/to/owner-private/.cookie` for nodes requiring
214
+ RPC authentication. It never takes a password in argv, connects to public
215
+ hosts, or exposes arbitrary wallet RPCs.
216
+
217
+ Python applications may use `inspect_node_local()` or pass an already obtained
218
+ response to `evaluate_blockchain_info()`. The pure `evaluate_blockchain_info()`
219
+ function has no network dependency. A lack of sync/status fields fails closed.
220
+ See `docs/node-readiness.md` for API examples and limitations.
221
+
222
+ ## Project bootstrap (offline)
223
+
224
+ The wheel installs `zerynex-project`. This command creates an integration
225
+ inside an existing Zcash application rather than connecting this website to
226
+ a developer machine:
227
+
228
+ ```bash
229
+ zerynex-project init --project /absolute/path/to/my-zcash-app --ci --json
230
+ zerynex-project verify --project /absolute/path/to/my-zcash-app --cli /absolute/path/to/zerynex --json
231
+ ```
232
+
233
+ Initialization refuses existing files and symlinked destination directories,
234
+ and creates only a reviewed policy, manifest, bundled nonspendable synthetic
235
+ PCZT fixtures and optional GitHub Action pinned to an immutable commit.
236
+ Verification checks those bytes and executes the **actual local Rust CLI**
237
+ against both fixtures. Passing proves only the local toolchain's expected
238
+ synthetic behavior, not wallet connectivity, chain consensus or anonymity.
239
+ No private PCZT, signing key, RPC endpoint or wallet connection is accessed.
240
+
241
+ ### Explicit project PCZT policy checks
242
+
243
+ After `init`, developers can opt in to analyzing an actual local PCZT.
244
+ These commands **never discover** private files, use the network, or
245
+ automatically change a wallet transaction. `--pczt`, `--before` and
246
+ `--after` must be existing, regular files **inside** the selected project.
247
+
248
+ ```bash
249
+ zerynex-project check --project /path/to/app --pczt data/my.pczt --cli /path/to/zerynex --json
250
+ zerynex-project compare --project /path/to/app --before data/unsigned.pczt --after data/signed.pczt --cli /path/to/zerynex --json
251
+ ```
252
+
253
+ `check` uses the project's strict `.zerynex/policy.json`, which the
254
+ developer may customize, and returns only a result, finding count and
255
+ recognized rule IDs. `compare` returns before/after counts and added or
256
+ resolved known rule IDs, without exporting PCZT field contents.
257
+ Exit code `0` means no selected policy findings/regressions,
258
+ `2` means findings, and `1` means invalid input or execution failure.
259
+ Use a trusted local workspace and CLI. Do not put real private PCZTs into
260
+ public CI, browser demos, external MCP hosts, or logs.
261
+
262
+ ## Swap refund and viewing-key privacy metadata audit
263
+
264
+ The installed `zerynex-refund-audit` command checks a strict, local JSON manifest of **opaque non-secret identifiers**, not Zcash addresses or keys. Its static findings cover refund-address reuse, shared viewing-key scope, public refund exposure, refund query disclosure and unsupported custody assertions. This is a threat-model integration aid, not a post-quantum cryptography implementation or real wallet inspection. See `docs/refund-privacy-audit.md` for schema, examples and limitations.
265
+
266
+
267
+ ### Compare refund integration revisions
268
+
269
+ Use `zerynex-refund-audit --baseline /path/to/before.json --manifest /path/to/after.json --json` to detect **new per-flow** exposure declarations. A newly affected flow triggers a regression even if the same rule ID already applied to another flow. Exit `0` means no *new* declared risk events, exit `2` means new events, and exit `1` is invalid input. No private values or flow references are returned. Source manifests must contain **non-secret metadata only**. This does not attest wallet isolation or quantum safety. See `docs/refund-privacy-audit.md`.
270
+
271
+
272
+ The packaged refund-audit SDK also exports `audit_manifest`, `compare_manifests`, `sarif_report` and `RefundAuditInputError`. Add `--sarif` instead of `--json` when integrating with SARIF-capable tooling. The exported SARIF contains no source locations or opaque references and only covers **declared** risk categories.
273
+
274
+
275
+ ## Refund privacy checks for local MCP agents
276
+
277
+ The optional read-only MCP server exposes
278
+ `audit_synthetic_refund_privacy(scenario)` and
279
+ `compare_synthetic_refund_privacy(baseline, candidate)`. Only the three
280
+ bundled scenario names `isolated`, `risky` and `regression-expanded`
281
+ are accepted; arbitrary paths and JSON are denied. The packaged
282
+ `zerynex-agent-preflight` verifies six offline, synthetic refund-privacy
283
+ expectations and the MCP doctor checks these tools via a real stdio host.
284
+ Agents never receive viewing keys, wallet data, refund addresses or flow
285
+ identifiers, and a passing synthetic declaration is **not** a post-quantum
286
+ privacy certification. For actual application-owned, public-safe metadata
287
+ use the standalone `zerynex-refund-audit` CLI in a trusted environment.
@@ -0,0 +1,28 @@
1
+ zerynex_py/__init__.py,sha256=K_HzBDFkTzlMR8UbTj0obznoD_UKayDS2dcMjuV9h2w,993
2
+ zerynex_py/agent_workflows.py,sha256=hnWGwjCE4jyoZha362GzIFGgL12RGtAQIsLqY4uwdfg,5959
3
+ zerynex_py/client.py,sha256=ZdbBcOF6Qch6eKzWUpjyky2qjjfNiDJHhOC7iPSV8yU,18374
4
+ zerynex_py/mcp_doctor.py,sha256=gE6X0S_6vrxTFQYIN6ePsU2WI5nsr7DazHPW4s9AosA,8435
5
+ zerynex_py/mcp_server.py,sha256=RGosdtYng8fY26oxp_nHbB0jdOgufLxNi8_4EpGW_Sc,16416
6
+ zerynex_py/node.py,sha256=0SPRrLFkZDVSaV-V9nbk25EvjUQjZMHQZvtYcBnR_qE,9224
7
+ zerynex_py/preflight.py,sha256=sEIIwqorLHDcvqSMbtBWUGPX_6F5I2jHgEdv4yF5EbY,2095
8
+ zerynex_py/project.py,sha256=aqX77tQQpExQqFZ4Q9XvJQc2xmGeXUDqyW5tdiMKisw,15621
9
+ zerynex_py/refund_privacy.py,sha256=EkJaMGYK_J_1B5yyai1RVTkag8lzSAoWf__531mjnnA,11807
10
+ zerynex_py/refund_workflows.py,sha256=hXszKvcc-hylxpXHk_lb46P1D9WABlS6_ENrbYND9fc,4453
11
+ zerynex_py/rpc_contract.py,sha256=u6MIQxuez59-39eosjBjy5xNB3DM3GzLZDcuc_At-dk,7823
12
+ zerynex_py/rules.py,sha256=L6I0WxvMUfe-yzma11Ub6OfHQccy7bvmB4Dc25BU2Tg,2870
13
+ zerynex_py/z3.py,sha256=CvlyG5WQdH_eq3rRUqRBAqgAc3xrL4ehhb95k198YIE,4277
14
+ zerynex_py/zallet_fixture.py,sha256=D9QmCsNLF1Kl0CZ12v0CS_dFzlYFLkTlSTbbpenD79o,7352
15
+ zerynex_py/fixtures/clean-v6.bin,sha256=8-e2p4yrMYh3_ieawxtcTfwAPxdUcqPbWl-gFG2q8DU,29
16
+ zerynex_py/fixtures/refund-isolated.json,sha256=ppGAJydfmM6KqI4eXnuzo9sn2QRI1I-eCe_5hMSwPIw,673
17
+ zerynex_py/fixtures/refund-regression-expanded.json,sha256=indkgYKIkvobYq1ztwt4Xb5ruJ8h5fwZObTQ4COMRaI,965
18
+ zerynex_py/fixtures/refund-risky.json,sha256=u2majRErFnwGeautx_hwJ-Ff9OVJRYea9oi47pZQPfc,658
19
+ zerynex_py/fixtures/rule-catalog.json,sha256=LqMU2-AQIedGQScpSvJYYHr173HIm1ktoNRzgN5qw-Q,3024
20
+ zerynex_py/fixtures/transparent-v6.bin,sha256=2QI5ZzCCWfXs6Kqg_p2yBop5uXWWIuFrBTkEsbhwfpE,37
21
+ zerynex_py/fixtures/zallet-pczt-lifecycle-contract.json,sha256=6t8-ps8MJEySr13BVG1sydpHhfTFohg6hKoEZEXVGlY,1431
22
+ zerynex_py/fixtures/zallet-pczt-lifecycle-synthetic-openrpc.json,sha256=gvljxiAB8cIm0-pNUH2X1U3q3hCy0UdPxEEmbceolsE,2328
23
+ zerynex_python-0.2.0.dist-info/licenses/LICENSE,sha256=WA3tufJKgdDdJR16YhggNHN_S-rSUpOet8rghhbxV1A,1077
24
+ zerynex_python-0.2.0.dist-info/METADATA,sha256=ZonLDFWjCiUuc0_4lsUbioK8_ZB3wXIjJ9e3RFgPsZQ,13116
25
+ zerynex_python-0.2.0.dist-info/WHEEL,sha256=mOdXR9C3wMVov7cSY8PY-XCzo3SmmWCHvGQr5csJoao,91
26
+ zerynex_python-0.2.0.dist-info/entry_points.txt,sha256=ORlLCYxacLNlh4ooIvzjYwbe_jyQUutPSNhW8_WXnro,446
27
+ zerynex_python-0.2.0.dist-info/top_level.txt,sha256=g6R9lY-tlLk1kwuiAc9A2Gld27HZUtriTr7aOpB-oAw,11
28
+ zerynex_python-0.2.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (84.2.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,10 @@
1
+ [console_scripts]
2
+ zerynex-agent-preflight = zerynex_py.preflight:main
3
+ zerynex-mcp = zerynex_py.mcp_server:main
4
+ zerynex-mcp-doctor = zerynex_py.mcp_doctor:main
5
+ zerynex-node-check = zerynex_py.node:main
6
+ zerynex-project = zerynex_py.project:main
7
+ zerynex-refund-audit = zerynex_py.refund_privacy:main
8
+ zerynex-rpc-check = zerynex_py.rpc_contract:main
9
+ zerynex-z3-check = zerynex_py.z3:main
10
+ zerynex-zallet-fixture-check = zerynex_py.zallet_fixture:main
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2026 Zerynex contributors
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
@@ -0,0 +1 @@
1
+ zerynex_py