wallet-privacy-testkit 0.1.0__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.
- wallet_privacy_testkit-0.1.0/.github/workflows/ci.yml +31 -0
- wallet_privacy_testkit-0.1.0/.github/workflows/publish.yml +39 -0
- wallet_privacy_testkit-0.1.0/CHANGELOG.md +13 -0
- wallet_privacy_testkit-0.1.0/CITATION.cff +11 -0
- wallet_privacy_testkit-0.1.0/CONTRIBUTING.md +25 -0
- wallet_privacy_testkit-0.1.0/LICENSE-APACHE +201 -0
- wallet_privacy_testkit-0.1.0/LICENSE-MIT +21 -0
- wallet_privacy_testkit-0.1.0/MANIFEST.in +14 -0
- wallet_privacy_testkit-0.1.0/PKG-INFO +145 -0
- wallet_privacy_testkit-0.1.0/README.md +117 -0
- wallet_privacy_testkit-0.1.0/SECURITY.md +15 -0
- wallet_privacy_testkit-0.1.0/docs/COMPETITIVE_LANDSCAPE.md +48 -0
- wallet_privacy_testkit-0.1.0/docs/METHODOLOGY.md +60 -0
- wallet_privacy_testkit-0.1.0/docs/RELEASE_CHECKLIST.md +44 -0
- wallet_privacy_testkit-0.1.0/docs/RELEASE_NOTES.md +19 -0
- wallet_privacy_testkit-0.1.0/docs/THREAT_MODEL.md +36 -0
- wallet_privacy_testkit-0.1.0/evidence/zingolib-v5-regtest/REPORT.md +43 -0
- wallet_privacy_testkit-0.1.0/evidence/zingolib-v5-regtest/provenance.json +39 -0
- wallet_privacy_testkit-0.1.0/evidence/zingolib-v5-regtest/verified.json +41 -0
- wallet_privacy_testkit-0.1.0/examples/size-samples.json +9 -0
- wallet_privacy_testkit-0.1.0/examples/zingolib/README.md +29 -0
- wallet_privacy_testkit-0.1.0/pyproject.toml +40 -0
- wallet_privacy_testkit-0.1.0/requirements-dev.txt +8 -0
- wallet_privacy_testkit-0.1.0/scripts/release_audit.py +198 -0
- wallet_privacy_testkit-0.1.0/setup.cfg +4 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/__init__.py +3 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/__main__.py +3 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/capture.py +213 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/cli.py +147 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/fault_relay.py +155 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/matching.py +84 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit/protocol.py +33 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/PKG-INFO +145 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/SOURCES.txt +41 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/dependency_links.txt +1 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/entry_points.txt +2 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/requires.txt +2 -0
- wallet_privacy_testkit-0.1.0/src/wallet_privacy_testkit.egg-info/top_level.txt +1 -0
- wallet_privacy_testkit-0.1.0/tests/test_capture.py +112 -0
- wallet_privacy_testkit-0.1.0/tests/test_cli.py +32 -0
- wallet_privacy_testkit-0.1.0/tests/test_fault_relay.py +100 -0
- wallet_privacy_testkit-0.1.0/tests/test_matching.py +59 -0
- wallet_privacy_testkit-0.1.0/tests/test_protocol.py +20 -0
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
name: ci
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
pull_request:
|
|
5
|
+
push:
|
|
6
|
+
|
|
7
|
+
permissions:
|
|
8
|
+
contents: read
|
|
9
|
+
|
|
10
|
+
jobs:
|
|
11
|
+
test:
|
|
12
|
+
strategy:
|
|
13
|
+
fail-fast: false
|
|
14
|
+
matrix:
|
|
15
|
+
python-version: ["3.11", "3.12", "3.13"]
|
|
16
|
+
os: [ubuntu-latest, macos-latest]
|
|
17
|
+
runs-on: ${{ matrix.os }}
|
|
18
|
+
steps:
|
|
19
|
+
- uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
20
|
+
- uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v6.2.0
|
|
21
|
+
with:
|
|
22
|
+
python-version: ${{ matrix.python-version }}
|
|
23
|
+
cache: pip
|
|
24
|
+
- run: python -m pip install -r requirements-dev.txt
|
|
25
|
+
- run: python -m pip install pip-audit==2.10.1
|
|
26
|
+
- run: python -m pip install --no-deps -e .
|
|
27
|
+
- run: python -m unittest discover -s tests -v
|
|
28
|
+
- run: python -m pip_audit -r requirements-dev.txt
|
|
29
|
+
- run: python scripts/release_audit.py
|
|
30
|
+
- run: python -m build
|
|
31
|
+
- run: python scripts/release_audit.py --artifacts
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
name: publish
|
|
2
|
+
|
|
3
|
+
on:
|
|
4
|
+
workflow_dispatch:
|
|
5
|
+
release:
|
|
6
|
+
types: [published]
|
|
7
|
+
|
|
8
|
+
permissions:
|
|
9
|
+
contents: read
|
|
10
|
+
|
|
11
|
+
concurrency:
|
|
12
|
+
group: pypi-publish
|
|
13
|
+
cancel-in-progress: false
|
|
14
|
+
|
|
15
|
+
jobs:
|
|
16
|
+
pypi:
|
|
17
|
+
if: vars.PYPI_PUBLISH_ENABLED == 'true' && startsWith(github.ref, 'refs/tags/v')
|
|
18
|
+
runs-on: ubuntu-latest
|
|
19
|
+
environment:
|
|
20
|
+
name: pypi
|
|
21
|
+
url: https://pypi.org/p/wallet-privacy-testkit
|
|
22
|
+
permissions:
|
|
23
|
+
contents: read
|
|
24
|
+
id-token: write
|
|
25
|
+
steps:
|
|
26
|
+
- name: Check out the tagged checksum
|
|
27
|
+
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6
|
|
28
|
+
with:
|
|
29
|
+
ref: ${{ github.ref }}
|
|
30
|
+
- name: Download reviewed release files
|
|
31
|
+
env:
|
|
32
|
+
GH_TOKEN: ${{ github.token }}
|
|
33
|
+
run: |
|
|
34
|
+
mkdir dist
|
|
35
|
+
gh release download "$GITHUB_REF_NAME" --pattern '*.whl' --pattern '*.tar.gz' --dir dist
|
|
36
|
+
- name: Verify release checksums
|
|
37
|
+
run: sha256sum --check SHA256SUMS
|
|
38
|
+
- name: Publish to PyPI with attestations
|
|
39
|
+
uses: pypa/gh-action-pypi-publish@dc37677b2e1c63e2034f94d8a5b11f265b73ba33 # v1.14.2
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## 0.1.0 - 2026-09-05
|
|
4
|
+
|
|
5
|
+
- Added a metadata-only TLS record forwarder and trace validator.
|
|
6
|
+
- Added three protocol-aware `SendTransaction` delivery fault modes.
|
|
7
|
+
- Added conservative size matching with fractional tie credit.
|
|
8
|
+
- Added unit and local integration tests for byte preservation, fault boundaries, retry identity, and invalid analyses.
|
|
9
|
+
- Validated relay method cardinalities against `lightwallet-protocol` v0.5.0 and tightened CLI and matcher input checks.
|
|
10
|
+
- Updated the build tool after an advisory audit and added audited, attested PyPI trusted publishing.
|
|
11
|
+
- Added a sanitized, independently verified Zingolib v5 regtest case study.
|
|
12
|
+
- Repeated the acknowledgement-loss case with the installed release wheel and a fresh real regtest transaction.
|
|
13
|
+
- Documented the threat model, methodology, project overlap, release process, and contribution boundaries.
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
cff-version: 1.2.0
|
|
2
|
+
message: "If this testkit or its case study supports your work, cite this software release."
|
|
3
|
+
title: "Wallet Privacy Testkit for Zcash"
|
|
4
|
+
version: 0.1.0
|
|
5
|
+
date-released: 2026-09-05
|
|
6
|
+
license: "MIT OR Apache-2.0"
|
|
7
|
+
type: software
|
|
8
|
+
repository-code: "https://github.com/ztsalexey/wallet-privacy-testkit"
|
|
9
|
+
url: "https://github.com/ztsalexey/wallet-privacy-testkit"
|
|
10
|
+
authors:
|
|
11
|
+
- name: "Wallet Privacy Testkit contributors"
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
# Contributing
|
|
2
|
+
|
|
3
|
+
Open an issue before implementing a new wallet adapter, protocol method, or privacy claim. Describe the observer, the information available to it, the candidate set, the expected wallet state, and how the result will be falsified.
|
|
4
|
+
|
|
5
|
+
Contributions must:
|
|
6
|
+
|
|
7
|
+
- use disposable wallets and regtest or another isolated network;
|
|
8
|
+
- avoid committing seeds, private keys, raw signed transactions, or identifying captures;
|
|
9
|
+
- preserve ties and failed observations in analysis;
|
|
10
|
+
- distinguish a controlled fault from an observed production failure;
|
|
11
|
+
- add tests for any new fault boundary or metric;
|
|
12
|
+
- update the threat model when assumptions change.
|
|
13
|
+
|
|
14
|
+
Run the checks from the repository root:
|
|
15
|
+
|
|
16
|
+
```sh
|
|
17
|
+
python -m unittest discover -s tests -v
|
|
18
|
+
python scripts/release_audit.py
|
|
19
|
+
python -m build
|
|
20
|
+
```
|
|
21
|
+
|
|
22
|
+
Use the style already present in the package. Keep the core independent of a particular wallet's state format and place integration-specific instructions under `examples/`.
|
|
23
|
+
|
|
24
|
+
Before proposing a change to another repository, follow that repository's issue and contribution process. Do not send a stream of unsolicited wallet PRs from this project.
|
|
25
|
+
|
|
@@ -0,0 +1,201 @@
|
|
|
1
|
+
Apache License
|
|
2
|
+
Version 2.0, January 2004
|
|
3
|
+
http://www.apache.org/licenses/
|
|
4
|
+
|
|
5
|
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
|
6
|
+
|
|
7
|
+
1. Definitions.
|
|
8
|
+
|
|
9
|
+
"License" shall mean the terms and conditions for use, reproduction,
|
|
10
|
+
and distribution as defined by Sections 1 through 9 of this document.
|
|
11
|
+
|
|
12
|
+
"Licensor" shall mean the copyright owner or entity authorized by
|
|
13
|
+
the copyright owner that is granting the License.
|
|
14
|
+
|
|
15
|
+
"Legal Entity" shall mean the union of the acting entity and all
|
|
16
|
+
other entities that control, are controlled by, or are under common
|
|
17
|
+
control with that entity. For the purposes of this definition,
|
|
18
|
+
"control" means (i) the power, direct or indirect, to cause the
|
|
19
|
+
direction or management of such entity, whether by contract or
|
|
20
|
+
otherwise, or (ii) ownership of fifty percent (50%) or more of the
|
|
21
|
+
outstanding shares, or (iii) beneficial ownership of such entity.
|
|
22
|
+
|
|
23
|
+
"You" (or "Your") shall mean an individual or Legal Entity
|
|
24
|
+
exercising permissions granted by this License.
|
|
25
|
+
|
|
26
|
+
"Source" form shall mean the preferred form for making modifications,
|
|
27
|
+
including but not limited to software source code, documentation
|
|
28
|
+
source, and configuration files.
|
|
29
|
+
|
|
30
|
+
"Object" form shall mean any form resulting from mechanical
|
|
31
|
+
transformation or translation of a Source form, including but
|
|
32
|
+
not limited to compiled object code, generated documentation,
|
|
33
|
+
and conversions to other media types.
|
|
34
|
+
|
|
35
|
+
"Work" shall mean the work of authorship, whether in Source or
|
|
36
|
+
Object form, made available under the License, as indicated by a
|
|
37
|
+
copyright notice that is included in or attached to the work
|
|
38
|
+
(an example is provided in the Appendix below).
|
|
39
|
+
|
|
40
|
+
"Derivative Works" shall mean any work, whether in Source or Object
|
|
41
|
+
form, that is based on (or derived from) the Work and for which the
|
|
42
|
+
editorial revisions, annotations, elaborations, or other modifications
|
|
43
|
+
represent, as a whole, an original work of authorship. For the purposes
|
|
44
|
+
of this License, Derivative Works shall not include works that remain
|
|
45
|
+
separable from, or merely link (or bind by name) to the interfaces of,
|
|
46
|
+
the Work and Derivative Works thereof.
|
|
47
|
+
|
|
48
|
+
"Contribution" shall mean any work of authorship, including
|
|
49
|
+
the original version of the Work and any modifications or additions
|
|
50
|
+
to that Work or Derivative Works thereof, that is intentionally
|
|
51
|
+
submitted to Licensor for inclusion in the Work by the copyright owner
|
|
52
|
+
or by an individual or Legal Entity authorized to submit on behalf of
|
|
53
|
+
the copyright owner. For the purposes of this definition, "submitted"
|
|
54
|
+
means any form of electronic, verbal, or written communication sent
|
|
55
|
+
to the Licensor or its representatives, including but not limited to
|
|
56
|
+
communication on electronic mailing lists, source code control systems,
|
|
57
|
+
and issue tracking systems that are managed by, or on behalf of, the
|
|
58
|
+
Licensor for the purpose of discussing and improving the Work, but
|
|
59
|
+
excluding communication that is conspicuously marked or otherwise
|
|
60
|
+
designated in writing by the copyright owner as "Not a Contribution."
|
|
61
|
+
|
|
62
|
+
"Contributor" shall mean Licensor and any individual or Legal Entity
|
|
63
|
+
on behalf of whom a Contribution has been received by Licensor and
|
|
64
|
+
subsequently incorporated within the Work.
|
|
65
|
+
|
|
66
|
+
2. Grant of Copyright License. Subject to the terms and conditions of
|
|
67
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
68
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
69
|
+
copyright license to reproduce, prepare Derivative Works of,
|
|
70
|
+
publicly display, publicly perform, sublicense, and distribute the
|
|
71
|
+
Work and such Derivative Works in Source or Object form.
|
|
72
|
+
|
|
73
|
+
3. Grant of Patent License. Subject to the terms and conditions of
|
|
74
|
+
this License, each Contributor hereby grants to You a perpetual,
|
|
75
|
+
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
|
|
76
|
+
(except as stated in this section) patent license to make, have made,
|
|
77
|
+
use, offer to sell, sell, import, and otherwise transfer the Work,
|
|
78
|
+
where such license applies only to those patent claims licensable
|
|
79
|
+
by such Contributor that are necessarily infringed by their
|
|
80
|
+
Contribution(s) alone or by combination of their Contribution(s)
|
|
81
|
+
with the Work to which such Contribution(s) was submitted. If You
|
|
82
|
+
institute patent litigation against any entity (including a
|
|
83
|
+
cross-claim or counterclaim in a lawsuit) alleging that the Work
|
|
84
|
+
or a Contribution incorporated within the Work constitutes direct
|
|
85
|
+
or contributory patent infringement, then any patent licenses
|
|
86
|
+
granted to You under this License for that Work shall terminate
|
|
87
|
+
as of the date such litigation is filed.
|
|
88
|
+
|
|
89
|
+
4. Redistribution. You may reproduce and distribute copies of the
|
|
90
|
+
Work or Derivative Works thereof in any medium, with or without
|
|
91
|
+
modifications, and in Source or Object form, provided that You
|
|
92
|
+
meet the following conditions:
|
|
93
|
+
|
|
94
|
+
(a) You must give any other recipients of the Work or
|
|
95
|
+
Derivative Works a copy of this License; and
|
|
96
|
+
|
|
97
|
+
(b) You must cause any modified files to carry prominent notices
|
|
98
|
+
stating that You changed the files; and
|
|
99
|
+
|
|
100
|
+
(c) You must retain, in the Source form of any Derivative Works
|
|
101
|
+
that You distribute, all copyright, patent, trademark, and
|
|
102
|
+
attribution notices from the Source form of the Work,
|
|
103
|
+
excluding those notices that do not pertain to any part of
|
|
104
|
+
the Derivative Works; and
|
|
105
|
+
|
|
106
|
+
(d) If the Work includes a "NOTICE" text file as part of its
|
|
107
|
+
distribution, then any Derivative Works that You distribute must
|
|
108
|
+
include a readable copy of the attribution notices contained
|
|
109
|
+
within such NOTICE file, excluding those notices that do not
|
|
110
|
+
pertain to any part of the Derivative Works, in at least one
|
|
111
|
+
of the following places: within a NOTICE text file distributed
|
|
112
|
+
as part of the Derivative Works; within the Source form or
|
|
113
|
+
documentation, if provided along with the Derivative Works; or,
|
|
114
|
+
within a display generated by the Derivative Works, if and
|
|
115
|
+
wherever such third-party notices normally appear. The contents
|
|
116
|
+
of the NOTICE file are for informational purposes only and
|
|
117
|
+
do not modify the License. You may add Your own attribution
|
|
118
|
+
notices within Derivative Works that You distribute, alongside
|
|
119
|
+
or as an addendum to the NOTICE text from the Work, provided
|
|
120
|
+
that such additional attribution notices cannot be construed
|
|
121
|
+
as modifying the License.
|
|
122
|
+
|
|
123
|
+
You may add Your own copyright statement to Your modifications and
|
|
124
|
+
may provide additional or different license terms and conditions
|
|
125
|
+
for use, reproduction, or distribution of Your modifications, or
|
|
126
|
+
for any such Derivative Works as a whole, provided Your use,
|
|
127
|
+
reproduction, and distribution of the Work otherwise complies with
|
|
128
|
+
the conditions stated in this License.
|
|
129
|
+
|
|
130
|
+
5. Submission of Contributions. Unless You explicitly state otherwise,
|
|
131
|
+
any Contribution intentionally submitted for inclusion in the Work
|
|
132
|
+
by You to the Licensor shall be under the terms and conditions of
|
|
133
|
+
this License, without any additional terms or conditions.
|
|
134
|
+
Notwithstanding the above, nothing herein shall supersede or modify
|
|
135
|
+
the terms of any separate license agreement you may have executed
|
|
136
|
+
with Licensor regarding such Contributions.
|
|
137
|
+
|
|
138
|
+
6. Trademarks. This License does not grant permission to use the trade
|
|
139
|
+
names, trademarks, service marks, or product names of the Licensor,
|
|
140
|
+
except as required for reasonable and customary use in describing the
|
|
141
|
+
origin of the Work and reproducing the content of the NOTICE file.
|
|
142
|
+
|
|
143
|
+
7. Disclaimer of Warranty. Unless required by applicable law or
|
|
144
|
+
agreed to in writing, Licensor provides the Work (and each
|
|
145
|
+
Contributor provides its Contributions) on an "AS IS" BASIS,
|
|
146
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
|
147
|
+
implied, including, without limitation, any warranties or conditions
|
|
148
|
+
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
|
|
149
|
+
PARTICULAR PURPOSE. You are solely responsible for determining the
|
|
150
|
+
appropriateness of using or redistributing the Work and assume any
|
|
151
|
+
risks associated with Your exercise of permissions under this License.
|
|
152
|
+
|
|
153
|
+
8. Limitation of Liability. In no event and under no legal theory,
|
|
154
|
+
whether in tort (including negligence), contract, or otherwise,
|
|
155
|
+
unless required by applicable law (such as deliberate and grossly
|
|
156
|
+
negligent acts) or agreed to in writing, shall any Contributor be
|
|
157
|
+
liable to You for damages, including any direct, indirect, special,
|
|
158
|
+
incidental, or consequential damages of any character arising as a
|
|
159
|
+
result of this License or out of the use or inability to use the
|
|
160
|
+
Work (including but not limited to damages for loss of goodwill,
|
|
161
|
+
work stoppage, computer failure or malfunction, or any and all
|
|
162
|
+
other commercial damages or losses), even if such Contributor
|
|
163
|
+
has been advised of the possibility of such damages.
|
|
164
|
+
|
|
165
|
+
9. Accepting Warranty or Additional Liability. While redistributing
|
|
166
|
+
the Work or Derivative Works thereof, You may choose to offer,
|
|
167
|
+
and charge a fee for, acceptance of support, warranty, indemnity,
|
|
168
|
+
or other liability obligations and/or rights consistent with this
|
|
169
|
+
License. However, in accepting such obligations, You may act only
|
|
170
|
+
on Your own behalf and on Your sole responsibility, not on behalf
|
|
171
|
+
of any other Contributor, and only if You agree to indemnify,
|
|
172
|
+
defend, and hold each Contributor harmless for any liability
|
|
173
|
+
incurred by, or claims asserted against, such Contributor by reason
|
|
174
|
+
of your accepting any such warranty or additional liability.
|
|
175
|
+
|
|
176
|
+
END OF TERMS AND CONDITIONS
|
|
177
|
+
|
|
178
|
+
APPENDIX: How to apply the Apache License to your work.
|
|
179
|
+
|
|
180
|
+
To apply the Apache License to your work, attach the following
|
|
181
|
+
boilerplate notice, with the fields enclosed by brackets "[]"
|
|
182
|
+
replaced with your own identifying information. (Don't include
|
|
183
|
+
the brackets!) The text should be enclosed in the appropriate
|
|
184
|
+
comment syntax for the file format. We also recommend that a
|
|
185
|
+
file or class name and description of purpose be included on the
|
|
186
|
+
same "printed page" as the copyright notice for easier
|
|
187
|
+
identification within third-party archives.
|
|
188
|
+
|
|
189
|
+
Copyright 2026 Wallet Privacy Testkit contributors
|
|
190
|
+
|
|
191
|
+
Licensed under the Apache License, Version 2.0 (the "License");
|
|
192
|
+
you may not use this file except in compliance with the License.
|
|
193
|
+
You may obtain a copy of the License at
|
|
194
|
+
|
|
195
|
+
http://www.apache.org/licenses/LICENSE-2.0
|
|
196
|
+
|
|
197
|
+
Unless required by applicable law or agreed to in writing, software
|
|
198
|
+
distributed under the License is distributed on an "AS IS" BASIS,
|
|
199
|
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
200
|
+
See the License for the specific language governing permissions and
|
|
201
|
+
limitations under the License.
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Wallet Privacy Testkit 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 all
|
|
13
|
+
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 THE
|
|
21
|
+
SOFTWARE.
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
include CHANGELOG.md
|
|
2
|
+
include CITATION.cff
|
|
3
|
+
include CONTRIBUTING.md
|
|
4
|
+
include LICENSE-APACHE
|
|
5
|
+
include LICENSE-MIT
|
|
6
|
+
include README.md
|
|
7
|
+
include requirements-dev.txt
|
|
8
|
+
include SECURITY.md
|
|
9
|
+
recursive-include .github/workflows *.yml
|
|
10
|
+
recursive-include docs *.md
|
|
11
|
+
recursive-include evidence *.json *.md
|
|
12
|
+
recursive-include examples *.md *.json
|
|
13
|
+
recursive-include scripts *.py
|
|
14
|
+
recursive-include tests *.py
|
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
Metadata-Version: 2.4
|
|
2
|
+
Name: wallet-privacy-testkit
|
|
3
|
+
Version: 0.1.0
|
|
4
|
+
Summary: Adversarial network privacy and transaction-delivery tests for Zcash wallets
|
|
5
|
+
Author: Wallet Privacy Testkit contributors
|
|
6
|
+
License-Expression: MIT OR Apache-2.0
|
|
7
|
+
Project-URL: Homepage, https://github.com/ztsalexey/wallet-privacy-testkit
|
|
8
|
+
Project-URL: Repository, https://github.com/ztsalexey/wallet-privacy-testkit
|
|
9
|
+
Project-URL: Issues, https://github.com/ztsalexey/wallet-privacy-testkit/issues
|
|
10
|
+
Project-URL: Changelog, https://github.com/ztsalexey/wallet-privacy-testkit/blob/main/CHANGELOG.md
|
|
11
|
+
Keywords: zcash,wallet,privacy,testing,grpc,tls
|
|
12
|
+
Classifier: Development Status :: 3 - Alpha
|
|
13
|
+
Classifier: Environment :: Console
|
|
14
|
+
Classifier: Intended Audience :: Developers
|
|
15
|
+
Classifier: Programming Language :: Python :: 3
|
|
16
|
+
Classifier: Programming Language :: Python :: 3.11
|
|
17
|
+
Classifier: Programming Language :: Python :: 3.12
|
|
18
|
+
Classifier: Programming Language :: Python :: 3.13
|
|
19
|
+
Classifier: Topic :: Software Development :: Testing
|
|
20
|
+
Classifier: Topic :: Security
|
|
21
|
+
Requires-Python: >=3.11
|
|
22
|
+
Description-Content-Type: text/markdown
|
|
23
|
+
License-File: LICENSE-APACHE
|
|
24
|
+
License-File: LICENSE-MIT
|
|
25
|
+
Requires-Dist: grpcio<2,>=1.70
|
|
26
|
+
Requires-Dist: protobuf<8,>=5
|
|
27
|
+
Dynamic: license-file
|
|
28
|
+
|
|
29
|
+
# Wallet Privacy Testkit for Zcash
|
|
30
|
+
|
|
31
|
+
Wallet Privacy Testkit is an adversarial test layer for Zcash wallet-to-indexer traffic. It records the lengths and timing visible outside TLS, injects uncertainty around `SendTransaction`, and evaluates size-only transaction matching without awarding full credit to ties.
|
|
32
|
+
|
|
33
|
+
This is an independent project maintained at [ztsalexey/wallet-privacy-testkit](https://github.com/ztsalexey/wallet-privacy-testkit). It is not affiliated with or endorsed by the Zcash Foundation, Electric Coin Company, or any wallet or indexer maintainer.
|
|
34
|
+
|
|
35
|
+
Version 0.1.0 is a research preview. It supplies reusable test components and a verified Zingolib case study. It does not certify a wallet, assign a privacy score, inspect mainnet funds, or replace a wallet's existing integration tests.
|
|
36
|
+
|
|
37
|
+
## Why this exists
|
|
38
|
+
|
|
39
|
+
A shielded transaction can hide its participants and value on-chain while its network behavior still leaks information. A second failure mode appears when a node accepts a payment but the wallet loses the response. The wallet must distinguish rejection from an unknown outcome and recover without creating another payment.
|
|
40
|
+
|
|
41
|
+
Existing projects already provision Zcash regtest networks and test wallet behavior. This testkit attaches to those environments and contributes two narrower capabilities:
|
|
42
|
+
|
|
43
|
+
- passive ciphertext metadata capture, without TLS keys or payload logging;
|
|
44
|
+
- protocol-aware failure injection before or after transaction submission.
|
|
45
|
+
|
|
46
|
+
The [methodology](docs/METHODOLOGY.md) defines what each result means. The [threat model](docs/THREAT_MODEL.md) states what it does not establish.
|
|
47
|
+
|
|
48
|
+
## Install from a source checkout
|
|
49
|
+
|
|
50
|
+
Python 3.11 or newer is required.
|
|
51
|
+
|
|
52
|
+
```sh
|
|
53
|
+
python3 -m venv .venv
|
|
54
|
+
source .venv/bin/activate
|
|
55
|
+
.venv/bin/python -m pip install -r requirements-dev.txt
|
|
56
|
+
.venv/bin/python -m pip install --no-deps -e .
|
|
57
|
+
.venv/bin/python -m unittest discover -s tests -v
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
The release was developed with Python 3.12.9, gRPC 1.83.1, and protobuf 7.36.1. CI tests the pinned development environment on Python 3.11–3.13 on Linux and macOS. The broader runtime dependency ranges are not exhaustively tested.
|
|
61
|
+
|
|
62
|
+
Packaged wheels and source archives are available from [GitHub Releases](https://github.com/ztsalexey/wallet-privacy-testkit/releases). After activating a virtual environment, install a downloaded wheel with `python -m pip install ./wallet_privacy_testkit-0.1.0-py3-none-any.whl`.
|
|
63
|
+
|
|
64
|
+
## Passive TLS metadata capture
|
|
65
|
+
|
|
66
|
+
Point a wallet at the printed local port while the target indexer remains at `localhost:9067`:
|
|
67
|
+
|
|
68
|
+
```sh
|
|
69
|
+
wpt capture \
|
|
70
|
+
--target-host localhost \
|
|
71
|
+
--target-port 9067 \
|
|
72
|
+
--listen-port 7443 \
|
|
73
|
+
--output trace.jsonl
|
|
74
|
+
```
|
|
75
|
+
|
|
76
|
+
Stop the capture with Ctrl-C, then validate that every captured TCP byte belongs to a complete TLS record:
|
|
77
|
+
|
|
78
|
+
```sh
|
|
79
|
+
wpt summarize trace.jsonl
|
|
80
|
+
```
|
|
81
|
+
|
|
82
|
+
The forwarder copies bytes unchanged. Its trace contains connection numbers, monotonic timestamps, directions, byte counts, TLS content types, and TLS record lengths. It does not terminate TLS, store addresses, or record packet contents. A process boundary supplied by the test operator is still side information and must be disclosed in a report.
|
|
83
|
+
|
|
84
|
+
## Transaction delivery faults
|
|
85
|
+
|
|
86
|
+
The semantic relay terminates a test TLS connection and forwards the real gRPC service. It understands only enough of the lightwalletd protocol to identify and hash `RawTransaction.data`; it never writes signed transaction bytes. All other known RPCs are forwarded as opaque bytes using their required streaming cardinality.
|
|
87
|
+
|
|
88
|
+
The forwarding table was checked against canonical `lightwallet-protocol` v0.5.0. A later protocol version that adds a streaming RPC requires a testkit update before that RPC can pass through correctly.
|
|
89
|
+
|
|
90
|
+
For a TLS upstream and TLS-facing wallet:
|
|
91
|
+
|
|
92
|
+
```sh
|
|
93
|
+
wpt fault-relay \
|
|
94
|
+
--upstream localhost:9067 \
|
|
95
|
+
--upstream-ca test-ca.pem \
|
|
96
|
+
--certificate localhost.pem \
|
|
97
|
+
--private-key localhost.key \
|
|
98
|
+
--mode after-once \
|
|
99
|
+
--events events.json
|
|
100
|
+
```
|
|
101
|
+
|
|
102
|
+
The supported modes are:
|
|
103
|
+
|
|
104
|
+
| Mode | Behavior |
|
|
105
|
+
| --- | --- |
|
|
106
|
+
| `before-once` | Fail the first submission without forwarding it, then forward normally |
|
|
107
|
+
| `after-once` | Forward the first submission and discard its response, then forward normally |
|
|
108
|
+
| `after-all` | Forward every submission and discard every response |
|
|
109
|
+
|
|
110
|
+
Use the relay only with disposable wallets and isolated regtest funds. The tool deliberately changes transaction-delivery behavior. The test operator remains responsible for checking the node's mempool or chain and the wallet's eventual state.
|
|
111
|
+
|
|
112
|
+
An insecure local upstream or client can omit the certificate options. The relay binds to `127.0.0.1` by default. Supplying only one of `--certificate` and `--private-key` is rejected.
|
|
113
|
+
|
|
114
|
+
The printed endpoint uses `127.0.0.1`. When the wallet-facing side uses TLS, the server certificate must therefore contain the IP address `127.0.0.1` in its Subject Alternative Name. The upstream CA file is required for a TLS upstream; omitting it selects an insecure upstream channel.
|
|
115
|
+
|
|
116
|
+
## Size-only matching
|
|
117
|
+
|
|
118
|
+
`wpt match samples.json` accepts a JSON array. Each row must contain a unique `id`, a `batch`, `observed_bytes`, and the corresponding public `transaction_bytes`. Batch 0 calibrates a single median byte offset by default. Every other observation is compared only with candidates in its own batch.
|
|
119
|
+
|
|
120
|
+
```json
|
|
121
|
+
[
|
|
122
|
+
{"id":"train-a","batch":0,"observed_bytes":9207,"transaction_bytes":9165},
|
|
123
|
+
{"id":"train-b","batch":0,"observed_bytes":12363,"transaction_bytes":12321},
|
|
124
|
+
{"id":"test-a","batch":1,"observed_bytes":9207,"transaction_bytes":9165},
|
|
125
|
+
{"id":"test-b","batch":1,"observed_bytes":12363,"transaction_bytes":12321}
|
|
126
|
+
]
|
|
127
|
+
```
|
|
128
|
+
|
|
129
|
+
Nearest candidates share credit when their distance ties. A batch with fewer than two candidates is rejected because singleton identification says nothing about the matcher. The tool reports a random reference computed from each held-out batch's candidate count.
|
|
130
|
+
|
|
131
|
+
## Verified case study
|
|
132
|
+
|
|
133
|
+
The included [Zingolib v5 regtest report](evidence/zingolib-v5-regtest/REPORT.md) records 18 newly constructed shielded payments and three delivery-fault transactions in the complete run. The wallet reported a payment as failed after its acknowledgement was lost even though Zebra had accepted it. Mining and synchronization corrected the status to confirmed. Current Zingolib development code already includes related duplicate and delivery-check handling, so this is regression evidence rather than a claim of an unresolved current bug.
|
|
134
|
+
|
|
135
|
+
The case study also found that encrypted lengths distinguished 1-, 2-, and 4-recipient transaction structures in a favorable observer model. Equal-structure payments tied at chance. The result does not estimate deanonymization in normal wallet traffic.
|
|
136
|
+
|
|
137
|
+
## Project status
|
|
138
|
+
|
|
139
|
+
The release boundary is intentionally small. Z3, Zcash Integration Tests, Regchest, and wallet-specific suites already cover network provisioning and broad functional behavior. The testkit is designed to complement them. See the [competitive and overlap review](docs/COMPETITIVE_LANDSCAPE.md) and [release checklist](docs/RELEASE_CHECKLIST.md).
|
|
140
|
+
|
|
141
|
+
Upstream contributions should begin with a maintainer-acknowledged issue and a narrowly scoped regression, following the target repository's contribution policy.
|
|
142
|
+
|
|
143
|
+
## License
|
|
144
|
+
|
|
145
|
+
Licensed under either the MIT License or Apache License 2.0, at your option.
|
|
@@ -0,0 +1,117 @@
|
|
|
1
|
+
# Wallet Privacy Testkit for Zcash
|
|
2
|
+
|
|
3
|
+
Wallet Privacy Testkit is an adversarial test layer for Zcash wallet-to-indexer traffic. It records the lengths and timing visible outside TLS, injects uncertainty around `SendTransaction`, and evaluates size-only transaction matching without awarding full credit to ties.
|
|
4
|
+
|
|
5
|
+
This is an independent project maintained at [ztsalexey/wallet-privacy-testkit](https://github.com/ztsalexey/wallet-privacy-testkit). It is not affiliated with or endorsed by the Zcash Foundation, Electric Coin Company, or any wallet or indexer maintainer.
|
|
6
|
+
|
|
7
|
+
Version 0.1.0 is a research preview. It supplies reusable test components and a verified Zingolib case study. It does not certify a wallet, assign a privacy score, inspect mainnet funds, or replace a wallet's existing integration tests.
|
|
8
|
+
|
|
9
|
+
## Why this exists
|
|
10
|
+
|
|
11
|
+
A shielded transaction can hide its participants and value on-chain while its network behavior still leaks information. A second failure mode appears when a node accepts a payment but the wallet loses the response. The wallet must distinguish rejection from an unknown outcome and recover without creating another payment.
|
|
12
|
+
|
|
13
|
+
Existing projects already provision Zcash regtest networks and test wallet behavior. This testkit attaches to those environments and contributes two narrower capabilities:
|
|
14
|
+
|
|
15
|
+
- passive ciphertext metadata capture, without TLS keys or payload logging;
|
|
16
|
+
- protocol-aware failure injection before or after transaction submission.
|
|
17
|
+
|
|
18
|
+
The [methodology](docs/METHODOLOGY.md) defines what each result means. The [threat model](docs/THREAT_MODEL.md) states what it does not establish.
|
|
19
|
+
|
|
20
|
+
## Install from a source checkout
|
|
21
|
+
|
|
22
|
+
Python 3.11 or newer is required.
|
|
23
|
+
|
|
24
|
+
```sh
|
|
25
|
+
python3 -m venv .venv
|
|
26
|
+
source .venv/bin/activate
|
|
27
|
+
.venv/bin/python -m pip install -r requirements-dev.txt
|
|
28
|
+
.venv/bin/python -m pip install --no-deps -e .
|
|
29
|
+
.venv/bin/python -m unittest discover -s tests -v
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
The release was developed with Python 3.12.9, gRPC 1.83.1, and protobuf 7.36.1. CI tests the pinned development environment on Python 3.11–3.13 on Linux and macOS. The broader runtime dependency ranges are not exhaustively tested.
|
|
33
|
+
|
|
34
|
+
Packaged wheels and source archives are available from [GitHub Releases](https://github.com/ztsalexey/wallet-privacy-testkit/releases). After activating a virtual environment, install a downloaded wheel with `python -m pip install ./wallet_privacy_testkit-0.1.0-py3-none-any.whl`.
|
|
35
|
+
|
|
36
|
+
## Passive TLS metadata capture
|
|
37
|
+
|
|
38
|
+
Point a wallet at the printed local port while the target indexer remains at `localhost:9067`:
|
|
39
|
+
|
|
40
|
+
```sh
|
|
41
|
+
wpt capture \
|
|
42
|
+
--target-host localhost \
|
|
43
|
+
--target-port 9067 \
|
|
44
|
+
--listen-port 7443 \
|
|
45
|
+
--output trace.jsonl
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
Stop the capture with Ctrl-C, then validate that every captured TCP byte belongs to a complete TLS record:
|
|
49
|
+
|
|
50
|
+
```sh
|
|
51
|
+
wpt summarize trace.jsonl
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
The forwarder copies bytes unchanged. Its trace contains connection numbers, monotonic timestamps, directions, byte counts, TLS content types, and TLS record lengths. It does not terminate TLS, store addresses, or record packet contents. A process boundary supplied by the test operator is still side information and must be disclosed in a report.
|
|
55
|
+
|
|
56
|
+
## Transaction delivery faults
|
|
57
|
+
|
|
58
|
+
The semantic relay terminates a test TLS connection and forwards the real gRPC service. It understands only enough of the lightwalletd protocol to identify and hash `RawTransaction.data`; it never writes signed transaction bytes. All other known RPCs are forwarded as opaque bytes using their required streaming cardinality.
|
|
59
|
+
|
|
60
|
+
The forwarding table was checked against canonical `lightwallet-protocol` v0.5.0. A later protocol version that adds a streaming RPC requires a testkit update before that RPC can pass through correctly.
|
|
61
|
+
|
|
62
|
+
For a TLS upstream and TLS-facing wallet:
|
|
63
|
+
|
|
64
|
+
```sh
|
|
65
|
+
wpt fault-relay \
|
|
66
|
+
--upstream localhost:9067 \
|
|
67
|
+
--upstream-ca test-ca.pem \
|
|
68
|
+
--certificate localhost.pem \
|
|
69
|
+
--private-key localhost.key \
|
|
70
|
+
--mode after-once \
|
|
71
|
+
--events events.json
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
The supported modes are:
|
|
75
|
+
|
|
76
|
+
| Mode | Behavior |
|
|
77
|
+
| --- | --- |
|
|
78
|
+
| `before-once` | Fail the first submission without forwarding it, then forward normally |
|
|
79
|
+
| `after-once` | Forward the first submission and discard its response, then forward normally |
|
|
80
|
+
| `after-all` | Forward every submission and discard every response |
|
|
81
|
+
|
|
82
|
+
Use the relay only with disposable wallets and isolated regtest funds. The tool deliberately changes transaction-delivery behavior. The test operator remains responsible for checking the node's mempool or chain and the wallet's eventual state.
|
|
83
|
+
|
|
84
|
+
An insecure local upstream or client can omit the certificate options. The relay binds to `127.0.0.1` by default. Supplying only one of `--certificate` and `--private-key` is rejected.
|
|
85
|
+
|
|
86
|
+
The printed endpoint uses `127.0.0.1`. When the wallet-facing side uses TLS, the server certificate must therefore contain the IP address `127.0.0.1` in its Subject Alternative Name. The upstream CA file is required for a TLS upstream; omitting it selects an insecure upstream channel.
|
|
87
|
+
|
|
88
|
+
## Size-only matching
|
|
89
|
+
|
|
90
|
+
`wpt match samples.json` accepts a JSON array. Each row must contain a unique `id`, a `batch`, `observed_bytes`, and the corresponding public `transaction_bytes`. Batch 0 calibrates a single median byte offset by default. Every other observation is compared only with candidates in its own batch.
|
|
91
|
+
|
|
92
|
+
```json
|
|
93
|
+
[
|
|
94
|
+
{"id":"train-a","batch":0,"observed_bytes":9207,"transaction_bytes":9165},
|
|
95
|
+
{"id":"train-b","batch":0,"observed_bytes":12363,"transaction_bytes":12321},
|
|
96
|
+
{"id":"test-a","batch":1,"observed_bytes":9207,"transaction_bytes":9165},
|
|
97
|
+
{"id":"test-b","batch":1,"observed_bytes":12363,"transaction_bytes":12321}
|
|
98
|
+
]
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
Nearest candidates share credit when their distance ties. A batch with fewer than two candidates is rejected because singleton identification says nothing about the matcher. The tool reports a random reference computed from each held-out batch's candidate count.
|
|
102
|
+
|
|
103
|
+
## Verified case study
|
|
104
|
+
|
|
105
|
+
The included [Zingolib v5 regtest report](evidence/zingolib-v5-regtest/REPORT.md) records 18 newly constructed shielded payments and three delivery-fault transactions in the complete run. The wallet reported a payment as failed after its acknowledgement was lost even though Zebra had accepted it. Mining and synchronization corrected the status to confirmed. Current Zingolib development code already includes related duplicate and delivery-check handling, so this is regression evidence rather than a claim of an unresolved current bug.
|
|
106
|
+
|
|
107
|
+
The case study also found that encrypted lengths distinguished 1-, 2-, and 4-recipient transaction structures in a favorable observer model. Equal-structure payments tied at chance. The result does not estimate deanonymization in normal wallet traffic.
|
|
108
|
+
|
|
109
|
+
## Project status
|
|
110
|
+
|
|
111
|
+
The release boundary is intentionally small. Z3, Zcash Integration Tests, Regchest, and wallet-specific suites already cover network provisioning and broad functional behavior. The testkit is designed to complement them. See the [competitive and overlap review](docs/COMPETITIVE_LANDSCAPE.md) and [release checklist](docs/RELEASE_CHECKLIST.md).
|
|
112
|
+
|
|
113
|
+
Upstream contributions should begin with a maintainer-acknowledged issue and a narrowly scoped regression, following the target repository's contribution policy.
|
|
114
|
+
|
|
115
|
+
## License
|
|
116
|
+
|
|
117
|
+
Licensed under either the MIT License or Apache License 2.0, at your option.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
# Security policy
|
|
2
|
+
|
|
3
|
+
## Supported version
|
|
4
|
+
|
|
5
|
+
Version 0.1.x receives security fixes while it remains the current release line.
|
|
6
|
+
|
|
7
|
+
## Reporting a vulnerability
|
|
8
|
+
|
|
9
|
+
Do not include wallet seeds, private keys, signed mainnet transactions, or identifying traffic captures in a public report. Prepare a minimal reproduction with synthetic or regtest data and use [GitHub private vulnerability reporting](https://github.com/ztsalexey/wallet-privacy-testkit/security/advisories/new). The repository owner must enable private vulnerability reporting before publication.
|
|
10
|
+
|
|
11
|
+
## Operational boundary
|
|
12
|
+
|
|
13
|
+
The fault relay is intended for isolated test environments. It terminates TLS and receives a serialized transaction in memory so it can hash the signed bytes and identify retries. It does not persist those bytes. A compromised host can still inspect process memory, files, or wallet traffic, so the test machine is part of the trust boundary.
|
|
14
|
+
|
|
15
|
+
The passive capture forwarder does not terminate TLS and logs metadata only. It is not an anonymity system and does not protect the traffic it observes.
|